How to turn a JSON array into a CSV for Excel
Map object keys to columns, quote commas correctly, and keep nested objects without losing data — then open the file in Excel or Sheets.
Start with an array of objects
CSV is a table: one header row, then one row per record. That maps cleanly onto a JSON array of objects, such as `[{"name":"Ada","hours":32},…]`. A single object becomes a one-row table. An array of numbers becomes a single “value” column.
If objects do not share the same keys, take the union of all keys as columns and leave missing cells empty. That is usually what you want from mixed API responses.
Quoting and nested values
Any cell that contains a comma, quote, or line break must be wrapped in double quotes, and inner quotes doubled — `say "hi"` becomes `"say ""hi"""`. Excel and Google Sheets read that correctly.
Nested objects and arrays have no natural column. The practical approach is to keep them as a JSON string in one cell so nothing is thrown away. Flatten first if you need `address.city` as its own column.
Try related tools
- JSON to CSV — Turn a JSON array into CSV for Excel or Google Sheets.
- JSON formatter — Beautify, minify, and validate JSON in the browser.
- CSV viewer — Preview comma-separated data as a simple table (basic parsing).