Skip to the content

Contact usFree tools · No signup · Files stay on your device

Developer Tools

JSON to CSV: the complete guide to opening JSON data in Excel

JSON to CSV: the complete guide to opening JSON data in Excel

JSON is how APIs send data, but most people want to look at it, sort it and filter it in a spreadsheet. The bridge is CSV: a flat table of rows and columns that Excel and Google Sheets open directly. Our free JSON to CSV converter turns a JSON array into that table, flattens nested objects into columns such as address.city, quotes every value correctly, and can write a file Excel reads with the right encoding.

This guide covers each option, shows how nested data is flattened, and lists the things to check before you open the result. If you only want the shortest path from API response to spreadsheet, see how to open JSON data in Excel or Google Sheets.

What JSON to CSV does

It parses your JSON, finds the list of records, works out the columns, and writes a CSV with your choice of delimiter. It runs in your browser and shows a preview table so you can see the result before you download.

It does not send anything to a server, it does not make an .xlsx workbook (for that, see CSV to Excel or JSON to Excel), and it does not repair invalid JSON: you get an "Invalid JSON at line X, column Y" message with a reason instead.

How to use JSON to CSV, step by step

  1. Open JSON to CSV.
  2. Paste JSON into the box labelled "Paste a JSON array of objects", or press Open file (.json), or Sample.
  3. Under Options, choose the Delimiter and how Nested arrays are written, and tick any of the four boxes you need.
  4. Check the "CSV output" panel and the Preview table, which shows up to the first 100 rows. The stats show Rows, Columns, Output size and Time.
  5. Press Copy, or Download .csv. The file is named after the one you opened, or data.csv, with "Tech Solution Point - " in front like all downloads on the site.

How nested JSON is flattened

Take this array of three customers:

[
  {"id":1,"name":"Rahim Uddin","phone":"01712345678","active":true,"tags":["vip","dhaka"],"address":{"city":"Dhaka","area":"Mirpur"}},
  {"id":2,"name":"Karim, Abdul","phone":"01812345678","active":false,"tags":[],"address":{"city":"Cumilla"},"note":"Said \"call first\""},
  {"id":3,"name":"Nusrat Jahan","phone":"01912345678","balance":1250.5,"address":{"city":"Rajshahi","area":"Boalia"}}
]

With the default options the CSV is:

id,name,phone,active,tags,address.city,address.area,note,balance
1,Rahim Uddin,01712345678,true,"[""vip"",""dhaka""]",Dhaka,Mirpur,,
2,"Karim, Abdul",01812345678,false,[],Cumilla,,"Said ""call first""",
3,Nusrat Jahan,01912345678,,,Rajshahi,Boalia,,1250.5

Read it line by line. The address object became two columns, address.city and address.area. The tags array became one column holding JSON text, which is why it is quoted: it contains commas and quotes. The name "Karim, Abdul" is wrapped in quotes because of its comma, and the note's quotes are doubled. The third customer has no active, tags or note, so those cells are empty, and note and balance appear as columns because some other record had them. Columns appear in the order each key was first seen.

Every option explained

Delimiter

Comma (,), Semicolon (;), Tab or Pipe (|). Use comma for most programs. Use semicolon for Excel in countries where the decimal separator is a comma, or Tab for a .tsv file. If a value contains the chosen delimiter, it is quoted.

Nested arrays: As JSON text or As columns

"As JSON text ([1,2])" keeps an array in a single cell, as in the example above. "As columns (tags.0, tags.1)" spreads each item into its own column. With our data it gives:

id,name,phone,active,tags.0,tags.1,address.city,address.area,tags,note,balance
1,Rahim Uddin,01712345678,true,vip,dhaka,Dhaka,Mirpur,,,

One quirk to know: an empty array in this mode creates a separate tags column holding [] (customer 2 has it), because there are no items to spread. If your arrays vary a lot in length, you will also get many columns; the tool warns when there are more than 1,000.

Include header row

On by default. Untick it to get only the data rows, for example when you are appending to an existing file. An array of arrays, in the default As JSON text mode, never gets a header, because it has no key names.

Excel-friendly (UTF-8 BOM + CRLF)

Off by default. When ticked, the file starts with an invisible UTF-8 byte order mark and uses Windows line endings. Excel needs that mark to know the file is UTF-8, so without it, names like José, or Bangla text, can appear as strange symbols. If the CSV is going to Excel, tick it. If it is going to a program or database that does not expect a BOM, leave it off.

Quote every field

