About json to csv
A CSV file holds a table that opens in Excel and Google Sheets. This tool turns a JSON array of objects into one, using the keys as column headings.
What to know
- Each object becomes a row.
- Nested objects or arrays cannot be represented directly in a flat table, so they are flattened or written as text.
- Commas, quotes and line breaks inside values are quoted so the file opens correctly.
A worked example
The array [{"name":"Asha","city":"Pune"},{"name":"Ravi","city":"Surat"}] becomes a table with columns name and city and two rows. Objects with different keys produce extra columns, left blank where a record has no value.
Handling nested data
- Flatten nested objects into columns such as address.city.
- Arrays inside records may be joined into one cell or split into several rows.
- Open the CSV in a spreadsheet to check that Excel reads dates and long numbers correctly.
