- Paste JSON or open a
.jsonfile. The CSV and the table preview update as you type. - If the JSON is an object that contains arrays, use Rows from to choose which one becomes the rows. The first array of objects is picked automatically.
- Choose a delimiter. Use semicolon if the file will be opened by Excel in a locale where the comma is the decimal separator, or tab for a TSV.
- Choose how nested values are written: flattened into separate columns, or kept as JSON text in a single cell.
- Click Download. With Excel BOM ticked, the file starts with a UTF-8 byte order mark so accented and non-Latin characters display correctly in Excel. The status bar shows the row and column count.
JSON to CSV Converter
Flatten a JSON array into CSV you can open in Excel or Google Sheets, with a table preview and download.
Overview
APIs and log pipelines speak JSON, while analysts, finance teams and spreadsheet users want CSV. The two shapes do not line up: JSON records can nest objects and arrays and do not all need the same keys, while a CSV file is a flat grid where every row has the same columns. Converting means deciding which array holds the rows, how nested values become columns, and how to quote text so a spreadsheet does not split it in the wrong place.
This converter makes those decisions visibly. It finds the array of records even when it is wrapped
in an object such as {"data": {"items": [...]}}, flattens nested fields into dot-path
columns, builds the column list from every key it sees, and quotes fields according to
RFC 4180. Everything runs in your
browser; your data is not uploaded.
How to convert JSON to CSV
How nested JSON is flattened
Each record is walked recursively. Object keys are joined with dots and array positions become numeric segments, so this input:
[
{ "id": 1, "address": { "city": "London" }, "tags": ["admin", "math"] },
{ "id": 2, "address": { "city": "Oslo", "zip": "0150" }, "active": false }
]
produces these columns, in the order the keys were first seen:
id,address.city,tags.0,tags.1,address.zip,active
1,London,admin,math,,
2,Oslo,,,0150,false
The column set is the union of all keys, so a field that appears only in record 2 still gets a
column and is blank for the others. null and missing values are both written as
empty cells, because CSV cannot tell them apart. An empty array or object is written as
[] or {} only when no other record fills that path.
Index paths work well for short, fixed-length arrays such as coordinates. For variable-length arrays, like a list of order items, they create one column per position and a very wide sheet. Choose Keep as JSON text instead to put the whole array in one cell, or convert the inner array on its own with Rows from. If your keys already contain dots, the flattened names are ambiguous, and the JSON text option is safer.
Quoting and Excel quirks
A field is wrapped in double quotes when it contains the delimiter, a double quote or a line
break, and embedded quotes are doubled: Grace "Amazing" Hopper becomes
"Grace ""Amazing"" Hopper". Rows end with CRLF, as RFC 4180 specifies. Even with
correct quoting, Excel changes data when it opens a CSV by double-click:
- Encoding. Without a BOM, Excel may decode UTF-8 as a legacy code page and
show
éinstead ofé. The BOM option prevents this. - Leading zeros. ZIP codes and IDs such as
02134become2134. Import through Data → From Text/CSV and set the column type to Text to keep them. - Long numbers. Excel keeps 15 significant digits, so an 18-digit order ID is shown in scientific notation and its last digits are replaced with zeros. Store long IDs as strings and import them as Text.
- Formulas. Cells starting with
=,+,-or@can be evaluated as formulas. If you export user-supplied data for others to open, read about CSV injection and consider prefixing such values with an apostrophe.
When CSV is the wrong format
CSV has no types, so true, 42 and "42" all become
plain text, and null is indistinguishable from an empty string. Deeply nested or
irregular data, such as an order with a variable list of line items each holding options,
either explodes into hundreds of sparse columns or ends up as JSON inside a cell. If the
consumer is another program, keep JSON, or use JSON Lines for streaming. If you need to look at
nested data rather than tabulate it, the JSON viewer is a better
fit. CSV is the right choice when the data is genuinely tabular and the destination is a
spreadsheet, a database bulk import or a BI tool. Use the
CSV to JSON converter to go back, and the
JSON formatter to clean up the input first.
Frequently Asked Questions
Is my data uploaded?
No. Parsing and conversion happen in your browser. The last input is saved in your browser's local storage so it survives a refresh; Clear removes it.
Why are some columns in an unexpected order?
Columns follow the order in which keys are first seen. One exception: keys that look like
integers, such as "2024", are listed first within an object, because that is how
JavaScript orders object properties after parsing.
What if my JSON is a single object rather than an array?
If it contains an array, that array is used as the rows and you can pick a different one. If it contains no arrays, or you choose "Whole object as one row", the object becomes a single row with one column per flattened path.
Does the table preview show every row?
It shows the first 50 rows so the page stays fast. The CSV output and the download always contain all rows.
Should I use the BOM option for Google Sheets?
It is harmless there. Google Sheets and most programming languages handle UTF-8 with or without a BOM; the option exists mainly for Excel. Turn it off if a strict parser treats the BOM as part of the first column name.