formatthisjson.com Runs in your browser
JSON → CSV

Convert JSON to CSV

Paste a JSON array of objects and read it back as spreadsheet-ready CSV. Errors report the exact line and column.

JSON to CSV converter

Converts as you type. Nothing is uploaded. Just need it readable? Use the JSON formatter.

Delimiter

Paste some JSON to convert it.
Rows
Columns
Size

Why Excel mangles CSV files

CSV is the simplest data format in common use, and Excel is where most CSVs end up — which is unfortunate, because double-clicking a .csv file hands Excel three chances to corrupt it:

  • Encoding. Opened directly, older Excel versions decode a plain UTF-8 file with a legacy Windows codepage, so é renders as é and anything outside Latin-1 becomes noise. The download here is prefixed with a UTF-8 byte-order mark, the one signal every Excel version respects.
  • Type coercion. Excel converts on open, not on display: 00123 becomes 123, sixteen-digit numbers flip to scientific notation, and strings like 1/2 become dates. Genetics journals renamed human genes — SEPT1 and MARCH1 among them — partly because Excel kept reading them as dates in published datasets. Quoting cannot prevent any of this; only importing the column as Text can.
  • The delimiter itself. In locales that use the comma as the decimal separator, Excel expects semicolon-delimited files and reads a comma-delimited one as a single column. That is what the delimiter option above is for: semicolon for European Excel, tab for pasting straight into a spreadsheet grid.

How nesting becomes columns

JSON is a tree and CSV is a grid, so the converter has to make the flattening rules explicit rather than guessing. These are the rules it applies:

  • Nested objects flatten to dot paths{"user":{"name":"Ada"}} produces a column named user.name.
  • Arrays stay in one cell{"tags":["a","b"]} writes ["a","b"] as a JSON string into the tags cell. Exploding arrays into tags.0, tags.1… breaks the moment two rows disagree on length, so it is deliberately not done.
  • Headers are the union of all keys, in the order they first appear. A row missing a key gets an empty cell, and null renders as an empty cell too.
  • Collisions resolve in document order — a literal "a.b" key and a nested a.b path land on the same column, and whichever appears later in the document wins, the same way JSON.parse resolves duplicate keys.
  • Non-array roots still convert — a single object becomes one row, and an object whose values are all objects becomes rows with a key column carrying the outer keys, which is how keyed API responses usually arrive.

If the JSON will not parse at all, the error above reports the exact line and column, with the offending line excerpted — the same diagnostics as the JSON formatter, which is the better tool when the goal is reading the structure rather than exporting it.

RFC 4180 in one paragraph

RFC 4180 is the closest thing CSV has to a specification: an informational RFC from 2005 that wrote down what most tools already did. Records are separated by CRLF line endings; the first record may be a header row; fields containing a comma, a double quote, or a line break must be wrapped in double quotes; and a double quote inside a quoted field is escaped by doubling it, so say "hi" becomes "say ""hi""". That last rule is the one hand-rolled exporters most often get wrong, and the reason a single stray quote can shift every following field in a row. The output here follows all of it — CRLF endings, quoting only where required, doubled embedded quotes.

Common questions

What JSON shapes can be converted to CSV?

An array of objects is the main case — each object becomes a row. A single object becomes one row, an array of plain values becomes a single column, and an object whose values are all objects becomes rows with an extra key column holding the outer keys. A bare number or string has no rows in it, so it is reported as an error rather than silently producing a one-cell file.

How are nested objects and arrays handled?

Nested objects are flattened into dot-path columns, so {"user": {"name": "Ada"}} becomes a column called user.name. Arrays inside a row are not exploded into numbered columns — they are written into the cell as a JSON string, because two rows with different array lengths would otherwise produce ragged, misaligned headers.

What happens when rows have different keys?

The header row is the union of every key seen across all rows, in first-seen order. A row that lacks a key gets an empty cell in that column, so the columns stay aligned no matter how sparse the data is. Values that are null also render as empty cells.

Why does Excel put my whole CSV in one column?

In locales where the comma is the decimal separator — most of continental Europe and South America — Excel expects semicolons between fields when you double-click a .csv file, and treats a comma-separated one as a single column of text. Switch the delimiter option to semicolon and re-download, or use Excel's Data → From Text/CSV import, which lets you pick the delimiter explicitly.

Why did Excel delete my leading zeros?

Excel converts anything that looks numeric on open: 00123 becomes 123, and long digit strings like card or tracking numbers flip into scientific notation. CSV has no type system, so no quoting can prevent it — quotes mark field boundaries, not types. The fix is on the Excel side: import via Data → From Text/CSV and set those columns to Text before loading.

Why do accented characters look wrong in Excel?

Double-clicking a plain UTF-8 file makes older Excel versions decode it with a legacy Windows codepage, turning é into é. The file downloaded here starts with a UTF-8 byte-order mark, which every Excel version reads as a UTF-8 signal, so accents and non-Latin scripts survive the round trip. The copy button gives you the bare text without the mark.

Is my JSON uploaded anywhere?

No. Parsing, flattening, and CSV generation all run in your browser, and the download is assembled locally from the text already on the page. Nothing is sent to a server, logged, or stored — which matters, because exported data so often contains emails, IDs, and API responses.