JSON to CSV
Flatten JSON arrays and objects into comma-separated values
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
- 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.
- Press Convert to CSV.
- Read the text in the CSV Results panel and press Copy CSV to place it on your clipboard.
- 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