JSON to CSV Converter
Turn a JSON array into a spreadsheet-ready CSV file.
Use via API
Convert a JSON array of objects to CSV. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/json-to-csv
curl https://pithlab.com/api/v1/tools/json-to-csv \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"[{\"name\":\"Ada\",\"age\":36},{\"name\":\"Alan\",\"age\":41}]"}'About the JSON to CSV Converter
Convert a JSON array of objects to CSV for Excel or Google Sheets. Flattens nested objects into dotted columns and quotes values correctly. Runs in your browser.
How to use the JSON to CSV Converter
- Paste a JSON array of objects, or press Example.
- Choose the delimiter: comma for most tools, semicolon for Excel in many European locales, or tab for TSV.
- Decide whether to include a header row and whether nested objects should be flattened into columns such as address.city.
- Copy the CSV or download it as a .csv file to open in a spreadsheet.
Examples
Input
[{"id":1,"name":"Ada","address":{"city":"London"}},{"id":2,"name":"Grace, Jr.","address":{"city":"New York"}}]Output
id,name,address.city 1,Ada,London 2,"Grace, Jr.",New York
Input
[{"sku":"A1","price":9.5},{"sku":"B2","stock":0}]Output
sku,price,stock A1,9.5, B2,,0
Frequently asked questions
What JSON shapes can be converted?
An array of objects works best: each object becomes a row and the columns are every key that appears, in the order first seen. A single object, an array of arrays, or an array of plain values are also accepted.
How are nested objects and arrays handled?
Nested objects are flattened into dotted column names like address.city, unless you turn flattening off. Arrays are written as JSON text in a single cell, since they have no fixed number of columns.
Why does Excel put everything in one column?
Excel uses your system's list separator. In locales where the comma is the decimal separator, it expects semicolons, so choose the semicolon delimiter before downloading.
How are commas and quotes inside values escaped?
Following RFC 4180, any value containing the delimiter, a double quote, a line break, or leading or trailing spaces is wrapped in double quotes, and quotes inside it are doubled.