How JSON becomes a CSV table
CSV is a flat grid of rows and columns, while JSON is a tree. Converting one to the other means deciding what a row is, what the columns are and what to do with values that are themselves objects or lists. This converter makes those decisions visible and adjustable instead of guessing silently.
Each element of an array becomes a row. The columns are the union of every key found in any record, in the order they first appear, so a field that only exists on the fiftieth record still gets its own column and earlier rows simply leave it empty. If you paste a whole API response such as {"page": 1, "results": [...]}, the converter finds the arrays inside it and lets you choose which one holds the records.
Nested objects are flattened into dot-notation columns (address.city, address.country). Arrays can be joined into one cell, kept as JSON text or spread across numbered columns. The output follows RFC 4180: fields containing the delimiter, quotes or line breaks are wrapped in double quotes and embedded quotes are doubled.
How to use the JSON to CSV Converter
- Paste JSON, open a
.jsonfile or click Sample. Invalid JSON is reported with its line and column. - If the JSON is an object rather than an array, choose which array holds the rows under Rows come from.
- Pick the delimiter, how arrays and nested objects are handled, and whether to include a header row or quote every field.
- Check the table preview, then copy the CSV or download
data.csv. Tick Add UTF-8 BOM if the file will be opened by double-clicking in Excel.
Example
The record {"id": 7, "name": "Ada", "tags": ["admin", "dev"], "address": {"city": "London, UK"}} with flattening on and arrays joined by ", " produces:
id,name,tags,address.city
7,Ada,"admin, dev","London, UK"Opening the CSV in Excel and Google Sheets
- Accented characters look garbled in Excel: download with the UTF-8 BOM option. Excel uses the BOM to recognise UTF-8; without it, it assumes your system code page.
- Everything ends up in one column: Excel in many European locales expects semicolons, because the comma is the decimal separator there. Choose Semicolon, or import via Data → From Text/CSV.
- Long IDs turn into 1.23E+18 or lose digits: Excel converts numbers with more than 15 digits. Import the column as Text instead of opening the file directly.
- Google Sheets: File → Import → Upload detects the delimiter automatically and handles UTF-8 without a BOM.
CSV injection
When a CSV built from user-supplied data is opened in a spreadsheet, a cell such as =HYPERLINK(...) or @SUM(...) is treated as a formula. Escape spreadsheet formulas prefixes such cells with an apostrophe, as recommended by OWASP, so they display as text. Plain negative numbers like -42 are left alone.
Frequently Asked Questions
What happens to nested objects and arrays?
With flattening on, nested objects become parent.child columns at any depth. Arrays of simple values are joined with the separator you choose; arrays of objects are kept as JSON text unless you choose Spread into columns, which creates items.0.name, items.1.name and so on.
Why do some rows have empty cells?
Records in a JSON array do not have to share the same keys. Every key becomes a column, and a record without that key gets an empty cell. null values are also written as empty cells.
Should I use CRLF or LF line endings?
RFC 4180 specifies CRLF, and Excel and most libraries read both. Choose LF if the file is processed by Unix command-line tools that would otherwise see a stray \r at the end of each line.
Can I convert the CSV back to JSON?
Yes, use the CSV to JSON Converter. Values will come back as strings unless you enable type detection there, and flattened a.b column names stay flat.
Is there a size limit?
Conversion runs in your browser, so the limit is your device memory. Files of tens of thousands of records convert in well under a second; the preview shows the first 50 rows and the output pane shows the start of very large results, while Copy and Download always include everything.