Convert JSON to CSV
The converter expects a JSON array of objects and writes one CSV row per object. Records rarely share identical keys, so this guide shows how the columns are chosen and what fills the gaps.
Worked example
[
{"id": 1, "name": "Smith, Jane", "tags": ["admin", "ops"]},
{"id": 2, "name": "Kim", "email": "[email protected]"},
{"id": 3, "name": "Lee", "email": null}
]id,name,tags,email 1,"Smith, Jane","admin,ops", 2,Kim,,[email protected] 3,Lee,,
The header row lists every key in the order it first appears: id, name, tags, then email from the second object. Smith has no email and Lee's email is null, so both cells are empty. The tags array is written as admin,ops and quoted because it contains the delimiter, just like "Smith, Jane".
How the converter handles it
- The input must be a JSON array such as [{...}, {...}]; a single object on its own is rejected.
- The columns are the union of all object keys, in the order each key first appears.
- A missing key or a null value produces an empty cell.
- Numbers and booleans are written as plain text, for example 42 and true.
- Arrays of plain values are written as their items joined with commas. Nested objects, and arrays that contain objects, are written as compact JSON inside the cell, so no data is lost; flatten them first (for example into address_city) if you need separate columns.
- Values that contain the delimiter, a quote mark or a line break are wrapped in double quotes, with inner quotes doubled.