About this tool
Turn a JSON list into a CSV table
This tool converts JSON to CSV in your browser. Give it a list of objects and each object becomes a row, with a column for every key. Nested objects get dotted column names, and the result updates as you type. Copy it or save a .csv file for a spreadsheet. Nothing leaves your device.
One object, one row
A list of objects becomes a table: each object is a row and each key is a column. The columns are every key that appears anywhere in the list, in the order they first show up, so an object that lacks a key simply has an empty cell there. null also gives an empty cell.
If you paste a single object it becomes one row. A list of plain values becomes one column named value, and a list of lists is written by position, with columns 1, 2, 3 and so on.
What happens to nested data
A table has no room for objects inside objects, so a nested object is spread across columns named by their path: an address with a city becomes a column called address.city. Go as deep as the data goes and the names follow.
A list inside a row, such as tags, is kept as JSON text in a single cell, quoted so a spreadsheet reads it as one value. An empty object is kept as {} in its cell.
Ready for Excel and Google Sheets
Cells follow the usual CSV rules: a value with a comma, a quote, a line break or a space at either end is put in quotes, and a quote inside it is doubled. Rows end with a line feed, which spreadsheets open without trouble.
Numbers are written with every digit they had in the JSON, so a long ID is not turned into a rounded number. Whether a spreadsheet then shows it in full is up to the spreadsheet, so format that column as text if you need to.
Check and tidy the JSON first
If the text is not valid JSON, the page shows the line and column of the first problem instead of a table. The JSON formatter on this site checks and tidies the same text first, if you want a closer look at it.
How it works
-
Step 1:Paste a JSON list
Paste it, open a .json file or drop one on the page. An array of objects works best.
-
Step 2:Check the table
The CSV appears as you type. Turn on Sort keys to put the columns in alphabetical order.
-
Step 3:Copy or save the CSV
Copy puts it on the clipboard. Download saves a .csv file named after your JSON file, or data.csv.
Questions, answered
How do I convert JSON to CSV for Excel?
Paste a JSON list of objects, then press Download to save a .csv file and open it in Excel or Google Sheets. The first row holds the column names, taken from the keys.
What if my objects have different keys?
The table gets a column for every key that appears in any object, in the order they first appear. An object without a key leaves that cell empty.
How are nested objects and lists written?
A nested object is spread over columns named by their path, like address.city. A list inside an object stays in one cell as JSON text, so no data is dropped.
Why does it say it needs an array of objects?
A single string, number or true/false has nothing to put in columns. Give it a list of objects, one object, or a list of lists and it makes a table.
Can I turn CSV back into JSON here?
Not yet. This page goes one way, from JSON to CSV. Reading CSV is a different job, and nothing here guesses at it.
Is my data sent to a converter?
No. The conversion runs inside this page, on your device. The data is not saved and never appears in the address of the page.