JSON to CSV Converter
Convert JSON to CSV in your browser: nested objects become columns and the file opens cleanly in Excel. Free, no sign-up, nothing uploaded.
JSON input
Paste or type JSON, drop a file here, or open one. Nothing is uploaded.
Options
More options
Preview
Choose and order columns ()
Untick a column to leave it out; use the arrows to change the order. The output updates as you go.
Why convert JSON to CSV?
APIs, databases and apps hand data over as JSON, but spreadsheets, reporting tools and most colleagues work in rows and columns. CSV is the format they all open: Excel, Google Sheets, Numbers and LibreOffice, plus database and BI imports. The hard part is the shape. JSON nests objects inside objects and lists inside records, so this converter finds the list of records, gives every nested field its own column and writes a CSV that opens cleanly in Excel, accents and all.
How to use it
- Paste JSON, drop a .json file onto the box, or press Open file. JSON Lines (one record per line) works too.
- Check the Preview table. If the records sit inside a field such as
dataorresults, that list is picked for you; change it under Rows from. - Choose how lists inside a record become cells, and the delimiter your spreadsheet expects.
- Untick or reorder columns under Choose and order columns if you need fewer.
- Press Download .csv or Copy. For Excel, Download .xlsx gives a real workbook, and Copy for Excel / Sheets pastes straight into cells.
How nested JSON becomes columns
Every field of a record becomes a column named after its path. A nested object adds its key to the name, so address holding city becomes the column address.city. Records don't need the same fields: every field found anywhere gets a column, and a record without it gets an empty cell. Take these two records:
[
{ "id": 1, "name": "Ana", "address": { "city": "Lisbon", "zip": "1100-148" }, "tags": ["new", "vip"] },
{ "id": 2, "name": "Ben", "address": { "city": "Leeds" }, "tags": [] }
]With the default settings they become:
id,name,address.city,address.zip,tags
1,Ana,Lisbon,1100-148,"new, vip"
2,Ben,Leeds,,Ben has no ZIP code and no tags, so those cells are empty. The value new, vip contains a comma, so it is wrapped in quotes, as the CSV standard (RFC 4180) requires. Columns appear in the order the fields first appear and stay grouped by object, so a nested field that only shows up in the hundredth record still lands beside the other fields of its object rather than at the far end of the table. If your database or BI tool doesn't like dots in column names, switch the names to address_city or address/city under More options.
Four ways to handle lists inside records
A field like "tags": ["new", "vip"] holds several values, and a CSV cell holds one. Pick the treatment that suits what you'll do next:
| Option | What you get | Best for |
|---|---|---|
| Join into one cell (default) | new, vip | Reading, filtering and searching in a spreadsheet |
| One column per item | tags[0] = new, tags[1] = vip | Short lists of a fixed length, such as coordinates |
| Keep as JSON | ["new","vip"] | Lossless round trips, and importing into another system |
| One row per item | two rows, other fields repeated | Order line items, pivot tables and analysis |
Lists of objects, such as the items of an order, are written as JSON text when joined, because there is no tidy way to squeeze several objects into one cell. Choose One column per item to get items[0].sku, items[0].qty, items[1].sku and so on, or pick the list under One row per item of a list: each item gets its own row, with the order's other fields repeated on every row. That last layout is the one pivot tables and SQL imports want.
Which part of the JSON becomes the rows?
- A top-level array such as
[{…}, {…}]: each item is a row. - An API response such as
{"status": "ok", "data": [...]}: the biggest list of records inside it is used, whether it's calleddata,results,itemsor, in GeoJSON,features. Any other list can be chosen under Rows from. - Objects keyed by ID, as Firebase and some exports write them (
{"u1": {...}, "u2": {...}}): one row per key, with the key in a column of its own. - A single object, such as a settings file: one row, one column per field.
- JSON Lines / NDJSON, one JSON value per line: each line is a row.
- An array of arrays such as
[["name","age"],["Ana",31]]: each inner array is written as a row as it is.
Opening the CSV in Excel or Google Sheets
- Accents and emoji: many versions of Excel read a CSV without a byte-order mark in an older Windows encoding, turning é into é. Add BOM (on by default) marks the downloaded file as UTF-8 so Excel reads it properly. Turn it off for scripts and databases that don't expect it.
- Semicolons: where the comma is the decimal mark (much of Europe and South America), Excel expects semicolon-separated files. Choose Semicolon as the delimiter.
- Long numbers and leading zeros: Excel keeps only 15 significant digits, so it rounds long IDs, and it reads ZIP codes like 02134 as numbers, dropping the zero. The CSV keeps them exactly. To keep them in Excel, use Data › From Text/CSV and set those columns to Text. In Google Sheets, use File › Import and untick Convert text to numbers, dates, and formulas.
- Pasting instead of opening: Copy for Excel / Sheets copies tab-separated rows, which paste straight into separate cells. Pasted CSV text lands in a single column.
- Data from strangers: a cell starting with =, +, - or @ can run as a formula when the file is opened, a trick known as CSV injection. If the JSON came from user input, tick Protect against formulas, which puts an apostrophe in front of such cells and leaves real numbers like -5 alone.
Or skip CSV's quirks altogether: Download .xlsx writes a real Excel workbook from the same table, with a filter on the header row. Plain numbers become numbers and true/false become booleans, while ZIP codes, long IDs and anything that merely looks like a date stay text, exactly as in your JSON, so nothing needs re-importing. To convert existing CSV files to Excel or OpenDocument, use the Spreadsheet Converter.
Handled for you
- Commas, quotes and line breaks inside values are quoted per RFC 4180, with inner quotes doubled, so every spreadsheet reads them back exactly.
- Exact numbers. Converters built on JavaScript's
JSON.parseturn the ID 12345678901234567890 into 12345678901234567000 and 19.90 into 19.9. Here every number is copied character for character. - Field order is kept as written, even for keys that look like numbers, such as years.
- null becomes an empty cell; true and false are written as words; empty lists and objects leave the cell empty.
- Big files. Conversion runs in a background thread (a Web Worker), so a 10 MB file converts without freezing the page; files up to 100 MB are accepted.
- Invalid JSON is reported with the line and column and a plain reason: a trailing comma, single quotes, a missing comma, comments, an unclosed bracket. For JSON with many problems, the JSON Formatter & Validator repairs common mistakes automatically.
JSON vs CSV
| JSON | CSV | |
|---|---|---|
| Shape | Nested: objects inside objects, lists inside records | Flat: one table of rows and columns |
| Data types | Strings, numbers, true/false, null, objects, arrays | Text only; the reader decides what is a number |
| Opens in | Code editors, browsers, programming languages | Excel, Google Sheets, Numbers, LibreOffice, databases |
| Size | Repeats every key in every record | Names each column once, so usually smaller |
| Best for | APIs, config files, apps | Spreadsheets, reports, bulk imports |
Going the other way? The CSV to JSON Converter reads the files this page writes, including nested column names, so the two round-trip. To paste a table into a README or an AI chat, use CSV to Markdown Table, and for a quick readable summary of a JSON document, JSON/XML to Readable Text.
Frequently Asked Questions
How do I convert JSON to CSV?
Paste your JSON into the box, drop a .json file onto it, or press Open file. The CSV appears straight away, with a preview table underneath. Check that the right list became the rows, choose how nested lists should look, then press Download .csv or Copy. There is no Convert button to press and nothing to install or sign up for.
How do I convert nested JSON to CSV?
Nested objects are flattened into columns named after their path, so {"address": {"city": "Oslo"}} becomes a column called address.city. Lists inside a record can be joined into one cell, spread over numbered columns (tags[0], tags[1]), kept as JSON text, or expanded into one row per item with the other fields repeated. You can switch the path style to address_city or address/city if your database dislikes dots in column names.
My JSON has the records inside a "data" or "results" field. Will that work?
Yes. When the top level is an object, the converter looks for the biggest list of records inside it (data, results, items, features in GeoJSON and so on) and uses that for the rows. Every other list it finds is offered under Rows from, along with "the whole object as one row". Objects keyed by ID, as Firebase exports them, become one row per key with the key in its own column.
Is it safe to convert JSON to CSV here? Is my data uploaded?
Nothing is uploaded. The conversion runs in your browser, in a background thread on your own device, and the page has no server to send your data to. Your current input is kept only in this browser tab so it survives moving around the site, and it is forgotten when you close the tab. Your settings are remembered on this device.
Why do accents and emoji look garbled when I open the CSV in Excel?
Many versions of Excel open a CSV file without a byte-order mark (BOM) using an older Windows encoding, so é turns into é. The Add BOM option, on by default, puts the three-byte UTF-8 marker at the start of the downloaded file so Excel reads it correctly. Turn it off if the file is going to a script or database that doesn't expect a BOM. Copying never includes one.
Why does Excel change long numbers and drop leading zeros?
Excel keeps only 15 significant digits, so an 18-digit ID such as 123456789012345678 is shown as 1.23457E+17 and its last digits become zeros; and it reads digit-only text as a number, so a ZIP code like 02134 loses its zero. The CSV from this converter keeps every digit exactly as it was in the JSON; it's Excel that changes them when it opens the file. Download .xlsx avoids that: it stores such values as text cells, so Excel shows them unchanged. With a CSV, import it with Data, From Text/CSV and set those columns to Text, or in Google Sheets use File, Import and untick Convert text to numbers, dates, and formulas.
Can I convert JSON to Excel?
Yes. Paste or open the JSON, then press Download .xlsx to get a real Excel workbook of the same table, with a filter on the header row. Numbers are stored as numbers and true/false as booleans, while ZIP codes, long IDs and text that merely looks like a date stay exactly as written. That avoids the surprises of opening a CSV in Excel. The workbook is built in your browser too.
Can I convert a large JSON file to CSV?
Yes. Files of 10 MB and more convert in a background thread, so the page doesn't freeze, and files up to 100 MB are accepted. Very large inputs aren't shown in the text box (editing them there would be slow), but the whole file is converted, and Download always saves the complete CSV. How big you can go depends on your device's memory: a laptop handles far more than an older phone.
Does it work with JSON Lines (NDJSON)?
Yes. If the text holds one JSON value per line, as JSON Lines, NDJSON and many log and export files do, each line becomes a row. A file of objects separated by commas but missing the surrounding square brackets is reported with a hint to wrap it in [ ] instead of being guessed at.
What happens to commas, quotes and line breaks inside values?
They are handled the way RFC 4180, the CSV standard, describes: a value containing the delimiter, a double quote or a line break is wrapped in double quotes, and quotes inside it are doubled, so He said "hi" is written as "He said ""hi""". Excel, Google Sheets, LibreOffice and CSV libraries all read that back as the original text. Tick Quote every field if an importer insists on quotes everywhere.
What does the converter do with invalid JSON?
It stops and tells you where the problem is: the line and column, the line itself with a marker under the spot, and a plain-English reason such as a trailing comma, a single-quoted string, a missing comma between properties or an unclosed bracket. Show me in the input jumps to it. For JSON with many problems, the JSON Formatter can repair common mistakes like unquoted keys automatically.
How do I convert JSON to CSV in Python or on the command line?
In Python, pandas does it in two lines: df = pandas.json_normalize(data) flattens nested objects into dotted columns, and df.to_csv("out.csv", index=False) writes the file. On the command line, jq can write flat records: jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]]) | @csv' data.json. Both need care with lists inside records, which this page handles for you.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.