Back to Tools

JSON to CSV

Flatten JSON arrays and objects into comma-separated values

JSON Array

From a JSON array to rows and columns

API responses and exported records are usually JSON, but spreadsheets, reporting tools and many import screens want CSV. This converter takes a JSON array of objects, lists the keys as a header line, and prints one line per object. It runs in your browser, so you get the result the moment you press the button.

Steps

  1. Paste your JSON into the JSON Array box. Sample Data fills in three people with id, name, email and role, and Clear empties the box.
  2. Press Convert to CSV.
  3. Read the text in the CSV Results panel and press Copy CSV to place it on your clipboard.
  4. Paste it into a text file, save it with a .csv extension, or paste directly into a spreadsheet.

If the JSON cannot be parsed, an error dialog shows the message from the parser, which usually points to the position of the problem, such as a missing comma or an unquoted key.

What the converter does with your data

  • If you paste a single object instead of an array, it is treated as a one-row table.
  • The header row comes from the keys of the first object only. Keys that appear only in later objects are not included as columns.
  • Each value is written using JSON string quoting, so text cells arrive wrapped in double quotes.
  • Objects or arrays nested inside a value are written out as JSON text within that cell rather than being flattened into extra columns.

Good uses

  • Opening the output of a REST API call in Excel or Google Sheets to review it as a table.
  • Producing a quick data extract for a colleague who does not work with JSON.
  • Preparing a bulk-upload file for a CRM or shop platform from an exported list.

Limitations to be aware of

Because the code substitutes an empty string for any value that is falsy, the number 0, the boolean false and null all come out as empty cells. If zeros matter, convert them to strings in the source first. Quotes inside text are escaped with a backslash, in the JSON style, rather than by doubling them as strict CSV does, so check cells that contain quotation marks after importing. Also make sure your first object has every column you need. There is no download button on this tool, only copy.

Related Tools


Frequently Asked Questions

Why do zeros and false values appear as empty cells?
The converter replaces any falsy value with an empty string before writing the cell, which includes 0, false and null. If you need those values kept, change them to strings such as "0" or "false" in your JSON before converting.
Where do the column headers come from?
They are taken from the keys of the first object in your array. If later objects have extra keys, those fields are not added as columns, so put the most complete object first or add the missing keys to it.
Can I paste a single JSON object instead of an array?
Yes. A lone object is wrapped automatically and produces a header line plus one data line. Empty arrays, however, trigger an error message because there is nothing to convert. Fix the JSON first if the array is empty.
How are nested objects handled?
They are not flattened into separate columns. A nested object or array is written into its cell as JSON text. If you need each nested field in its own column, flatten the JSON structure before pasting it.
Can I download the file directly?
This tool only offers a Copy CSV button. Paste the copied text into a plain text editor and save with a .csv extension, or paste it straight into Excel or Google Sheets. Both choices keep the header row unchanged.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.