🗂️ JSON to CSV Converter
By ToolNimba Editorial Team · Updated 2026-06-19
Paste a JSON array of objects above, then press Convert to CSV.
This JSON to CSV converter turns a JSON array of objects into a clean comma-separated table you can open in Excel, Google Sheets, or any spreadsheet app. Paste your JSON, press Convert, and copy or download the result. The header row is built from every key found across your objects, and any value with a comma, quote, or line break is quoted correctly so the columns never break.
What is the JSON to CSV?
JSON (JavaScript Object Notation) and CSV (comma-separated values) are two of the most common ways to move structured data between programs. JSON is hierarchical and self-describing, which makes it ideal for APIs and config files. CSV is flat and tabular, which is exactly what spreadsheets and many databases expect. Converting from JSON to CSV means flattening a list of records into rows, with one column per field.
The input this tool expects is a JSON array of objects, for example [ {"name":"Ada","city":"London"}, {"name":"Linus","city":"Helsinki"} ]. Each object becomes one row. The converter scans every object to collect the full set of keys, so even if some records have extra fields, no data is lost. Columns appear in the order each key is first seen, and any object missing a given key simply gets an empty cell in that column.
The quoting follows the common CSV convention (RFC 4180). A field is wrapped in double quotes whenever it contains the delimiter, a double quote, or a line break, and any double quote inside the field is doubled. That means a value like Smith, John or a line of text with a comma in it stays in a single cell instead of spilling into the next column. Nested objects and arrays are written as compact JSON inside one cell, so the structure is preserved even though CSV itself is flat. Everything runs in your browser using plain JavaScript, so your data is never uploaded to a server.
When to use it
- Turning an API response (a JSON array of records) into a spreadsheet for a colleague who does not code.
- Importing exported JSON data into Excel, Google Sheets, or a database that only accepts CSV.
- Quickly eyeballing a JSON dataset as a table to spot missing fields or odd values.
- Preparing JSON output for tools like mail-merge or analytics imports that expect CSV.
How to use the JSON to CSV
- Paste a JSON array of objects into the input box.
- Pick a delimiter (comma is standard; use semicolon or tab if your locale or target app needs it).
- Leave the header row on if you want column names in the first line, or turn it off for data-only output.
- Press Convert to CSV, then use Copy or Download .csv to save the result.
Formula & method
Worked examples
Two objects where the second has a key the first does not.
- Input: [ {"name":"Ada","city":"London"}, {"name":"Linus","country":"Finland"} ]
- Union of keys, first-seen order: name, city, country
- Row 1 (Ada): name=Ada, city=London, country is missing so the cell is empty
- Row 2 (Linus): name=Linus, city is missing so the cell is empty, country=Finland
Result: name,city,country\nAda,London,\nLinus,,Finland
A value that contains a comma, so it must be quoted.
- Input: [ {"product":"Pen","note":"red, fine tip"} ]
- Header: product,note
- The note value contains a comma, so it is wrapped in double quotes
- Result row: Pen,"red, fine tip"
Result: product,note\nPen,"red, fine tip"
A value that itself contains a double quote.
- Input: [ {"quote":"She said \"hi\""} ]
- Header: quote
- The field contains double quotes, so the whole field is quoted and each inner quote is doubled
- Result row: "She said ""hi"""
Result: quote\n"She said ""hi"""
When a CSV field needs to be quoted (RFC 4180)
| Field contains | Quoted? | Example output |
|---|---|---|
| Plain text, no special characters | No | London |
| The delimiter (e.g. a comma) | Yes | "red, fine tip" |
| A double quote character | Yes, inner quotes doubled | "She said ""hi""" |
| A newline or carriage return | Yes | "line one\nline two" |
| Leading or trailing spaces only | No (preserved as-is) | " spaced " |
How JSON value types are written into a CSV cell
| JSON value | CSV cell |
|---|---|
| "text" | text |
| 42 or 3.14 | 42 or 3.14 |
| true / false | true / false |
| null | (empty cell) |
| Nested object or array | Compact JSON, e.g. {"a":1} or [1,2] |
Common mistakes to avoid
- Pasting a single object instead of an array. The tool expects a JSON array, so wrap one or more objects in square brackets: [ {…} ]. A bare object {…} is rejected with a clear message.
- Expecting nested objects to expand into separate columns. A value that is itself an object or array is written as compact JSON inside one cell. If you need each nested field as its own column, flatten the JSON first.
- Using the wrong delimiter for your locale. Some European versions of Excel treat the comma as a decimal separator and expect semicolon-delimited files. If your columns do not split, switch the delimiter to semicolon.
- Forgetting that missing keys become empty cells. When objects have different sets of keys, rows are aligned to the full union of columns and any missing value is left blank. That is intentional, not data loss.
Glossary
- JSON
- JavaScript Object Notation, a text format for structured data using objects (key/value pairs) and arrays.
- CSV
- Comma-separated values, a plain-text table format where each line is a row and fields are separated by a delimiter.
- Array of objects
- A JSON array whose elements are all objects, like a list of records. This is the input this tool expects.
- Delimiter
- The character that separates fields in a CSV line, most commonly a comma but sometimes a semicolon, tab, or pipe.
- RFC 4180
- The common specification for CSV files, including the rules for when and how a field is quoted.
Frequently asked questions
How do I convert JSON to CSV?
Paste a JSON array of objects into the box, choose your delimiter, and press Convert to CSV. The tool builds a header from all keys, writes one row per object, and lets you copy or download the result instantly.
What JSON format does this tool accept?
It accepts a JSON array of objects, such as [ {"a":1}, {"a":2} ]. Each object becomes a row and each key becomes a column. A single bare object or non-object array elements are rejected with a clear error.
What happens if my objects have different keys?
The converter collects the union of all keys across every object, in the order they first appear. Each row fills in the values it has, and any column a row lacks is left as an empty cell, so nothing is lost.
How are commas, quotes, and line breaks handled?
Any field containing the delimiter, a double quote, or a line break is wrapped in double quotes, and inner double quotes are doubled. This follows RFC 4180 so the CSV opens correctly in Excel and Google Sheets.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser with plain JavaScript, and the file is created locally for download. Your JSON never leaves your device, which makes it safe for sensitive data.
How do nested objects and arrays appear in the CSV?
A value that is itself an object or array is written as compact JSON inside a single cell, for example {"city":"London"} or [1,2,3]. CSV is flat, so if you need those fields as separate columns you should flatten the JSON first.