JSON to CSV Converter
| Rule | What the tool does |
|---|---|
| Commas in values | field wrapped in quotes: "a, b" stays one cell |
| Quotes in values | doubled per RFC 4180: "he said ""hi""" |
| Nested objects | serialized as a JSON string inside the cell |
| Missing keys | empty cell - columns come from the union of keys |
JSON arrays and CSV files are the two dialects of tabular data, and the translation fails on three specific rocks: commas inside values, embedded quotes, and Excel’s handling of UTF-8. This converter handles all three per RFC 4180 - the quoting spec every spreadsheet implements - and the download writes a UTF-8 BOM so Excel opens accented text as text, not mojibake.
Columns come from the union of every object’s keys in first-seen order, so ragged JSON (objects with missing fields) converts with empty cells rather than silently dropping data.
How to use
- Paste a JSON array of objects; the sample chips load city and inventory schemas to start.
- Copy CSV puts the exact output on your clipboard; Download .csv writes a BOM-prefixed file Excel opens double-click clean.
- Nested objects and arrays serialize as JSON strings inside their cell - flatten upstream if you need them split.
Frequently asked questions
Why does my CSV look wrong in Excel?
Three usual causes, all handled here: commas inside values need quoting (RFC 4180), unquoted accented text needs the UTF-8 BOM Excel uses to guess encoding, and embedded quotes must be doubled, not escaped with backslashes. Hand-rolled converters typically miss the second one.
What happens to nested objects and arrays?
They serialize as JSON strings inside their cell - {"a":1} becomes the text {"a":1}, quoted per RFC 4180. That preserves the data losslessly; if you need columns like a.b, flatten the JSON before converting.
What if my objects have different keys?
The header is the union of all keys in first-seen order; objects missing a key get an empty cell. Nothing is dropped silently - which is exactly what you want when merging API pages with optional fields.
Is the output RFC 4180 compliant?
Yes: CRLF row breaks, quote-wrapping for fields containing commas, quotes or line breaks, and doubled embedded quotes. RFC 4180 is the CSV dialect Excel, Sheets and every database loader agree on - which is why the spec, not convenience, decides the quoting.