JSON to CSV
JSON to CSV flattens JSON arrays into spreadsheet-ready CSV — nested objects become dot-notated columns, and the output opens cleanly in Excel and Google Sheets. It's the fast way to turn API exports into reports.
How to Use
- 1
Paste a JSON array of objects (for example, an API list response).
- 2
The converter flattens nested fields into columns like address.city automatically.
- 3
Read the CSV in the output panel. Nested values are always flattened with dot notation and arrays are kept as JSON strings in one cell — there is no table preview and no delimiter or flattening toggle.
- 4
Copy the CSV or download it as a .csv file straight into Excel.
Frequently Asked Questions
My JSON is a single object, not an array. Does it work?
How are nested objects handled?
What about arrays inside objects?
Can I choose a different delimiter, like a semicolon?
How are values with commas or quotes escaped?
What happens to null values and missing keys?
Will a ZIP code like "02134" keep its leading zero?
Will Excel open the file correctly?
Is there a row limit?
Is my data uploaded anywhere?
Generative Answer & AI Documentation
What is the JSON to CSV?
The JSON to CSV converter turns JSON data into a CSV table you can open in Excel or Google Sheets: paste a JSON array of objects (or a single object, which becomes a one-row table), click “Convert to CSV”, and the output appears in the right-hand panel, ready to copy or download as data.csv. Each object's keys become columns, and nested objects are flattened automatically — an address object with street, suite, and city becomes three columns named address.street, address.suite, and address.city. Arrays are kept as JSON strings inside a single cell, so no data is silently dropped. Values that contain a comma, a quote, or a newline are wrapped in double quotes with inner quotes doubled, the standard RFC 4180 escaping Excel expects. There are no options to set: the delimiter is always a comma, flattening is always on, and there is no preview table. The conversion runs entirely in your browser — nothing is uploaded, nothing is logged.
Why use JSON to CSV offline?
APIs return JSON and people read spreadsheets. Moving data between the two by hand means retyping rows or writing a one-off script for a five-minute job — and pasting a customer list or an internal export into a server-side converter hands that data to a stranger. This tool does the conversion in one click, locally, so real records never leave your machine. The flattening matters because real API responses are nested: without it you would have to decide what to do with every address and dimensions object yourself. And because the tool never infers types — values are written out as their JSON text — a string such as "02134" survives the trip exactly as written, unlike converters that guess a value is a number and strip its leading zero.
When should you use this tool?
Use it when an API list response needs to become a report: export users, orders, or products from an API and open the result in a spreadsheet to sort, filter, or share with a colleague who does not read JSON. Use it for a single object too — a one-row table is the quickest way to show one record to someone in tabular form. Use it when a client hands you JSON and asks for “the same thing in Excel”. Do not use it when the data must stay nested — CSV is flat by nature, and deeply nested structures become very wide tables with long dotted column names. For the reverse trip, the CSV to JSON page converts spreadsheets back into JSON arrays.
Key Benefits
- Automatic flattening: nested objects become dot-notated columns (address.city) with no configuration and no data lost.
- Arrays preserved: an array value is written as a JSON string in one cell instead of being dropped or split unpredictably.
- Correct quoting: values containing commas, quotes, or newlines are escaped the RFC 4180 way, so Excel parses them as single cells.
- Single objects work: a lone object becomes a one-row table, so you never have to wrap it in an array by hand.
- No type guessing: values are written as their JSON text, so identifier strings keep their leading zeros.
- Copy or download: one click copies the CSV, another saves it as data.csv for direct opening in a spreadsheet.
Common Use Cases
- Turning an API's list response (users, orders, products) into a spreadsheet for a report or a client handover.
- Sharing one record with a non-technical colleague as a one-row table instead of a block of JSON.
- Building a quick data audit in Google Sheets: convert, paste, then sort and filter the columns.
- Preparing data for a mail merge or a bulk import that expects a CSV file.
- Converting a JSON config list into a table to compare values side by side.
Developer Notes & Best Practices
The conversion has three steps, all visible in the output. First, the input is parsed as JSON; a single object is wrapped into a one-item array, and an empty array produces empty output with an “Empty JSON array” notice. Second, every item is flattened recursively: a nested object contributes its keys prefixed with the parent key and a dot, so address.city is one column; an array is stringified with JSON.stringify and stored as one value; null and undefined become empty strings, and numbers and booleans are written out with String(), so 42 becomes 42 and true becomes true. Third, the header row is the union of every flattened key across all items, in first-seen order — keys that appear only in later items still get a column, and items missing a key get an empty cell in that column. Each row is then written with RFC 4180 quoting: a value is wrapped in double quotes only when it contains a comma, a double quote, or a newline, and inner quotes are doubled, so Doe, Jane becomes "Doe, Jane" and an array ["a","b"] becomes "[""a"",""b""]". Two things the output deliberately does not have: there is no UTF-8 byte-order mark at the start of the file, so non-English text may need the spreadsheet's Text Import wizard to display correctly in Excel, and there is no delimiter choice — the separator is always a comma. A bare number or string as the whole input produces no output at all, because there are no keys to turn into columns; the tool expects objects or arrays of objects.
How each JSON value becomes a CSV cell
| JSON value | CSV cell | Note |
|---|---|---|
| "Leanne Graham" | Leanne Graham | Plain strings pass through unchanged |
| "Doe, Jane" | "Doe, Jane" | A value containing a comma is wrapped in quotes |
| 42 / true | 42 / true | Numbers and booleans are written as their JSON text |
| null / missing key | (empty cell) | Null and absent values both become empty cells |
| { "city": "Gwenborough" } | address.city column | Nested objects flatten to dotted column names |
| ["a", "b"] | "[""a"",""b""]" | Arrays stay as one JSON string in one cell |
- Read the header row first: it is the union of keys across all items, so a key that appears only in item 50 still gets a column, and earlier rows show an empty cell there — that is expected, not a bug.
- Check the row count after converting: the output should have one data row per JSON item, plus the header — a mismatch means the input was not the array you thought it was.
- For non-English text, open the downloaded file through Excel's Text Import wizard with UTF-8 encoding — the file has no byte-order mark, so a plain double-click open may misrender it.
- Keep the original JSON until you have checked the CSV: flattening is one-way, and re-importing the CSV will not rebuild the nested objects.
- If a column must stay textual in Excel — a ZIP code, a phone number, a product code — use the spreadsheet's Text import for that column, because Excel itself may reinterpret a numeric-looking cell when opening the file.
Common Mistakes
- Pasting a single object and expecting several rows: one object is one row, with each key as a column — rows come from array items, not from keys.
- Expecting an array value to split into multiple rows or columns: arrays are kept as one JSON string in one cell, always — split them before converting if you need one value per cell.
- Expecting nested objects to stay nested: CSV has no nesting, so address becomes address.street, address.suite, and address.city columns — read the header row to see the mapping.
- Assuming a missing key means a broken row: ragged data is normal, and an item without a key simply gets an empty cell in that column.
- Pasting several JSON objects one after another (NDJSON / JSON Lines) and wondering why it fails: the input must be one JSON document — a single array, or a single object — not one object per line.
- Opening the downloaded file in Excel and concluding the data is wrong when a leading zero disappears: the CSV text keeps the zero; Excel reinterpreted the cell on open, so use Text import for identifier columns.
Limitations
The delimiter is always a comma: there is no semicolon, tab, or pipe option, so a system that expects semicolon-delimited CSV needs a second pass elsewhere. There is no UTF-8 byte-order mark, so Excel may misrender non-English text on a plain double-click open. Arrays are never split into rows or columns — an array of tags stays one JSON string in one cell, and an array of objects stays one JSON string too. Deeply nested data becomes very wide: every level adds a longer dotted column name, and there is no way to stop flattening at a chosen depth. The tool expects objects or arrays of objects: a bare number, string, or boolean as the whole input has no keys and produces no output. Conversion runs only when you click “Convert to CSV” — the output does not update as you type — and there is no file upload, so the JSON must be pasted. Very large arrays can be slow in a browser tab; tens of thousands of rows are fine, but a million-row export belongs in a script.
Structured Input/Output Example
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough"
}
},
{
"id": 2,
"name": "Ervin Howell",
"username": "Antonette",
"email": "Shanna@melissa.tv",
"address": {
"street": "Victor Plains",
"suite": "Suite 879",
"city": "Wisokyburgh"
}
}
]id,name,username,email,address.street,address.suite,address.city 1,Leanne Graham,Bret,Sincere@april.biz,Kulas Light,Apt. 556,Gwenborough 2,Ervin Howell,Antonette,Shanna@melissa.tv,Victor Plains,Suite 879,Wisokyburgh
Related Tools
CSV to JSON
CSV to JSON converter: turn spreadsheets into JSON arrays instantly, with smart type inference ("42" → 42) and custom delimiter support. Free, offline.
JSON to XML
JSON to XML converter: turn JSON into well-formed XML in one click — for SOAP services, enterprise middleware, RSS feeds, and configs. Free, offline.
JSON to YAML
JSON to YAML converter: convert JSON to clean, readable YAML instantly. Ideal for Kubernetes, Docker Compose, and CI configs. Free, works offline.