JSON to CSV
Convert JSON to CSV with automatic header detection.
About JSON to CSV
Turns a JSON array of objects into CSV. The header row is built from the union of all keys found in the objects, so records with different fields still line up in the right columns.
When you would use it
- Opening an API response or a database export in Excel or Google Sheets.
- Handing a list of records to a colleague who works in spreadsheets.
- Converting JSON logs or survey results for analysis in a BI tool.
How to use it
- Paste a JSON array of objects, for example [{"name":"Ann","age":30},{"name":"Bob"}]. JSON5 syntax is accepted.
- Read the CSV on the right: the first line holds the headers, one line per object follows.
- Copy the result and save it as a .csv file.
Things worth knowing
- Headers are the union of every key, in the order they are first seen. A missing key gives an empty cell; a null value is written as null.
- Fields containing a comma or a double quote are quoted and inner quotes are doubled, following RFC 4180. Line breaks inside a value are written as \n so each record stays on one line.
- Nested objects and arrays are not flattened: they appear as [object Object] or as their items joined by commas. Flatten the data (for example address.city) before converting.
- The input must be an array of objects. A single object or an array of plain values does not produce a useful table.
Frequently asked questions
- Why does a column show [object Object]?
- That field holds a nested object. CSV is flat, so flatten nested data into separate keys such as address_city before converting.
- Excel shows everything in one column, what is wrong?
- Some Excel locales expect a semicolon separator. Use the Data > From Text/CSV import and choose comma as the delimiter, or open the file in Google Sheets.