JSON to CSV: How to Turn an API Response Into a Spreadsheet Without Breaking It
An API returns JSON; a spreadsheet wants CSV. Converting between the two looks trivial until the first real dataset arrives: a name with a comma in it splits into two columns, a quoted phrase corrupts the row, a nested address object lands in a cell as [object Object], and one record missing a field shifts every column after it. This tool handles all four cases in your browser. Paste a JSON array of objects and get a CSV you can open in Excel or Google Sheets without repair work: nested objects become dot-notation columns, lists become single cells, missing fields become empty cells, and any field containing the delimiter, a quote, or a line break is quoted and escaped exactly the way spreadsheet apps expect.
How to use the JSON to CSV Converter
- 1
Paste your JSON
Paste a JSON array of objects, a single object, or an array of plain values. A common API shape — one object wrapping the real array, like {"users": [...]} — is unwrapped automatically when it is the object's only key. If the JSON is invalid, the tool points at the character position where parsing failed instead of silently producing a wrong file.
- 2
Pick a delimiter and check the preview
Comma is the default, but pick semicolon if your spreadsheet locale expects it (many European Excel setups do) or tab for TSV-style pastes. The preview table shows the first 10 rows with the final column set, so you can spot a missing field or a wrongly flattened key before downloading. Untick the header row if the file you are appending to already has one.
- 3
Copy or download the CSV
Copy the full CSV to paste into a spreadsheet, or download it as data.csv. The downloaded file contains every row, not just the previewed ones, and uses CRLF line endings, which is what Excel on Windows expects.
Why privacy matters with JSON converters
JSON converters look harmless, which is why people paste live API responses into them without thinking: customer lists, order exports, analytics dumps, and internal records that contain names, emails, addresses, and IDs. A converter site that logs what you paste now holds your data, and some of them keep it indefinitely or train on it. This tool runs JSON.parse and plain string building locally in your tab, so the data you are converting never leaves your device. Local conversion is also more accurate than many web converters: because it applies the standard CSV quoting rules itself, a result here opens identically in Excel, Google Sheets, and LibreOffice — no dialect differences, no repair dialog on open.
Who is this for?
Built for developers turning API responses into reports, analysts and operations staff importing data into spreadsheets, and anyone who has ever opened a converted CSV to find their columns shifted one to the right.
How nested JSON becomes flat columns
A spreadsheet is two-dimensional — rows and columns — while JSON is a tree. The only honest way to flatten a tree is to name each leaf by its path. An object like {"address": {"city": "Lahore", "zip": "54000"}} therefore becomes two columns, address.city and address.zip, and every row that has an address fills both. A row without an address gets empty cells, not shifted columns, because the column set is the union of every key seen across all rows, in first-seen order.
Lists are the one case with no perfect flat answer, so the tool is explicit about its choice: a list of plain values (strings, numbers, true/false) becomes one cell with the values joined by semicolons, which keeps the row structure intact and stays readable. A list of objects, by contrast, has no single-cell representation that a spreadsheet can use, so it is kept as its JSON text — visible, copyable, and honest about what it is, rather than silently flattened into invented columns. If your data is mostly lists of objects, convert each list separately; one CSV per list is the shape spreadsheets actually understand.
The CSV escaping rules that keep a file from breaking
Three rules, applied exactly, are the whole difference between a CSV that opens cleanly and one that needs repair. First, any field containing the delimiter, a double quote, or a line break must be wrapped in double quotes — so a name like Ada, A. becomes "Ada, A." under a comma delimiter and stays one cell. Second, a double quote inside a quoted field is doubled: He said "hi" becomes "He said ""hi""", which every spreadsheet app reads back as the original text. Third, rows end with CRLF line endings, the convention Excel on Windows expects; LF-only files sometimes open with every row merged or with stray characters on Windows.
Two related traps are worth knowing. Numbers and dates come through as text, which is correct: a spreadsheet that re-interprets a value can silently change it — a leading zero in a postcode or an ID like 00123 becomes 123 if the app treats the cell as a number, and a date string can be reformatted into a different calendar. If a column must stay exactly as written, format those cells as text after opening the file. And a semicolon delimiter is not a quirk: in locales where the comma is the decimal separator, Excel expects semicolons, and a comma-delimited file there opens as a single column. Pick the delimiter your spreadsheet expects, not the one you are used to.