How to use it
This JSON to CSV converter turns an API response or JSON export into comma-separated rows and columns that you can open in a spreadsheet, filter and share. Nested objects are flattened into dotted column names such as customer.name, arrays are kept as JSON text inside a single cell, and any cell that could break the table is quoted. It all happens in your browser.
How to convert JSON to CSV
- Paste your JSON, ideally an array in which each object is one record.
- Convert it with "Run tool" or the Ctrl + Enter shortcut.
- If an error appears, the JSON is invalid; fix the spot named by its line and column.
- Copy the CSV or download it, then change the file extension from
.txtto.csv.
From nested JSON to a flat table
Suppose an order export contains two records. The first is {"id":1,"customer":{"name":"Sam","address":{"city":"Leeds"}},"items":["mug","tea"],"note":"leave at door, ring twice","coupon":null,"paid":true}; the second has only an id, a customer name and a gift flag. The converter produces this table:
| id | customer.name | customer.address.city | items | note | coupon | paid | gift |
|---|---|---|---|---|---|---|---|
| 1 | Sam | Leeds | ["mug","tea"] | leave at door, ring twice | true | ||
| 2 | Priya | true |
Four details are worth noticing. Nesting at any depth becomes a dotted path. The array stays in one cell, written in the raw file as "[""mug"",""tea""]" with its quotes doubled. null becomes an empty cell. And gift, which only the second record has, appears as the last column because columns follow the order in which keys first appear.
Mapping rules
- Array of objects: one row per object, one column per key across all objects.
- Single object: a one-row table.
- Array of plain values such as
[1,"x",null]: a single column namedvalue. - Empty object: written as the text
{}. - Booleans and numbers: written as text, for example
trueand42. - Quoting: a cell is wrapped in double quotes when it contains a comma, semicolon, tab, pipe, quote or line break, or starts or ends with a space. Inner quotes are doubled.
- Delimiter and line endings: always a comma, with one line per record.
Opening the CSV in a spreadsheet
- Everything lands in column A: in regions that use a comma as the decimal separator, spreadsheets expect semicolons. Use the import wizard ("from text" or "from CSV") and choose comma as the delimiter.
- Accented letters look garbled: the output is UTF-8 without a byte order mark, and some programs then assume a legacy encoding. Pick UTF-8 in the import dialog.
- Values change on import: spreadsheets may strip the leading zero from
02134, turn1-2into a date or show long IDs in scientific notation. Set those columns to Text during import.
One caution on the JSON side: IDs longer than about 16 digits that are stored as numbers can lose precision when the JSON is parsed. Keep such values as strings in the source.
Limits
You cannot pick a different delimiter or reorder columns, and arrays are not exploded into extra rows. If you need one row per order item, reshape the data first so that each item is its own record. To control column order, write the keys of the first record in the order you want; later records follow it.
Privacy and related tools
The conversion runs in JavaScript in your browser; customer and order data stay on your device, and the page only increments an anonymous usage counter. Validate long or hand-edited input first in the JSON formatter. To go the other way, use the CSV to JSON converter, and see CSV vs JSON for the trade-offs between the formats.