Convert JSON to CSV
A JSON file or pasted JSON to CSV, with nested objects flattened into columns.
Free, no sign-up, no credit card. Your files stay on your device.
How to convert JSON to CSV
- Choose a JSON file, or paste JSON into the box.
- Pick the separator, and how to write lists inside a record.
- Check the result, then select Download or Copy.
What to know
What comes out
- One header row with the column names, then one row for each record. A list of lists is written as plain rows with no header.
- true and false are written as those words, and null as an empty cell.
- Cells with the separator, quotes, or line breaks inside are put in quotes, so the CSV opens back into the same cells.
- An empty object inside a record is written as {} and an empty list as [], so that nothing silently disappears.
What it can't do
- It does not guess which nested list should become rows of their own. A list of objects inside a record is flattened into columns such as items.0.name, or kept as JSON text.
- Two keys that differ only in a dot, such as "a.b" and a nested a with b inside, give the same column name and the later one wins.
If something goes wrong
It says the JSON isn't valid
The message names the spot where the JSON stops making sense. Common causes are a trailing comma, single quotes instead of double quotes, a key without quotes, and two values pasted one after another.
Only one column called value
The JSON is a list of plain values, such as numbers or words, not objects, so each one becomes a row in one column. Wrap your values in objects if you want named columns.
Columns are in an odd order
Columns follow the order keys first appear in the records. Put the keys in the order you want in the first record, or reorder the columns in your spreadsheet afterwards.
I need Excel rather than CSV
Turn the result into an Excel file with CSV to Excel, which keeps long numbers and leading zeros as text. Use CSV to Excel.
Questions
Is my JSON uploaded?
No. Your files are processed on your device. We never upload them. The text you paste is converted on your device too.
What JSON can it read?
A list of objects, which is the usual case, one object, a list of values, a list of lists, and JSON Lines (one JSON value on each line). It also reads a wrapper object that holds one list, such as {"data":[…]}, and tells you when it uses it.
How are nested objects handled?
Each inner key becomes a column named with dots. {"address":{"city":"Oslo"}} makes a column called address.city with the value Oslo.
What about lists inside a record?
Your choice. A column for each item gives tags.0, tags.1 and so on. Kept as JSON in one cell writes the whole list, such as ["a","b"], in one column. The first suits lists of a few items, the second lists of different lengths.
What if the records have different keys?
The columns are all the keys that appear, in the order they are first seen. A record without a key gets an empty cell in that column.
Why are long numbers kept exact?
Where the browser says how a number was written, a number with more digits than JavaScript can hold, such as an ID of 20 digits, is written as it was in the JSON. In a browser that does not, such numbers are rounded; keep IDs as strings in the JSON to be safe.
Will Excel open the CSV?
Usually. Excel splits columns on the separator of your region, so pick a semicolon if the commas don't split them. Letters outside English may show wrongly, because the file is UTF-8 without a byte order mark. Use CSV to Excel on the result if that happens.