JSON to CSV Converter

Flatten a JSON array of objects into CSV rows, with a delimiter of your choice.

About JSON to CSV Converter

Turn a JSON array of objects into CSV with one row per object and one column per key, ready to open in Excel, Google Sheets or a database import.

How to use

  1. Paste a JSON array of objects (a single object also works), or load a .json file up to 5 MB.
  2. Choose the delimiter: comma by default, or semicolon or tab.
  3. Copy the CSV, or Download it as .csv named after the loaded file.

The page opens on JSON → CSV. Switch the direction to CSV → JSON, or to Auto, to go the other way.

How the columns are built

  • The header row is every key found in any object, in the order first seen. An object that lacks a key gets an empty cell in that column, so records with different shapes still line up.
  • A nested object is flattened: { "address": { "city": "London" } } becomes a column named address.city.
  • An array inside a record is written as JSON text in one cell, for example ["a","b"]. A record never turns into several rows.
  • null becomes an empty cell; true, false and numbers are written as they are.
  • A value containing the delimiter, a double quote or a line break is wrapped in double quotes, with inner quotes doubled, as RFC 4180 describes.
  • Lines end with a line feed, and no byte order mark is added.

What it will not convert

An array of plain values such as [1, 2, 3], or an array of arrays, has no keys to use as a header, so it is reported as an error. Wrap the data in objects first.

Example

[
  { "id": 1, "name": "Ada", "address": { "city": "London" } },
  { "id": 2, "name": "Grace", "tags": ["navy", "cobol"] }
]
→
id,name,address.city,tags
1,Ada,London,
2,Grace,,"[""navy"",""cobol""]"

Privacy

The conversion runs in the page with papaparse. A loaded file is read locally, no request is made, and nothing is stored.

Frequently asked questions

How do I open JSON data in Excel?
Convert it to CSV, download the .csv file and open it in Excel. If accented or non-Latin characters look wrong, import it instead with Data, From Text/CSV and choose UTF-8, because the file has no byte order mark. Recent versions of Excel can also load JSON directly through Data, Get Data, From File, From JSON.
How is nested JSON converted to CSV?
CSV is flat, so nesting has to be encoded in the column names. Here each nested key is joined to its parent with a dot, giving columns such as address.city, and an array is kept as JSON text in a single cell. Converting that CSV back rebuilds the nested objects.
What if the objects in my JSON array have different keys?
The header is the union of all keys across the array, in the order they first appear. Each row fills the columns it has a value for and leaves the others empty, so no data is dropped.
Should I use a comma or a semicolon as the delimiter?
Comma is the standard and what most tools expect. Use a semicolon when the file will be opened in Excel under a locale that uses the comma as the decimal separator, such as German or French, where Excel expects semicolons. Use a tab to paste straight into a spreadsheet.