Contact

JSON to CSV Converter

Input
Character: 0/200000Word: 0Line: 0Sentence: 0
Output
Character: 0Word: 0Line: 0Sentence: 0

Found this tool useful? Share it:

Share
Share
Share
Share

What this JSON to CSV converter does

It turns JSON into CSV, the flat rows-and-columns format that Excel, Google Sheets and most databases import. The usual input is an array of objects, such as an API response or a database export: each object becomes one row, and the columns are the keys that appear in the data. Conversion happens in your browser as you type.

How to convert JSON to CSV

  1. Paste your JSON into the input box, or use Upload to read a .json or .txt file.
  2. Pick a delimiter. Use a semicolon if your spreadsheet is set to a European locale, or a tab for tab-separated files.
  3. Turn Include header row off if you only want the data rows, and Flatten nested objects off if you want nested values kept as JSON text.
  4. Copy the CSV, or download it as converted.csv. The download starts with a UTF-8 byte order mark so Excel shows accented characters correctly.

Example

JSON input
[
  { "name": "Ann", "age": 30, "address": { "city": "Hull" } },
  { "name": "Bob", "city": "Paris" }
]
CSV output (flatten on)
name,age,address.city,city
Ann,30,Hull,
Bob,,,Paris

The nested address.city value becomes its own column, and cells for keys a row does not have are left empty.

How each kind of JSON is converted

How JSON input shapes and values are converted to CSV
JSONCSV result
Array of objectsOne row per object. Columns are all keys, in the order they first appear.
A single objectOne row.
Array of arraysEach inner array becomes a row exactly as given. No header row is added.
Array of plain valuesOne column named value.
Missing key or nullAn empty cell.
true / false / numbersWritten as true, false or the number.
Nested object, flatten onDotted columns such as address.city.
Nested object, flatten offThe object is written as JSON text in a quoted cell.
Array inside an objectWritten as JSON text in a quoted cell. Arrays are not split into extra rows or columns.

Quoting and escaping

Cells are quoted following the common RFC 4180 convention. A cell that contains the delimiter, a double quote or a line break is wrapped in double quotes, and any double quote inside it is doubled. So say "hi" becomes "say ""hi""". Lines are separated with a plain line feed.

Limits and things to watch

  • Records with different keys are fine, but a column that only some records have is empty for the others.
  • Deeply nested data and arrays of objects do not fit a flat table. They are kept as JSON text rather than guessed at, so check those columns before importing.
  • The output only reflects the JSON. A spreadsheet may still reinterpret CSV values on import: long numbers, leading zeros and dates are common victims. Import the file as text columns when that matters.
  • Spreadsheets can treat a cell that starts with =, +, - or @ as a formula. If the JSON comes from an untrusted source, review such cells before opening the CSV in Excel.
  • Invalid JSON is not converted. The output box shows the parser message with the line and column of the problem.

Privacy

Text you paste is converted in your browser and is not sent to our servers. If you use the Upload button, the file is sent to our server to be read and is not stored. See the Privacy Policy.

See also

Frequently asked questions

What JSON shape does this converter expect?
An array of objects works best, for example the response of a list API endpoint. A single object becomes one row, an array of arrays is written row by row, and an array of plain values becomes one column named value.
How are nested objects handled?
With Flatten nested objects on, each nested key becomes a dotted column such as address.city. With it off, the whole nested object is written as JSON text in one quoted cell.
What happens to arrays inside the data?
They are kept as JSON text in a single quoted cell, for example ["admin","beta"]. They are not expanded into extra rows or columns, because there is no single correct way to do that.
Why are some cells empty?
A cell is empty when that record has no such key, or when the value is null. The columns are the union of all keys, in the order they first appear.
Which delimiters can I use?
Comma, semicolon, tab or pipe. Excel in many European locales expects semicolons, so choose that if your file opens as a single column.
Why do accented characters look wrong in Excel?
Excel can mistake UTF-8 files for another encoding. The downloaded converted.csv starts with a UTF-8 byte order mark to avoid that. Copied text does not include it, so use the download for Excel.
What does the tool do with invalid JSON?
Nothing is converted. The output box shows the parser message, the line and column of the problem, and a few lines of context with a marker.
Can I convert CSV back to JSON?
Yes, with the CSV to JSON Converter linked under Related tools.
Is my data uploaded?
Pasted JSON is converted in your browser. Only the Upload button sends a file to our server, where it is read and not stored.