How to Convert JSON to CSV
Flatten an API response into a spreadsheet — and dodge the two traps that corrupt data.
Paste your JSON array into a JSON to CSV converter and download the result. Nested objects flatten into dotted column headers like user.address.city. Two traps to know: arrays inside objects don't flatten cleanly (they duplicate rows or explode into indexed columns), and Excel destroys leading zeros on IDs and phone numbers unless you import rather than double-click.
What flattens cleanly and what doesn't
Flattens fine — nested objects. {"user": {"name": "Priya", "city": "Pune"}} becomes columns user.name and user.city. Any depth works; the headers just get longer.
Doesn't flatten — arrays inside objects. A user with 3 orders has no correct CSV representation. Converters pick one of two bad options: duplicate the user across 3 rows (bloating the file and breaking counts), or create orders.0.id, orders.1.id, orders.2.id columns (which breaks the moment a user has 4).
If your data has arrays, the honest fix is two CSVs — one for users, one for orders, joined by an ID. That's what a relational export looks like, and forcing it into one file loses information. See JSON vs XML vs CSV.
Excel will corrupt your data if you let it
This bites people constantly, and the damage is silent.
- Leading zeros vanish. Pincode
011201becomes11201. Phone09876543210becomes9876543210. - Long numbers become scientific notation. A 16-digit ID displays as
1.23457E+15— and Excel has genuinely discarded the last digits. - Things that look like dates become dates. The gene name
SEPT2famously becomes 2-Sep. Product codes suffer the same fate.
The fix is always the same: Data → From Text/CSV, then set the affected columns to Text before loading. Never double-click a CSV containing IDs. Or skip CSV entirely and use JSON to Excel, which writes typed cells directly.
Tools used in this guide
Frequently asked questions
How do I convert JSON to CSV?
Paste a JSON array of objects into a JSON to CSV converter and download the result. Nested objects flatten into dotted headers like user.address.city. The source must be an array of records — a single object or a deeply nested structure needs reshaping first, since CSV is fundamentally a flat grid.
Why does Excel remove leading zeros from my CSV?
Because double-clicking a CSV lets Excel guess each column's type, and it reads 011201 as the number 11201. Long IDs also become scientific notation with digits genuinely lost, and codes like SEPT2 turn into dates. Always use Data → From Text/CSV and set those columns to Text before loading, or use JSON to Excel to skip the problem.
How do nested JSON objects convert to CSV?
They flatten into dotted column names: {"user": {"name": "Priya"}} becomes a user.name column. Any nesting depth works. Arrays are the real limitation — a record containing a list has no clean CSV form, so converters either duplicate rows or create indexed columns like orders.0.id. For data with arrays, export two related CSVs joined by an ID instead.
Is it safe to convert JSON to CSV online?
Only with a client-side converter. The JSON you're most likely to convert — an API export, a webhook payload, a user list — often contains personal data or tokens, and a server-side tool receives all of it. SnoopTool's converter runs in your browser and transmits nothing; you can confirm by going offline after the page loads and converting anyway.
Need a tool we don't have yet?
Tell us what you're trying to do. We build the most-requested tools first — every SnoopTool utility is free, runs in your browser, and needs no sign-up.