How the JSON to CSV works

The converter parses your JSON with a strict parser, then turns each object in the top-level array into one CSV row. A single object becomes one row, and an array of plain values becomes a single value column.

Nested objects are flattened into dot-notation columns, so {"address": {"city": "Oslo"}} becomes a column named address.city. The header row is the union of the columns found in all records, in the order they first appear; a record that lacks a column gets an empty cell. Nested arrays are written as compact JSON text by default. You can instead join simple values with "; " (arrays that contain objects are still written as JSON text), or give every item its own column such as tags.0, tags.1 and items.0.sku.

Strings are written without their JSON quotes and escapes, numbers exactly as written (so long IDs keep every digit), true and false as text, and null as an empty cell. Fields that contain the delimiter, double quotes, line breaks or leading or trailing spaces are quoted following RFC 4180, and rows end with CRLF.

How to use the JSON to CSV

  1. Paste a JSON array of objects into the input box, open a .json file, or select Load example.
  2. Choose the delimiter (comma, semicolon, tab or pipe), how nested arrays are written, and whether to include a header row.
  3. Select Convert to CSV, or press Ctrl + Enter (Cmd + Enter on a Mac).
  4. Copy the CSV or select Download to save it as a .csv file (.tsv when the delimiter is tab).

Example

This input:

[
  {"id": 1, "name": "Ann", "address": {"city": "Oslo"}, "tags": ["admin", "dev"]},
  {"id": 2, "name": "Tom", "email": "tom@example.com"}
]

is converted with the default options to:

id,name,address.city,tags,email
1,Ann,Oslo,"[""admin"",""dev""]",
2,Tom,,,tom@example.com

Common use cases

  • Opening an API response in a spreadsheet to sort, filter or share it.
  • Preparing JSON exports from a NoSQL database for import into a SQL table or a BI tool.
  • Turning a list of users, orders or products into a report for non-technical colleagues.
  • Using a semicolon delimiter for spreadsheet programs in regions where the comma is the decimal separator.

Common errors and how to fix them

The JSON must be an array of objects or a single object to convert it to CSV
CSV is a table, so the input has to be rows. If your API wraps the records in an envelope, paste only the inner array, for example the contents of the data property, rather than the whole response.
Nested objects or arrays appear as JSON text inside one cell
CSV has no concept of nesting, so a nested value is written into the cell as text. Flatten the structure in your source data first if you need one column per nested field.
Rows have different columns, or an unexpected column appears
The header is the union of every property name found across all objects, and a row missing a property gets an empty cell. An unexpected extra column usually means a property name is misspelled in one of the records.
Excel strips leading zeros or reformats long IDs
That happens during Excel's import, not during the conversion. Import with Data, then From Text/CSV, and set those columns to Text before finishing.

Frequently asked questions

How are nested objects handled?

They are flattened into columns whose names join the keys with dots. For example, {"address": {"city": "Oslo"}} becomes a column named address.city. An empty nested object gives an empty cell.

How are arrays inside records handled?

You can choose. By default each array is written as compact JSON text in one cell. You can also join simple values with "; " (arrays that contain objects are still written as JSON text), or give each item its own column, such as tags.0 and tags.1, with objects inside arrays flattened further, such as items.0.sku.

What if records have different fields?

The header row is the union of all fields from all records, in the order they first appear. A record that does not have a field gets an empty cell in that column.

How are null, true and false written?

null becomes an empty cell, and true and false are written as the text true and false. Numbers are written exactly as they appear in the JSON, so long IDs are not rounded.

What JSON can be converted?

An array of objects gives one row per object. A single object gives one row, and an array of plain values gives a single column named value. An empty array or a plain string or number cannot be converted.

Is my data uploaded to your server?

No. The conversion runs in your browser, and the JSON you paste or open is not sent to our server.