JSON to CSV
Convert a JSON array of objects to CSV format. Download or copy the result. Nested values are stringified.
What is JSON to CSV conversion?
JSON to CSV turns structured objects into a text table: the first line is headers, each following line is a record, and fields are separated by a delimiter. When a field contains the delimiter, a quote, or a newline, RFC 4180 requires wrapping it in double quotes and doubling any inner quotes. See the RFC 4180.
Drop a JSON array of objects into the left pane and get a spreadsheet-ready CSV on the right. Column headers are the union of keys across every object, in first-seen order. A value that is null or missing becomes an empty cell. Nested objects and arrays are not flattened with dots — they are JSON.stringify’d into the cell, then quoted if they contain quotes or the delimiter. A single object (not wrapped in [...]) is treated as one row. Choose comma, semicolon, or pipe as the delimiter. Copy the CSV or download output.csv. All of this runs locally; nothing is posted to a server. If you need tabs instead of commas so Excel paste is literal, use JSON to TSV. To inspect the CSV as a table, open CSV Viewer.
When to use this tool
- Export an API response — Paste a JSON array from a network tab or a fixture file and download CSV for Excel, Numbers, or pandas.
- One object, one row — A lone JSON object is wrapped automatically. You do not have to add brackets around a single record.
- European delimiter — Switch to semicolon when the spreadsheet locale expects ; and uses comma as the decimal separator.
- Round-trip with CSV to JSON — CSV to JSON stores every cell as a string. Numbers you export here (1, 2, 3) come back as "1", "2", "3" after a round trip. CSV to JSON
How to use the JSON to CSV Converter
Paste JSON
Put an array of objects, or a single object, in JSON Input. Sample loads three user records. Invalid JSON shows “Invalid JSON” and clears the CSV pane.
Pick the delimiter
Comma is standard CSV. Semicolon and pipe are offered for locales and log-style files. The same delimiter is used in the header line and every row.
Read the columns
Headers are every unique key, collected in the order keys first appear. Later objects that add new keys extend the header; earlier rows leave those cells blank.
Copy or download
Copy CSV or Download writes output.csv with MIME type text/csv. Clear wipes the editor.
Worked examples
Array of flat objects
[
{ "id": 1, "name": "Alice", "email": "alice@example.com", "role": "admin" },
{ "id": 2, "name": "Bob", "email": "bob@example.com", "role": "user" },
{ "id": 3, "name": "Charlie", "email": "charlie@example.com", "role": "user" }
]id,name,email,role 1,Alice,alice@example.com,admin 2,Bob,bob@example.com,user 3,Charlie,charlie@example.com,user
Nested object is stringified, not flattened
[
{ "user": { "name": "Alice" }, "active": true }
]user,active
"{""name"":""Alice""}",trueThe nested object becomes a quoted JSON string. There is no user.name column.
Comma in a value and a missing key
[
{ "id": 1, "name": "Ada" },
{ "id": 2, "role": "editor" }
]id,name,role 1,Ada, 2,,editor
Ada has an empty role cell; the editor row has an empty name cell.
Single object without an array
{ "sku": "W-104", "qty": 3 }sku,qty W-104,3
Tips
- Tabs in values are kept in CSV (they are not delimiters). If you need tab-separated output, use JSON to TSV, which replaces tabs in values with spaces.
- Newlines inside a string are preserved and the field is quoted, so a notes column can hold multi-line text.
- An empty array yields empty output, not a header-only file.
- Pretty-print or fix the source JSON in JSON Formatter if the input pane reports Invalid JSON.
Frequently Asked Questions
Do I have to wrap a single object in square brackets?
No. If the root value is not an array, the converter wraps it as a one-element array and emits one data row plus a header.
How are nested objects and arrays exported?
They are JSON.stringify’d into the cell. If the string contains quotes or the delimiter, the whole cell is RFC 4180-quoted, so inner quotes become "". The tool does not flatten with dot notation.
What happens when objects have different keys?
Every key that appears on any object becomes a column. Objects that lack a key get an empty cell for that column. Order follows first appearance, not alphabetical sort.
Will booleans and numbers stay typed in the CSV?
CSV is text. true, false, and numbers are written with String() or JSON.stringify for objects, without extra quotes unless the field needs RFC 4180 quoting. After you import the file in a spreadsheet, the app may coerce types on its own.
Is the JSON uploaded?
No. JSON.parse and the CSV join run in the browser. Use this on internal dumps without sending them off-device.