JSON to CSV: Turn API Data Into a Spreadsheet
By FindMySum · Last reviewed
This JSON to CSV converter turns an array of JSON objects, the shape most APIs return, into rows and columns you can open in Excel, Google Sheets or Numbers. Paste the JSON above and the CSV appears straight away; it is built in your browser, so the data stays on your device.
When you need it
APIs, databases and logging tools speak JSON, while finance, operations and anyone without a developer at hand works in spreadsheets. Converting to CSV is the quickest bridge: export the orders, users or events as JSON, convert, and sort or filter them in a spreadsheet.
How to use it
- Paste a JSON array of objects. A single object, an object of column arrays or an array of arrays works too.
- Decide how nested data should look. Dot-path columns are best for filtering in a spreadsheet; JSON text keeps the structure intact in one cell.
- Pick the delimiter your spreadsheet expects and, under advanced settings, the line endings, the byte order mark for Excel and the formula protection.
- Copy the CSV, or download it and open the file.
A worked example
Two records with a nested address and a list of tags:
[
{"id": 1, "name": "Ann", "address": {"city": "Ottawa"}, "tags": ["admin", "beta"]},
{"id": 2, "name": "Lee, Sam", "address": {"city": "Lyon"}, "tags": ["beta"]}
]
With the default settings this becomes:
id,name,address.city,tags[0],tags[1]
1,Ann,Ottawa,admin,beta
2,"Lee, Sam",Lyon,beta,
The name containing a comma is quoted so it stays one value, the nested city became an address.city column, and the second record's missing second tag is an empty cell. With arrays joined instead, the tags column would read admin; beta.
Common mistakes
Pasting several objects without an array. {...}{...} or one object per line is not one JSON document. Put the objects inside [ and ], separated by commas.
Double-clicking the file in Excel and losing zeros. Excel guesses types when it opens a CSV, so 00123 becomes 123 and long numbers turn into scientific notation. The CSV still holds the right text; import it with Data > From Text/CSV and set those columns to Text.
Very wide output. Index columns grow with the longest array. If one record has 200 tags you get 200 columns; switch arrays to joined or JSON text instead.
Check the input first with the JSON formatter, and use the CSV to JSON converter to go back.