Convert JSON to CSV

Drop a JSON file here

or paste it below — .json, .ndjson, .txt

Conversion options

Paste JSON or drop a file in and get a CSV back. Columns are collected from every record rather than only the first, so a field that appears halfway down the file still gets a column instead of being thrown away. Nested objects flatten into dotted names, arrays are written as JSON text, and values containing commas, quotes or line breaks are quoted properly so the file survives a round trip. Nothing is uploaded.

How to convert JSON to CSV

  1. Drop a .json file 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.
  2. 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.
  3. Leave Flatten nested objects on unless you want nested values kept as JSON inside a single cell.
  4. 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 JSONIn the CSVWhy
{"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.

Frequently asked questions

What happens to nested objects?

They flatten into dotted column names, so {"user": {"name": "Ada"}} becomes a column called user.name. Nesting is followed as deep as it goes. It is the shape spreadsheets can actually hold, and the dotted name tells you where the value came from, so the column can be mapped back if it ever needs to go the other way.

And arrays inside a record?

They are written into the cell as JSON text - ["a","b"] stays ["a","b"]. CSV has no concept of a list inside a cell, so the alternatives are to invent a separator that will collide with your data, spread the record across several rows, or lose the values. Keeping the JSON is the only one of the three that is reversible.

My records do not all have the same fields. Which columns do I get?

All of them. The columns are collected from every record in first-seen order, so a field that only appears in record 400 still gets its own column, and records that lack it get an empty cell. Many converters read the keys of the first record and force everything else into that template, which silently discards the rest. The page tells you how many columns were discovered after the first record, so you can see when it mattered.

Will the CSV open cleanly in Excel?

Yes. Line endings are CRLF as RFC 4180 specifies, and any value containing the delimiter, a double quote, a line break or leading and trailing spaces is wrapped in quotes with internal quotes doubled. If your data has non-English characters, tick the byte order mark option: without it Excel on Windows reads UTF-8 as its local codepage and turns accented characters into mojibake.

Can I choose the delimiter?

Comma, semicolon, tab or pipe. Semicolon is worth knowing about: in locales where the comma is the decimal separator, Excel expects semicolon-separated files and will drop a comma-separated one into a single column.

What JSON will it accept?

An array of objects is the normal case. A single object is treated as a one-row file, an array of arrays is written out as a grid, and newline-delimited JSON - one object per line, as logs and exports often produce - is detected and read too. If the JSON is malformed the tool says which character position the parser stopped at rather than just refusing.

Is my data uploaded?

No. Parsing and writing both happen inside your browser tab, so API dumps, exports and customer records never travel to a server. There is no size limit beyond your own machine's memory.

Can I get the CSV back as JSON later?

Yes - CSV to JSON reads what this writes, including the quoted fields and embedded line breaks. Nested structure does not rebuild itself automatically, though: a column called user.name comes back as a flat key of that name, not as a nested object.