Home / Data / JSON to CSV Converter

JSON to CSV Converter

Turn a JSON array into a spreadsheet-ready CSV — or convert CSV back into JSON — with correct escaping, headers drawn from every key, and nested values preserved. All processing happens in this tab; your records are never uploaded.

Paste your data above and press Convert — the result and a summary will appear here.

Overview

Data lives in two worlds: JSON for machines, CSV for humans with spreadsheets. Moving between them sounds trivial until the edge cases arrive — a comma inside a field, a quote inside a quote, objects nested three deep, rows that do not all share the same keys. Naive converters silently corrupt these; this one handles them properly, in both directions.

JSON to CSV builds its header from the union of every key found in any object, ordered by first appearance, so no column is silently dropped. Fields containing commas, quotes or newlines are quoted exactly as the standard requires, and nested objects survive as compact JSON text. Flip the switch and CSV converts back, with the header row becoming property names.

What makes CSV conversion tricky?

CSV looks simple — values separated by commas — until values contain commas themselves. The standard solves this with quoting: wrap the field in double quotes, and double any quote inside it. Get this wrong and a spreadsheet splits one field into three columns, silently misaligning every row after it.

JSON's side has its own traps: arrays of objects where different rows have different keys (which becomes the header?), and nested structures no flat row can hold. The answers here: the header is the union of all keys, and nested values are kept as compact JSON strings — lossy in shape but lossless in data.

Features

Benefits

Who can use it

Analysts pulling API data into Excel, developers preparing seed data or fixtures, marketers exporting lists, researchers tidying survey responses, and anyone who has watched a spreadsheet mangle a careful dataset. The CSV-to-JSON direction serves developers feeding spreadsheet-maintained data back into code.

How to use

  1. Choose the direction: JSON to CSV, or CSV to JSON.
  2. Paste your data — a JSON array, or CSV with a header row.
  3. Read the status line; it confirms the shape it found.
  4. Copy the result or download it as .csv or .json.
  5. Open the CSV in your spreadsheet and check the columns align cleanly.

Frequently asked questions

My rows have different keys. What happens?

The header becomes the union of every key across all rows, in order of first appearance, and rows missing a key get an empty cell. Nothing is dropped. This is the correct behaviour — the alternative, using only the first row's keys, silently deletes data, which is why cheap converters lose columns.

How are nested objects handled?

They are written as compact JSON text inside the field — an address object becomes a single cell of JSON. It is not pretty, but it is lossless: the data survives the trip and can be parsed back out. Automatically flattening nested structures would invent column names and risk collisions.

Why do some fields come out wrapped in quotes?

Because they contain commas, quotes or line breaks, and the CSV standard requires quoting such fields. Your spreadsheet understands this and shows them as single cells. If you opened the raw CSV in a text editor and worried — don't; the quotes are correct.

Can it convert CSV without a header row?

For CSV to JSON it expects a header row, since property names must come from somewhere. Without one, the first data row would be misread as headers. Add a header row first — it takes seconds and prevents silent misalignment.

Is my data uploaded?

No. Both directions run entirely in your browser; records are never transmitted or stored.

Conclusion

Moving data between JSON and CSV is a solved problem only if the edge cases are respected. This converter respects them — union headers, proper quoting, safe nesting — and keeps your records where they belong: on your machine.

Related tools

DataJSON FormatterFormat, validate and minify JSON with honest error messages. DataRegex TesterTest regular expressions with live highlighting. TextMarkdown PreviewerWrite Markdown, see formatted output live.