Black Friday: 50% off every paid plan with code BF50. Ends 5 December.

See prices

Free tool

JSON to CSV, and back.

Paste JSON or JSON Lines from an API, an export or a log, or drop the file, and get a CSV or a real Excel file. Nested objects become their own columns, lists are joined or get a row per item, and when the JSON holds several lists you pick which one. Click a column to leave it out. In the Excel file, codes like 00123 stay as text. Paste a CSV instead and it becomes JSON.

Need a custom tool, app or website? Contact us 
JSON or CSV
Result

The CSV or JSON shows here.

Paste on the left, drop a file, or press Example.

Your data is converted in your browser. It is never uploaded or saved. Only your settings are remembered on this device.

How it is read

Records in, rows out.

01 / Records

The list is found

A top-level list of objects becomes the rows. If the JSON wraps it, as in {"data": [...]}, that list is used.

02 / Columns

Every key, once

Each key seen in any record becomes a column, in the order first seen. A record without it gets an empty cell.

03 / CSV rules

Quotes done right

Cells with commas, quotes or line breaks are quoted the standard way, so spreadsheets read them as one cell.

Guide

How to convert JSON to CSV, nested data included.

A JSON to CSV converter turns a list of records, like an API response or a database export, into rows and columns that a spreadsheet can open. Each object becomes a row and each key becomes a column. This one finds the list even when it sits inside a wrapper, turns nested objects into their own columns, puts lists into a single cell, and shows a table of the result before you download it.

How to convert JSON to CSV

  1. Paste your JSON into the left box, drop a .json or .jsonl file on it, or press Open file. Press Example to try it with sample data. Text that starts with [ or { is read as JSON, and one object per line is read as JSON Lines.
  2. Check the status line. It says how many rows were found and which list they came from. If there are several lists, pick one under Rows from.
  3. Pick a Separator. Comma suits most spreadsheets. Choose Semicolon if Excel puts everything in one column, Tab for a .tsv file, or Pipe.
  4. Choose how nested data is handled: leave Nested objects as columns on, and pick what happens to Lists inside a record.
  5. Look over the table under the boxes, which shows the first 100 rows and 40 columns, with numbers in orange. Click a name under Columns to leave that column out.
  6. Press Download .csv, Download Excel (.xlsx), or Copy to paste the result straight into a sheet.

A worked example

Here are two customer records, each with a nested address and a list of tags:

[{"id": 1, "name": "Ava", "address": {"city": "Leeds", "country": "UK"}, "tags": ["new", "trial"]}, {"id": 2, "name": "Ben", "address": {"city": "Austin", "country": "US"}, "tags": ["paid"]}]

With the default settings you get five columns, because the address object is split into two:

idnameaddress.cityaddress.countrytags
1AvaLeedsUKnew, trial
2BenAustinUSpaid

In the CSV text, Ava's tags are written as "new, trial" with quotes around them. That is how CSV keeps a comma inside one cell instead of starting a new column. Quotes inside a value are doubled, and cells with line breaks are quoted too, so the file opens cleanly.

What the settings do

  • Nested objects as columns. On, an object inside a record becomes dotted columns like address.city. Off, the whole object is written into one cell as JSON text. Turn it off when the nested part has many keys you do not need.
  • Lists inside a record. A list of plain values is joined with commas or semicolons, or kept as JSON if you want to turn it back into a list later. A list of objects, like a set of order lines, is kept as JSON in one cell, unless you pick A row for each item. Then each order line gets its own row, the other values of the record are repeated on every row, and the line keys become columns such as orders.sku.
  • First row holds the column names. Untick it to leave out the header row, for example when you add rows to a sheet that already has headers.
  • Excel-safe CSV. Adds a small UTF-8 mark at the start of the file so Excel shows accented names correctly.
  • Download Excel (.xlsx). Saves a real workbook instead of a CSV. JSON numbers become Excel numbers, and text stays text, so a zip code like "02134" keeps its zero and a 19 digit ID is not rounded. The header row gets a filter.

How the records are found

CSV needs a list of rows, but JSON from an API often wraps the list, as in {"status": "ok", "data": [...]}. The tool takes a top-level list as it is. Inside an object, it finds every list of objects, up to a few levels deep, and uses the longest one. When there is more than one, Rows from lets you pick another. If there is no list at all, the single object becomes one row. Records do not need the same keys: every key seen in any record becomes a column, in the order it first appears, and records without it get an empty cell.

JSON Lines, also called NDJSON, has one JSON object on each line, as many logs and exports do. It is read as a list of records, with no need to add brackets or commas.

Common problems and the fix

  • "This is not valid JSON". The result side shows the line and column and the lines around it. A missing comma, a trailing comma or single quotes are the usual causes. The JSON formatter can fix those for you.
  • Long IDs turn into something like 1.23457E+18 in Excel. Excel keeps only 15 significant digits in a number, and drops leading zeros when it opens a CSV. Use Download Excel (.xlsx) instead, which keeps them as text.
  • The wrong list became the rows. Pick the right one under Rows from.
  • Too many columns. Click the ones you do not need under Columns, or untick Nested objects as columns so each nested object stays in one cell.

Big files

Files of many megabytes convert in a moment. A file over 3 MB is kept out of the input box to keep the page quick, and the result is drawn a screen at a time. The table shows the first 100 rows, and the download holds everything. Files in older character sets, such as Windows-1252, are read correctly, and the status line says so.

Going the other way? The box also reads CSV, but the CSV to JSON converter is built for that job. To turn a CSV into a real spreadsheet file, use CSV to Excel.

Questions

Good to know.

Why do accents look wrong when I open a CSV in Excel?

Excel often guesses an old encoding for CSV files. The Excel-safe option adds a small UTF-8 mark at the start of the file, so names like José and Zoë come through intact.

Excel puts everything in one column. Why?

Where a comma is the decimal mark, as in much of Europe, Excel expects semicolons between cells. Pick Semicolon as the separator and download again.

Can it handle large files?

Yes. Files of many megabytes convert in a moment. The table shows the first 100 rows to keep the page quick; the download holds everything.

Can I get an Excel file instead of a CSV?

Yes. Press Download Excel (.xlsx). Numbers stay numbers, codes with leading zeros and long IDs stay text, and the header row gets a filter.

Does it read JSON Lines?

Yes. A file with one JSON object on each line is read as a list of records.

How does CSV to JSON treat numbers?

Cells that are plain numbers become numbers, true and false become true and false, and empty cells become null. Untick the option to keep every value as text, which is safer for codes like 007 or long ID numbers.

Is my data uploaded?

No. Everything happens in this tab, so exports with customer data stay on your computer.

Can I open the CSV in Google Sheets or Numbers?

Yes. In Google Sheets use File, then Import, and upload the file. Numbers opens a .csv file directly. Both read the comma version fine.

What happens to deeply nested JSON?

Every level of nested objects is flattened, so a value three levels down gets a column like user.address.city. Lists of objects stay as JSON text in one cell, or get a row per item if you pick A row for each item.

Why are some of my columns empty?

Not every record has every key. A key that appears in any record becomes a column, and the records that lack it get an empty cell there.

How big a JSON file can I open?

Files up to 200 MB. How quickly a big one converts depends on your computer.

Listed on

Listed on JustMacAppsMotionShine on Mac App IndexMotionShine on ScrollLaunchMotionShine featured on StartupBaseFeatured on FazierFeatured on Twelve ToolsMotionShine - Featured on Smol Launch