JSON to CSV

Flatten JSON arrays into CSV you can open in any spreadsheet.

  • Runs in your browser
  • Free, no sign-up
Paste JSON to start

About the JSON to CSV

APIs, databases and web apps hand out data as JSON, but spreadsheets want rows and columns. The JSON to CSV converter turns a JSON array of records into a CSV table you can open in Excel, Google Sheets or Numbers, import into a database, or send to someone who does not read JSON.

Every key becomes a column, even when it appears in only some records. Nested objects are flattened into columns like address.city, lists can be kept as JSON or joined into one cell, and values that contain commas, quotes or line breaks are quoted the way spreadsheet programs expect. A preview table shows the first 50 rows so you can check the columns before you download.

The download is ready for Excel: it adds the byte order mark that makes Excel read accented letters correctly and uses Windows line endings. Numbers are copied exactly as written in your JSON, and everything runs in your browser, so your data never leaves your device.

How to use it

  1. Add your JSONPaste an array of objects, drop a .json file onto the box, or use Open. Sample loads three contact records.
  2. Choose a delimiterComma is the standard. Pick semicolon if your Excel uses commas as the decimal separator, or tab for a TSV file.
  3. Decide how to handle nestingLeave "Flatten nested objects" on to turn address.city into its own column. For lists inside a record, keep them as JSON or join them with a semicolon.
  4. Check the previewThe status line shows the number of rows and columns, and the Preview table shows the first 50 rows as they will appear in a spreadsheet.
  5. Copy or downloadCopy the CSV text, or download data.csv (data.tsv for tabs). Leave "Excel friendly download" on if the file is going to Excel.

Key features

All keys become columns

Columns are collected from every record in the order they first appear. Records without a key get an empty cell.

Nested objects flattened

{"address": {"city": "Lisbon"}} becomes a column called address.city, at any depth.

Lists handled

Keep a list as JSON text, like ["admin","editor"], or join simple lists into one cell, like admin; editor.

Correct quoting

Values with the delimiter, quotes, line breaks or spaces at either end are quoted, with inner quotes doubled. You can also quote every field.

Exact numbers

Numbers are copied as written, so 12345678901234567890 and 1.10 reach the CSV unchanged.

Private by design

The JSON is turned into CSV on your device, with no upload.

Examples

Converting contact records

The Sample button loads three records. The third one has no email, no country and no tags, but has an "active" key the others lack:

[{"id": 1, "name": "Ana Silva", "email": "ana@example.com", "address": {"city": "Lisbon", "country": "PT"}, "tags": ["admin", "editor"]},
 {"id": 2, "name": "Okafor, Mia", "email": "mia@example.com", "address": {"city": "Lagos", "country": "NG"}, "tags": []},
 {"id": 3, "name": "Lee \"LC\" Chen", "address": {"city": "New York"}, "active": false}]

The status line reads 3 rows × 7 columns, and the CSV is:

id,name,email,address.city,address.country,tags,active
1,Ana Silva,ana@example.com,Lisbon,PT,"[""admin"",""editor""]",
2,"Okafor, Mia",mia@example.com,Lagos,NG,[],
3,"Lee ""LC"" Chen",,New York,,,false

"Okafor, Mia" is quoted because of its comma, the quotes around LC are doubled, and missing values are left empty.

Lists: keep as JSON or join

JSON listKeep as JSONJoin
["admin", "editor"]["admin","editor"]admin; editor
[][](empty)

Lists that contain objects or other lists always stay as JSON, because they cannot be joined into a readable cell.

Without flattening

Turn off "Flatten nested objects" and the sample has 6 columns instead of 7. The address stays together as JSON text in one cell:

id,name,email,address,tags,active
1,Ana Silva,ana@example.com,"{""city"":""Lisbon"",""country"":""PT""}","[""admin"",""editor""]",

Other JSON shapes

Your JSONCSV result
{"a1": {"qty": 2}, "b7": {"qty": 5}}A key column, then qty: 2 rows
{"name": "Ana", "age": 34}One row with 2 columns
[["sku", "qty"], ["A1", 2]]Each inner list is one row
[1, "two", true]One column called value
42Error: a single value has no columns

Tips

  • If Excel puts everything in column A, your Excel expects semicolons. Choose Semicolon as the delimiter and download again.
  • Keep "Excel friendly download" on for Excel. Google Sheets, databases and most programming tools read the file fine either way.
  • Use "Join with a semicolon" for simple lists like tags or categories. They are easier to read and filter in a spreadsheet than JSON text.
  • If your JSON is wrapped in an object, such as {"data": [...]}, paste only the array inside it. Otherwise you get a single row.
  • To go the other way, the CSV to JSON converter turns a spreadsheet export back into JSON records, and can rebuild nested objects from address.city style headers.

Common mistakes and limits

  • Pasting the whole API responseMany APIs wrap records in an object with fields like "data", "items" or "results". Paste the array of records itself to get one row per record.
  • Opening the CSV by double-clicking in ExcelDepending on your region, Excel may split columns at the wrong character or turn long numbers into 1.23457E+19. Use Data > From Text/CSV and set those columns to Text if exact values matter.
  • Expecting lists to become separate rowsEach record is one row. A list inside a record goes into one cell, as JSON or joined. It is not spread over several rows.
  • Values that start with =, + or @Spreadsheet programs may treat a cell that starts with = as a formula. The converter copies values exactly, so check data from untrusted sources before opening it in Excel.
  • Forgetting that the header can be turned offIf you are appending rows to an existing sheet, turn off "Include the header row" so the column names are not added again.

Frequently asked questions

What JSON can I convert?
Best results come from an array of objects, one object per record. Single objects, objects of objects, arrays of arrays and lists of plain values also work.
How are nested objects handled?
With "Flatten nested objects" on, each nested key gets its own column, named with dots like address.city. With it off, the nested object is written into one cell as JSON.
What happens when records have different keys?
Every key from every record becomes a column. Records that do not have a key get an empty cell in that column.
How do I open the CSV in Excel?
Download it with "Excel friendly download" on and open it in Excel. The byte order mark tells Excel the file is UTF-8, so accented letters and symbols show correctly.
Should I use a comma or a semicolon?
Use a comma unless your Excel uses a comma as the decimal separator, which is common in Europe and South America. Then a semicolon opens correctly with a double-click.
Why are some values in quotes?
CSV requires quotes around values that contain the delimiter, a double quote, a line break, or spaces at the start or end. Quotes inside a value are written twice.
Are numbers changed?
No. Numbers are copied exactly as they appear in your JSON, including long IDs and trailing zeros like 1.10.
Is my data uploaded?
No. The conversion runs in your browser and nothing is sent to a server. Files up to 10 MB can be opened.