How to convert JSON to CSV
- Drop a
.jsonfile into the box above, or paste the JSON straight in. An array of objects is the usual shape; a single object, an array of arrays and newline-delimited JSON all work too. - Pick the delimiter. Comma is standard; choose semicolon if the file is going into Excel in a locale where the comma is the decimal separator.
- Leave Flatten nested objects on unless you want nested values kept as JSON inside a single cell.
- Press Convert to CSV, then download or copy the result.
Columns come from every record, not just the first
This is the difference that costs people data. JSON records in the same array do not have to carry the same keys, and in real exports they usually do not: an optional field is absent until the first record that has one, a schema changed partway through the period you exported, a couple of rows carry an extra annotation.
The quick way to build a CSV header is to read the keys of the first record and use them as the template. Every field that appears later then has nowhere to go, and it is dropped without a message. This tool walks all the records first, collects the columns in the order they are first seen, and reports how many of them turned up after record one — so when the number is not zero, you know what a first-record converter would have cost you.
What happens to nesting
| In the JSON | In the CSV | Why |
|---|---|---|
{"user": {"name": "Ada"}} |
Column user.name, value Ada |
A spreadsheet is flat. The dotted name records where the value came from |
{"tags": ["a", "b"]} |
Column tags, value ["a","b"] |
No separator can be invented that will not eventually collide with your data |
{"meta": {}} |
Column meta, empty |
There is nothing inside to make a column from |
null values |
Empty cell | CSV has no null. An empty cell is the closest honest equivalent |
Making a CSV that Excel will not mangle
Two settings decide whether the file opens cleanly, and both default to the safe choice here:
- Line endings. RFC 4180 specifies CRLF, and Excel is happiest with it. LF is available for Unix tooling.
- The byte order mark. Without it, Excel on Windows reads a UTF-8 file as its local codepage, so names with accents, Turkish or Cyrillic characters arrive as mojibake. Tick the option and Excel reads the encoding correctly. Leave it off for anything else, where the mark can show up as stray characters in the first header.
Quoting is not a setting because it is not optional: any value holding the delimiter, a double quote, a line break or leading and trailing spaces is wrapped in quotes with the internal quotes doubled. That is what makes the file survive a round trip — you can run the result back through CSV to JSON and get your values out unchanged.
Newline-delimited JSON
Log pipelines, database dumps and streaming APIs frequently emit one JSON object per line with no enclosing array. That text is not valid JSON as a whole, so a strict parser rejects the file outright. Here, if the whole text fails to parse and every non-empty line parses on its own, it is read as one record per line and the report says so.
Next steps
CSV to JSON converts back the other way and reports what it had to change. If the CSV you have made is too big for the tool it is going into, split CSV breaks it into pieces that each keep the header row.