Output will appear here
Output will appear here
Paste a JSON array of objects and get CSV with one row per object. Nested objects flatten into dot-notation columns like customer.email. The header is the union of keys from every row, in first-seen order, so a field present in only some rows still gets a column. Values with commas, quotes or line breaks are quoted per RFC 4180.
By Ankit Aglawe · Updated · Runs entirely in your browser
customer becomes two columns, customer.email and customer.country. failure_code only exists on the second charge, so it is added at the end of the header and left empty for the first row. null becomes an empty cell.
[
{
"id": "ch_3Nx1",
"amount": 2500,
"currency": "usd",
"paid": true,
"customer": { "email": "[email protected]", "country": "PT" },
"refunded_at": null
},
{
"id": "ch_3Nx2",
"amount": 990,
"currency": "eur",
"paid": false,
"customer": { "email": "[email protected]", "country": "DE" },
"failure_code": "card_declined"
}
]id,amount,currency,paid,customer.email,customer.country,refunded_at,failure_code
ch_3Nx1,2500,usd,true,[email protected],PT,,
ch_3Nx2,990,eur,false,[email protected],DE,,card_declinedThe comma in Table, oak and the inch mark in 12" shade force quoting, and the inner quote is doubled. The note with a line break stays in one quoted cell. Arrays of plain values are joined with ;.
[
{ "sku": "TBL-01", "name": "Table, oak", "notes": "Ships in 2 boxes", "tags": ["furniture", "wood"] },
{ "sku": "LMP-07", "name": "Lamp 12\" shade", "notes": "Bulb not included.\nE27 socket.", "tags": [] }
]sku,name,notes,tags
TBL-01,"Table, oak",Ships in 2 boxes,furniture;wood
LMP-07,"Lamp 12"" shade","Bulb not included.
E27 socket.",Objects are flattened recursively with dots: {"address": {"geo": {"lat": 51.5}}} becomes a column named address.geo.lat. A key that itself contains a dot is wrapped in brackets, so {"a.b": 1, "a": {"b": 2}} gives two columns, [a.b] and a.b, and neither value is lost. An empty object {} is written as {}.
An array of strings or numbers is joined into one cell with ;, so ["math","poetry"] becomes math;poetry. An empty array gives an empty cell. An array that holds objects or other arrays is written as compact JSON in one cell, like [{"sku":"A1"}], so nothing turns into [object Object]. To get one row per item, use JSONPath to pull that array out first.
A value that contains a comma, a double quote, a \n or a \r is wrapped in double quotes, and each " inside is doubled to "". Excel, Google Sheets and Python's csv module all read this correctly.
Objects do not need the same keys. The header lists every key seen in any row, in the order first seen, and rows missing a key get an empty cell in that column.
null becomes an empty cell, the same as a missing key. true and false are written as text and numbers are written as JavaScript prints them, so 1.0 becomes 1.
Values are written as-is. A string starting with =, +, - or @ may be run as a formula when the file is opened in Excel. If the data comes from users, prefix such values with a ' before export.
An array of plain values becomes a one-column CSV with the header value. A single object becomes a header row plus one data row.
| JSON | CSV | Notes |
|---|---|---|
[{...}, {...}] | One row per object | Header is the union of keys |
{"a": {"b": 1}} | Column a.b | Recursive dot flattening |
["x", "y"] in a field | x;y | Joined with semicolons |
[{"id": 1}] in a field | "[{""id"":1}]" | Written as JSON |
null or missing key | Empty cell | |
"a, b" | "a, b" | Quoted |
"say \"hi\"" | "say ""hi""" | Quotes doubled |
[1, 2, 3] at top level | Column value |
Enter a JSON array of objects in the editor. Each object in the array becomes a row in the CSV output, and object keys become column headers.
The output shows comma-separated values with headers derived from your JSON keys. Nested objects are flattened using dot notation (e.g., address.city).
Copy the CSV to your clipboard or download it as a .csv file ready to open in Excel, Google Sheets, or import into a database.
Paste the array in the left pane. Each object becomes a row and each key becomes a column. Download the result as a .csv file and open it in Excel or Sheets.
They are flattened into dot-notation columns, so customer.address.city becomes its own column. This works to any depth.
The header includes every key from every object, in first-seen order. Rows without a key get an empty cell.
Yes for the structure: quoting follows RFC 4180. For non-ASCII text, use Excel's Data > From Text/CSV import and pick UTF-8, since Excel does not always guess the encoding of a file without a BOM.
A comma, with \n line endings. Arrays inside a field are joined with semicolons so they do not add columns.
No. The CSV is built in your browser.
Need several formats at once? Convert All shows every output from one paste. Or browse all JSON converters.