JSON to CSV Converter
Paste a JSON array of objects on the left. Get a clean CSV on the right — nested objects are flattened, and you can copy or download.
Doing the conversion by hand
Flattening JSON to CSV is a header row plus one data row per object. You can do the same steps in a spreadsheet or a small script.
- Start from a JSON array of objects (or a single object treated as one row).
- Collect the union of keys for the header; flatten nested objects with dotted names if needed.
- Emit a comma-separated header line, escaping quotes in cells.
- Write one row per object, leaving empty cells for missing keys.
- Save as
.csvand open in a spreadsheet to verify column alignment.
Example: [{"name":"Ada","city":"London"},{"name":"Grace","city":"Baltimore"}] becomes a two-row CSV with columns name,city.
How the conversion works
This page reads JSON and writes a spreadsheet-shaped text file: one header row, then one data row per object, cells separated by commas. The header is the union of every flattened key, in the order those keys first appear. A row that lacks a key gets an empty cell, so uneven objects still line up under the same columns.
A single object (not wrapped in an array) is treated as a one-row table. An empty array is rejected. Nested objects are flattened with dots: user.city becomes its own column. Arrays, including arrays of objects, are not exploded into extra rows. They are stored as a compact JSON string inside one cell so the value is not silently dropped.
Cells that contain a comma, a quote, or a line break are quoted and internal quotes are doubled, which is the usual CSV convention. The download uses CR+LF between rows so Excel and most text tools open the file without gluing rows together.
Worked example: a contact export with quotes, nulls and line breaks
A support tool exports contacts as JSON, and someone in operations wants a spreadsheet. The export is uneven: one contact has a nickname in quotes and an empty plan, the other has a multi-line note. Paste this and press Convert:
[{"id":101,"name":"Ana \"Nina\" Costa","active":true,"plan":null,"address":{"city":"Recife","zip":"50030-230"},"tags":["vip","beta"]},
{"id":102,"name":"Bruno Lima","active":false,"address":{"city":"Porto Alegre"},"notes":"Prefers email\nafter 6pm"}]
Output:
id,name,active,plan,address.city,address.zip,tags,notes 101,"Ana ""Nina"" Costa",true,,Recife,50030-230,"[""vip"",""beta""]", 102,Bruno Lima,false,,Porto Alegre,,,"Prefers email after 6pm"
Readout: Rows 2, Columns 8. Reading it column by column: the name with quotes is wrapped and its inner quotes are doubled. plan is empty for Ana because it was null, and empty for Bruno because the key was missing, so the CSV cannot tell those two cases apart. The address became two dotted columns. The tags array stayed as JSON text in one cell. Bruno's note keeps its line break inside quotes, so a spreadsheet shows it as one cell with two lines, while a script that splits the file on newlines would wrongly see an extra row.
How to use Convert, Copy, and Download
- Paste a JSON array of objects (or one object) into the left pane labeled
JSON input. The header tracks character count. Nothing converts until you ask. - Click
Convert. The right pane labeledCSV outputfills with the table. Status becomesConverted. Rows is the number of objects, Columns is the number of flattened keys, Size is the UTF-8 byte length of the CSV string. - Click
Copy resultto put that string on the clipboard (the button readsCopiedbriefly). Or clickDownload .csvto save a local file namedfieldkit-export.csv. The file is built with a Blob in this tab. It is not uploaded anywhere. Clearwipes both panes and resets the readout toWaiting for input.
A parse error empties the output and puts Invalid JSON plus the parser message in Status. An empty array sets Rows and Columns to 0 and says there is nothing to convert. Newline-delimited JSON (one object per line, no wrapping array) is not a single JSON value, so it fails parse. Wrap the lines in [...] and add commas first.
Three smaller cases
A flat list. Input:
[{"name":"Ada","role":"engineer"},{"name":"Grace","role":"admiral"}]
Output (two data rows plus a header):
name,role Ada,engineer Grace,admiral
Readout: Rows 2, Columns 2.
Nested objects become dotted columns. Input:
[{"id":7,"user":{"name":"Ada","city":"London"}}]
Output:
id,user.name,user.city 7,Ada,London
There is no user column holding a blob of JSON. The inner keys were lifted.
Uneven keys and a comma inside a value. Input:
[{"sku":"A-1","note":"small, cheap"},{"sku":"B-2","qty":3}]
Output:
sku,note,qty A-1,"small, cheap", B-2,,3
The header is sku,note,qty because those keys appeared in that order. The first row has an empty qty. The second has an empty note. The note that contains a comma is wrapped in quotes. true, false, and numbers are written as their obvious text. null becomes an empty cell, not the word null.
An array value such as "tags":["math","code"] becomes the cell ["math","code"], quoted and with doubled inner quotes because of the commas and quote characters.
Common mistakes
- Pasting a single object and expecting multiple rows. You get one row. The records have to be an array.
- Hoping a nested array of objects will become extra rows. Those stay in one cell as JSON. Flatten or unwrap them before converting if you need one row per item.
- Opening the downloaded file in Excel and seeing one column because the file was double-clicked on a machine that wants semicolons. The file is comma-separated. Use Data, From Text, and pick comma if needed.
- Editing the output and clicking Download. Download saves whatever is currently in the output pane. Convert again after you change the input.
When a spreadsheet is the next step
Convert when an API gave you an array of records and you want to filter, chart, or share them with someone who lives in a spreadsheet. It is also a quick way to see which keys actually appear across a messy payload, because the header lists every one.
- Turning a list of users, orders, or events into a file you can open in Excel or Sheets
- Checking that optional fields really are optional (empty cells) before you write an importer
- Handing a flattened view of nested JSON to someone who does not want to read braces
Out of scope
It does not turn CSV back into JSON. It does not let you pick a delimiter, a quote character, or a column order. It does not add a UTF-8 BOM. It does not stream a multi-megabyte file; the whole document lives in the text area. It does not follow JSON references or merge two arrays.
Your data stays in the tab
Parse, flatten, escape, copy, and the local download all happen in this tab. The JSON is never sent to a server. Closing the tab clears it.
Questions about the output
What shape of JSON works best?
An array of flat objects becomes a table most cleanly. Deep nesting may need flattening first.
Will nested objects become columns?
Nested structures are flattened or stringified depending on the tool’s rules — check the output before importing into a spreadsheet.
Is the file uploaded?
Conversion runs in your browser; download stays local.