What you need
JSON that is an array of objects (one object per row) or a CSV with a header row. Both converters run locally, so you can use real data.
What the conversion does
Converting this JSON:
[{"id":1,"name":"Ana","tags":["a","b"]},{"id":2,"name":"Ben","city":"Lyon"}]
gives this CSV:
id,name,tags,city
1,Ana,"[""a"",""b""]",
2,Ben,,Lyon
and converting that CSV back gives:
[{"id": "1", "name": "Ana", "tags": "[\"a\",\"b\"]", "city": ""}, {"id": "2", "name": "Ben", "tags": "", "city": "Lyon"}]
Note what changed on the round trip: id is now the string "1", the tags array is now a string, and Ben's missing tags and Ana's missing city became empty strings. The round trip preserves the table, not the types.
Rules of thumb
| Situation | What happens |
|---|---|
| Objects have different keys | Columns are the union of all keys, first-seen order |
A value is null or absent |
The cell is empty |
| A value is a nested object or array | Stored in the cell as compact JSON text |
| A field contains a comma, quote or line break | The cell is quoted so the CSV stays valid |
| CSV row shorter than the header | Missing values become empty strings |
Common pitfalls
- Expecting types to survive. CSV is text. Convert numbers and booleans after reading it back.
- Flat versus nested. If you need real nested structure, keep JSON as the source of truth and export CSV only for reporting.
- Spreadsheets mangling values. Excel may drop leading zeros, turn long numbers into scientific notation or reinterpret text that looks like a date.
- Using TSV by mistake. If your data contains tabs or you pasted from a spreadsheet, use the tab-separated variants instead.
Going further
For how JSON itself is structured, see How JSON Works; for a side-by-side with other formats, see JSON vs YAML vs XML.