datapry

JSON to CSV

Convert JSON arrays to CSV, flattening nested fields and flagging anything lost. Runs in your browser, so nothing is uploaded.

Delimiter
Line ending

JSON input

CSV output

Waiting for input

About this tool

Turn an array of JSON objects into a CSV file for spreadsheets and data tools. Columns are collected from every record, nested fields become dot-separated columns, and you're told whenever the conversion can't preserve your structure exactly. Cells that a spreadsheet would run as formulas are escaped by default.

How to use it

  1. Paste a JSON array or import a file.
  2. Set the delimiter, line ending and flattening options.
  3. Review any warnings, then copy or download the CSV.

Example

Input
[{"id":1,"name":"Alex","address":{"city":"Pune"}},{"id":2,"name":"Riya","address":{"city":"Kolkata"}}]
Output
id,name,address.city
1,Alex,Pune
2,Riya,Kolkata

Questions

How are nested objects and arrays handled?
Nested objects become columns such as address.city. Arrays are written as JSON text inside one cell. A warning appears when either happens.
What is formula escaping?
Spreadsheets run cells starting with =, +, - or @ as formulas, which attackers can exploit through exported data. Those text cells get an apostrophe prefix by default. Numbers such as -5 aren't affected, and you can turn this off.
What happens when records have different fields?
The CSV includes every field found in any record, in the order first seen. Missing values become empty cells, with a warning.