Skip to content
PocketDesk
Your files are processed on your device, never uploaded

JSON to CSV

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Run now
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to convert JSON to CSV

  1. Paste a JSON array of objects into the box, or drop a .json file on it. A single object works too and gives one row.
  2. Choose a Delimiter: comma, semicolon, tab or pipe.
  3. Turn Include header row off if you only want the data lines.
  4. Select Copy, or Download to save data.csv and open it in Excel, Numbers or Google Sheets.

How the flattening works

CSV is flat, but JSON is often nested, so each row is flattened into one level.

  • Nested objects become dot-path columns: user.address.city.
  • Arrays of simple values are joined with ; in a single cell: red;green;blue.
  • Arrays that contain objects get an index in the path: orders.0.total, orders.1.total.
  • null and missing values become empty cells.
  • Text that contains the delimiter, a double quote or a line break is wrapped in quotes, and quotes inside are doubled, as the CSV standard says.

Tips

  • Not every object needs the same keys. The header lists every key seen in any row.
  • If the JSON is not valid, you see the line and column of the problem. Check it first with the JSON validator.
  • To go the other way, use CSV to JSON.
  • Spreadsheets treat cells starting with =, +, - or @ as formulas. If the file comes from an untrusted source, review those cells before opening them.
  • Very long numbers can lose precision when JSON is read, so keep IDs as strings in the source.

What CSV is

CSV (comma-separated values) is a plain text table: one line per row and one delimiter between columns. Almost every spreadsheet, database and analytics tool can import it, which makes it the usual way to move data out of an API and into a report.

Privacy

Exports often hold customer lists or internal records. This converter runs entirely on your device. Nothing is uploaded, stored or logged.

Questions

How are nested objects handled?

They are flattened into columns named with dot paths, so {user:{city:'Pune'}} becomes a column called user.city.

What happens to arrays?

An array of simple values, such as tags, is joined with semicolons in one cell. An array of objects gets numbered columns like items.0.id.

What if objects have different keys?

The CSV gets one column for every key found in any row, in the order first seen. Missing values are left empty.

Will it open in Excel?

Yes. Commas, quotes and line breaks inside values are quoted correctly. If your Excel expects semicolons, pick the semicolon delimiter.

Is my data uploaded?

No. The conversion happens in your browser.

More developer tools