Toolkit
Developer tools

JSON to CSV Converter

Convert JSON arrays to CSV and back, with nested keys flattened.

Direction
JSON input
CSV output

Converted 2 rows. Nested keys were flattened into dotted column names.

About this tool

Turn an array of JSON objects into a spreadsheet-ready CSV, or parse a CSV table back into JSON. Nested objects are flattened into dotted column names so no data is silently dropped.

How to use it

  1. Pick a direction — JSON to CSV, or CSV to JSON.
  2. Paste your data into the input pane.
  3. Copy the result or download it as a .csv or .json file.

How nested data survives the trip to a flat table

CSV has no concept of nesting. A spreadsheet is a grid; JSON is a tree. Something has to give, and most converters give up quietly by dropping anything below the top level.

This one flattens instead. Nested keys become dotted column names:

{ "user": { "name": "Ada", "role": { "title": "Engineer" } } }

becomes columns user.name and user.role.title. Arrays of simple values are joined with a pipe, so ["a","b"] becomes a | b in a single cell. Arrays of objects get indexed — items[0].sku, items[1].sku.

The result is that nothing disappears silently. A deeply nested document produces a wide table rather than a lossy one, and you can see exactly what you have.

Quoting, commas and the Excel problem

Any value containing a comma, a double quote or a newline is wrapped in double quotes, and inner quotes are escaped by doubling them. That is RFC 4180, and it is what every spreadsheet expects:

Smith, John  ->  "Smith, John"
He said "hi" ->  "He said ""hi"""

If Excel mangles your file, the usual culprit is the delimiter rather than the quoting. Excel follows your system's regional settings, so on many European installations it expects semicolons and will dump a comma-separated file into a single column. Switch the delimiter above and it opens correctly.

Leading zeros and long numbers are a separate trap. Excel will helpfully turn 007 into 7 and a long order number into scientific notation. That is Excel's import behaviour, not something the CSV can prevent — use the import wizard and mark those columns as text.

Frequently asked questions

How are nested objects handled?
Nested keys are flattened with dots, so {"user":{"name":"Ada"}} becomes a column named user.name. Arrays of primitives are joined with a pipe character.
What about commas and quotes inside values?
Any value containing a comma, double quote or newline is wrapped in double quotes, and inner quotes are escaped by doubling them, per RFC 4180.
Is it safe to convert a customer export here?
Yes. The conversion runs in your browser, so a CSV of email addresses or order records is never transmitted. You can disconnect from the network and it will still work.