Off by default, in which case only values that need quotes get them: those containing the delimiter, a double quote or a line break, or starting or ending with a space. Tick it to wrap every value, numbers included, which some strict importers prefer. The rules behind quoting are explained in how to handle commas and quotes inside CSV values.

Protect against formula injection (= + - @)

Off by default. A spreadsheet treats a cell starting with =, +, - or @ as a formula. If your data came from untrusted people, a value like =HYPERLINK(...) could do something unwanted. When ticked, such values are prefixed with an apostrophe: =SUM(1,2) is written as '=SUM(1,2), and -abc as '-abc. Ordinary numbers such as -5 and +88017 are left alone. Tick it for any data you will open from a form, a survey or user input.

Which JSON shapes work

  • Array of objects: the ideal shape. One row per object.
  • Object wrapping one array of objects, such as {"status":"ok","data":[...]}: the tool uses that array and tells you, with a note such as "Using the array in “data”".
  • Array of arrays: each inner array becomes one row as it is, with no header, and the columns are named column_1, column_2, and so on in the preview.
  • A single object: it becomes one row, and a note says so. This is also what you get when an object holds two or more arrays, because the tool cannot know which one you meant.
  • A single value: one cell.
  • A mixed array such as [1, "a", {"x": 1}]: items that are not objects go in a column named value, and a warning says how many.

Privacy

JSON to CSV runs entirely in your browser. Your JSON is not sent to our server, so customer lists and API responses stay on your device.

What to watch when you open the CSV in Excel

Excel decides what each cell is when you double-click a CSV. Two things catch people out. Phone numbers such as 01712345678 can lose their leading zero because Excel reads them as numbers, and very long numbers can be shown in scientific notation. The CSV itself is correct; the fix is to import it instead of double-clicking. In Excel, choose Data, then From Text/CSV, and set the data type detection to "Do not detect data types", or set the column to Text. In Google Sheets, use File, Import, and untick "Convert text to numbers, dates, and formulas". The step-by-step version is in how to open JSON data in Excel or Google Sheets.

Common problems and how to fix them

"Invalid JSON at line 1, column 11: ..."

The input is not valid JSON, and the reason follows the position. Common ones are a trailing comma, single quotes, or a cut-off response. The JSON Validator guide explains each message, and the JSON Formatter can tidy the text once it parses.

"N items are not an object, so they were put in a “value” column."

Your array mixes records with plain values. Clean the data, or accept the value column.

There is one row, not the many I expected

The top level is an object that does not wrap exactly one array of objects. Paste the array itself, or remove the other arrays.

Hundreds of columns

Deeply nested data and As columns together can explode the column count. Switch Nested arrays back to As JSON text.

The columns are in an odd order

Columns follow first appearance. If your first record lacks a key, that key appears later. Sort or reorder the columns in the spreadsheet.

Quick checklist

  • Paste an array of objects, or an object wrapping one.
  • Tick Excel-friendly if the file goes to Excel.
  • Use As columns only when arrays are short and similar.
  • Tick formula protection for untrusted data.
  • Import into Excel instead of double-clicking if you have leading zeros.

Frequently asked questions

What kind of JSON works best?
An array of objects, where each object becomes one row and each key becomes a column. The tool also accepts an array of arrays, a single object (one row), and an object that wraps exactly one array of objects, such as {"data": [ ... ]}.
What if the objects have different keys?
The CSV gets the union of all keys, in the order they first appear. An object that does not have a key gets an empty cell in that column.
How are nested objects and arrays written?
Nested objects are flattened into dot-path columns such as address.city. Arrays are written as JSON text like ["vip","dhaka"], or, if you choose As columns, as tags.0 and tags.1.
Why do Bangla letters look wrong when I double-click the CSV?
Excel needs a UTF-8 byte order mark to read non-English text correctly. Tick Excel-friendly (UTF-8 BOM + CRLF) before you copy or download. It is off by default.
Why did the phone number lose its leading zero in Excel?
A CSV file only holds text, and Excel decides for itself that 01712345678 is a number when you double-click the file. The converter writes the zero correctly; to keep it, import the file with Data, From Text/CSV and set that column to Text.
Found this useful? Share it

Tools in this guide

Main tool

JSON to CSV

Turn JSON arrays into a CSV you can open in Excel or Google Sheets.

Open tool

CSV to JSON

Paste CSV or open a file to get clean JSON — an array of objects or arrays — with proper handling of quotes, line breaks, delimiters and data types.

Open tool

JSON Formatter

Paste messy or minified JSON to get clean, indented output instantly — or minify it for production.

Open tool

JSON Validator

Check whether your JSON is valid and get the exact line, column and reason for any error.

Open tool

Back to all guides & blog