How to convert JSON to CSV
- Paste a JSON array of objects, such as the output of an API, into the box, or press Insert example.
- Pick the delimiter: a comma for most tools, a semicolon for Excel in many European locales, or a tab to paste straight into a sheet.
- Copy the CSV or download it as a .csv file and open it in Excel, Google Sheets or Numbers.
If the JSON is not valid, the tool says so and tells you to fix it first; the JSON validator shows the exact line.
A worked example
Three records with a nested object, a list, a comma and quotation marks in the values:
[{"id":1,"name":"Ada","address":{"city":"London","zip":"N1"},"tags":["math","code"]},{"id":2,"name":"Grace, Admiral","address":{"city":"New York"},"tags":[]},{"id":3,"name":"Linus \"Penguin\""}]The CSV:
id,name,address.city,address.zip,tags 1,Ada,London,N1,math; code 2,"Grace, Admiral",New York,, 3,"Linus ""Penguin""",,,
- The columns are the union of all keys in order of first appearance. Record 3 has no address, so its address cells are empty.
- Nested objects become dotted column names (
address.city), one column per leaf value. - A list of simple values is joined with
;in one cell (math; code). An empty list gives an empty cell. - A value that contains the delimiter, a quote or a line break is wrapped in quotes and inner quotes are doubled, as RFC 4180 says:
"Grace, Admiral","Linus ""Penguin""".
Delimiters and Excel
Excel reads a CSV with the list separator of your regional settings. In the US and UK that is a comma; in Germany, France, Spain, Italy, Brazil and others the comma is the decimal mark, so the list separator is a semicolon and a comma-separated file opens as one column. If that happens, choose Semicolon. The same data with a semicolon delimiter:
id;name;address.city;address.zip;tags 1;Ada;London;N1;"math; code" 2;Grace, Admiral;New York;; 3;"Linus ""Penguin""";;;
Tab-separated text pastes into a spreadsheet cell grid directly. Numbers are written as they are in the JSON (no thousands separators), and dates stay text, so Excel decides how to read them: a value such as 0012 that was a string in JSON may lose its zeros when Excel opens the file. Import the column as text if that matters.
What the converter assumes
- The input is an array of objects, the usual shape of a list API response. A single object is treated as one row:
{"a":1,"b":2}givesa,b 1,2
- Objects with different keys are fine:
[{"a":1},{"b":2}]givesa,b 1, ,2
- Arrays of objects inside a record are flattened with an index in the name (
items.0.sku,items.1.sku). For a long list that makes many columns; consider converting the inner array on its own. - null becomes an empty cell, and true/false become the words true and false.
- Rows from an array of plain values (numbers or strings) are written under a single column named
value.
Going the other way? CSV to JSON converts back and can turn numbers and booleans into real JSON types. To read or reformat the JSON first, use the JSON formatter.
Related tools
- CSV to JSON converter – the reverse conversion
- JSON formatter – format the JSON first to read it
- JSON validator – find the line of a JSON error
- XML formatter
JSON to CSV converter FAQ
How do I convert JSON to CSV?
Paste a JSON array of objects, pick a delimiter and copy the CSV or download the file. Each object becomes a row and the keys become the header row.
How are nested objects handled?
They are flattened: {"address":{"city":"London"}} becomes a column named address.city. A list of simple values is joined into one cell with semicolons.
Why does Excel put everything in one column?
Your Excel uses a semicolon as the list separator (common in European locales). Choose the Semicolon delimiter, or import the file and tell Excel the separator.
What if my objects have different keys?
The header is the union of all keys. A record without a key gets an empty cell in that column.
Can it convert a single JSON object?
Yes. A single object becomes one row with its keys as the header.
Is my JSON uploaded?
No. The conversion runs in your browser and nothing is sent or stored.