JSON to CSV Converter

Paste an API response or a JSON export and download-ready CSV appears beside it. Rows are flattened in your browser, so customer and billing data are never uploaded.

JSON → CSV

Input

Settings

History

Load from URL

Why export JSON as CSV

JSON is how APIs deliver data; CSV is how analysts, finance teams and spreadsheets consume it. You convert in this direction to open an API response in Excel or Google Sheets, to bulk-import records into a CRM or database, or to hand a report to someone who does not read JSON.

The challenge is shape: CSV is a flat grid, while JSON nests. The rules below describe exactly how the grid is built.

Which JSON shapes work

  • An array of objects is the usual case: each object is a row and keys become column headers.
  • A single object becomes a one-row table.
  • An array of arrays is written row for row with no header line, padding shorter rows with empty cells.
  • An array of plain values becomes one column named value.

Every row of an array must have the same kind: mixing objects with numbers, for example, is an error that points at the first offending item. If your data sits inside an envelope such as {"data": [...]}, extract the inner array first, for instance with a JSONPath query in the JSON formatter.

Columns are the union of all keys across rows, in the order they first appear. A row missing a key gets an empty cell, so heterogeneous records still line up.

Flatten nested objects (a.b columns)

With this option on (the default), nested objects are expanded into dotted column names: {"user": {"name": "Ada", "geo": {"lat": 1.5}}} produces the columns user.name and user.geo.lat. Flattening follows the data up to 64 levels deep; anything deeper is kept as JSON text.

Arrays are never flattened into numbered columns, because their length varies from row to row. Instead each array is written into one cell as compact JSON text, such as ["admin","beta"]. Empty objects are written the same way, as {}.

Turn the option off to keep each top-level key as one column, with any nested object stored as JSON text in its cell. That is handy when the CSV will be loaded into a database column of type JSON.

Delimiter and quoting

Delimiter offers Comma (the default), Semicolon and Tab. Choose semicolon when the file will be opened by Excel in a locale that uses the comma as decimal separator, such as Germany, France or Brazil; choose tab to paste the result straight into a spreadsheet.

Fields are quoted following RFC 4180 only when they contain the delimiter, a double quote or a line break, and inner quotes are doubled.

What changes in the CSV

CSV has no types. Numbers are written with their original digits (1.50 stays 1.50, and long IDs are not rounded), booleans become true/false, and null becomes an empty cell — indistinguishable from a missing key. Spreadsheet software may then reinterpret values on opening, for example stripping leading zeros or reformatting dates; import as text to prevent that. Accent problems in Excel are covered in CSV and Excel encoding. The conversion is done locally, with no upload.

Examples

Customer rows

Each object becomes a row; the name containing quotes is wrapped in quotes with the inner ones doubled.

Input
[
  { "id": 1, "name": "Aisha Tan", "city": "Singapore", "joined": "2024-03-11", "balance": 1520.5 },
  { "id": 2, "name": "Ben Okafor", "city": "Lagos", "joined": "2023-11-02", "balance": 88 },
  { "id": 3, "name": "Chloé \"CJ\" Martin", "city": "Paris", "joined": "2025-01-20", "balance": -12.75 }
]
Output
id,name,city,joined,balance
1,Aisha Tan,Singapore,2024-03-11,1520.5
2,Ben Okafor,Lagos,2023-11-02,88
3,"Chloé ""CJ"" Martin",Paris,2025-01-20,-12.75
Open this example in the tool

Nested API response

customer.name and customer.address.city become columns, items arrays stay as JSON text, and the coupon column is empty for the first row.

Input
[
  { "id": "ord_1", "customer": { "name": "Aisha", "address": { "city": "Singapore" } }, "items": ["KB-104"], "paid": true },
  { "id": "ord_2", "customer": { "name": "Ben" }, "items": ["MS-220", "MS-221"], "paid": false, "coupon": "SPRING10" }
]
Output
id,customer.name,customer.address.city,items,paid,coupon
ord_1,Aisha,Singapore,"[""KB-104""]",true,
ord_2,Ben,,"[""MS-220"",""MS-221""]",false,SPRING10
Open this example in the tool

Semicolon CSV for European Excel

Fields are separated by semicolons, which Excel in comma-decimal locales splits into columns automatically.

Input
[
  { "sku": "KB-104", "price": 129.9, "stock": 42 },
  { "sku": "MS-220", "price": 79, "stock": 0 }
]
Output
sku;price;stock
KB-104;129.9;42
MS-220;79;0
Open this example in the tool

Common errors and how to fix them

ErrorCauseFix
Expected every row to be an object, but found a numberThe array mixes objects with other values, so there is no consistent set of columns.Make every element an object, or convert the parts separately.
Expected an array of rows or an object, but the JSON is a stringThe top-level JSON value is a single string, number or boolean.Provide an array of objects, an array of arrays or a single object.
The array is empty, so there are no rows to writeA warning: the input is [] and there is nothing to export.Check that you copied the array with data, not an empty page of results.
Trailing comma before ']'
Explained
The JSON input is invalid because of a comma after the last element.Remove the comma, or repair the JSON in the JSON formatter first.

Frequently asked questions

How are nested objects handled?

With flattening on, they become dotted columns such as address.city. With it off, the whole nested object is written into one cell as JSON text.

What happens to arrays inside a row?

They are written as compact JSON text in a single cell, since the number of items can differ between rows.

Why does Excel put everything in one column?

Your Excel locale probably expects semicolons. Choose the Semicolon delimiter, or use Data > From Text/CSV and pick the comma.

Do rows need the same keys?

No. Columns are collected from all rows, and a row without a key simply gets an empty cell in that column.

Is my JSON uploaded?

No, the CSV is generated in your browser and nothing is sent to a server.

Related tools