How to convert nested JSON into reviewable CSV
Flatten object paths, preserve arrays, align uneven records and reduce spreadsheet-formula risk when converting JSON to CSV.
Start with a non-empty array of objects, flatten nested object keys into explicit paths, build one ordered union of columns, and serialize each row against that union. Preserve arrays deliberately and neutralize formula-leading strings before a spreadsheet opens the file.

Confirm that the root has real row boundaries
CSV needs rows. Use a non-empty JSON array in which every item is an object. A single object may describe one record, but wrapping records in an array makes the intended row boundary explicit.
- Parse the complete JSON value before transforming it.
- Reject a scalar, a lone object or an array containing non-object rows.
- Keep the original source available for the final comparison.
Choose a flattening contract before generating headers
For nested objects, join each parent and child key with a dot: result.score becomes one header. Keep arrays inside a single cell as JSON text unless the destination has an agreed expansion rule. Reject a source key when it collides with a generated dot path instead of overwriting either value.
Build one ordered union of columns
Records often have different keys. Walk the rows in source order, add each newly encountered path to the shared header, and emit an empty cell when a later row lacks that path. Treat null and a missing key carefully because a simple CSV export represents both as an empty cell.
Escape for CSV, then review for spreadsheet behavior
Double embedded quotes and quote any cell containing a quote, comma or line break. Prefix strings beginning with =, +, - or @ before spreadsheet import. That prefix reduces formula-execution risk, but it does not validate the data or decide the correct destination type.
Check the source against the result
[{"name":"Asha","result":{"score":92},"tags":["reviewed"],"unsafe":"=2+2"},{"name":"Noah","result":{"score":88},"tags":[]}]
name,result.score,tags,unsafe Asha,92,"[""reviewed""]",'=2+2 Noah,88,[],
The score path is explicit, each array stays in one cell, Noah's missing unsafe value becomes empty, and the formula-looking value receives an apostrophe prefix.
Run the conversion against a visible preview
Convert locally, inspect the generated path union and review protected or empty cells before downloading.
Open JSON to CSV