Skip to content
Toolshelf

How to Convert JSON to CSV

Convert a JSON array of objects into CSV for spreadsheets. See a valid example, how nested fields flatten, and what to fix when the JSON is invalid.

Start with an array of objects

CSV is a table: one header row, then data rows. JSON converts cleanly when you have an array of objects that share keys. Each object becomes a row; each key becomes a column.

Paste that JSON into the JSON to CSV Converter. Conversion runs in your browser and you can download the file locally.

[
  { "id": 21, "name": "Ada", "role": "admin" },
  { "id": 22, "name": "Grace", "role": "editor" }
]
Two rows, three columns after conversion.

The CSV you should get

Field order follows the keys as they appear. Values with commas or quotes are wrapped according to RFC 4180 (quotes doubled inside quoted fields).

id,name,role
21,Ada,admin
22,Grace,editor

Nested objects become dotted columns

Spreadsheet cells are flat. A nested object such as address.city is usually exported as a column named address.city. Arrays of objects get numeric indexes (items.0.sku). If the nesting is deep, flatten or pick fields in your app first so the CSV stays readable.

[
  {
    "id": 7,
    "address": { "city": "Pune", "pin": "411001" }
  }
]

Validate JSON before you convert

A converter cannot build CSV from invalid JSON. Trailing commas, single quotes, and comments will fail. Fix syntax first with the JSON Formatter & Minifier, or follow How to Fix Invalid JSON. Pretty-printing is optional; parsing is not — see How to Format JSON Online.

Shapes that need extra care

Not every JSON document is a table.

  • A single object becomes one row — useful, but not a list export.
  • An array of numbers or strings is not a named-column table; you get index/value style output.
  • Mixed keys across objects produce sparse columns (empty cells where a key is missing).
  • Very large files can be slow in the browser; keep exports to a size you would paste into a spreadsheet anyway.

Convert in the browser

Open the JSON to CSV Converter, paste or load a .json file, convert, then copy or download CSV. If two exports look the same but import differently, compare the text for an extra header row or a BOM.

Frequently asked questions

How do I convert a JSON array to CSV?
Use an array of objects, one object per row. Convert in a local tool, then open the CSV in Excel or Google Sheets. Nested keys are typically flattened into dotted column names.
Why won’t my JSON convert to CSV?
The JSON is probably invalid, or it is not a list of objects (for example a single nested blob with no rows). Parse and fix the JSON first, then convert.
Can I convert JSON to Excel?
CSV is the usual interchange format. Excel and Google Sheets open CSV. True .xlsx is a different file format; this workflow produces CSV, not a native Excel workbook.
Does converting JSON to CSV upload my data?
On Toolshelf the conversion runs in your browser. The JSON is not uploaded or stored on a server.

Try these Toolshelf tools

Related articles

← All articles