Home / Developer tools / JSON to CSV

JSON to CSV Converter

Turn JSON into a CSV file for Excel or Google Sheets. Nested objects are flattened into columns, arrays can be joined, and every field is quoted correctly.

Options

CSV result

Table preview (first 50 rows)

How to convert JSON to CSV

  1. Paste your JSON or open a .json file. An array of objects is the usual shape.
  2. Choose the delimiter and how to treat nested objects and arrays.
  3. Copy the CSV, or download it. Tick the BOM option if the file will be opened in Excel.

Example

[
  { "id": 1, "name": "Alex", "address": { "city": "Dubai" }, "tags": ["a", "b"] },
  { "id": 2, "name": "Sam", "address": { "city": "London" }, "tags": [] }
]
id,name,address.city,tags
1,Alex,Dubai,a; b
2,Sam,London,

What JSON shapes work

  • An array of objects. Each object is a row. The columns are all keys that appear in any object, in the order they first appear, so objects with different keys are fine, and a missing value is left empty.
  • An array of arrays. Each inner array is a row.
  • An array of plain values. You get one column named value.
  • An object that holds an array, such as { "data": [ ... ] }. The array is used, and the tool tells you which one.
  • An object of objects, such as { "a": {...}, "b": {...} }. Each key becomes a row, with the key in the first column.
  • JSON Lines, with one JSON value on each line. It is read as an array.

Nested data

  • Nested objects are flattened with dots: address.city. You can also keep them as JSON text in one cell.
  • Arrays can be joined into one cell with a separator you choose, written as JSON text, or spread over numbered columns such as tags.0 and tags.1.

Excel and other programs

  • BOM: Excel needs a byte order mark at the start of a UTF-8 file to show accents and other characters correctly. Tick the option, and download the file.
  • Delimiter: in many countries Excel expects a semicolon, not a comma, because the comma is the decimal mark. If everything lands in one column, change the delimiter.
  • Line endings: Windows programs use CRLF, which is the default here. Unix tools are happy with LF.

Spreadsheet formula protection

A text value that starts with =, +, - or @ can be run as a formula when a spreadsheet opens the file. This is called CSV injection. Tick the protection option to put an apostrophe in front of such values, which is the usual fix. It is off by default, because it changes your data.

To convert the other way, use CSV to JSON. For file upload and a table preview, see CSV to JSON online, and read the CSV vs JSON guide. Related tools: JSON to XML, JSON to YAML and JSON diff.

Frequently asked questions

How do I convert JSON to CSV?

Paste the JSON, which should be an array of objects, and copy the CSV. Nested objects are flattened into columns.

How are nested objects and arrays handled?

Nested objects become columns such as address.city. Arrays can be joined into one cell, written as JSON, or spread over numbered columns.

Why does Excel show strange characters?

Excel needs a byte order mark to read UTF-8. Tick the BOM option and download the file.

Why is everything in one column in Excel?

Your Excel expects another delimiter. In many regions it is a semicolon. Change the delimiter and convert again.