Guide
How to Convert JSON to CSV (and Back)
JSON is how apps store and send data; CSV is what spreadsheets understand. Converting between them is one of the most common data chores there is. The good news: if your JSON is an array of objects with the same fields, the conversion is mechanical — fields become columns, objects become rows.
What valid input looks like
For JSON-to-CSV you need an array of objects, like [{"name":"Ada","age":36},{"name":"Grace","age":85}]. Every key in the objects becomes a column header, and every object becomes one row.
If your JSON is a single object or a deeply nested structure, flatten it first — CSV has no way to represent objects inside objects.
How commas and quotes survive the trip
CSV uses commas to separate columns, so a value that contains a comma — like "Smith, John" — would break the layout. The fix is quoting: any value containing a comma, quote, or line break is wrapped in double quotes, and quotes inside the value are doubled.
A proper converter handles this automatically. If you ever build CSV by hand with string joining, this is the bug that will bite you.
Converting CSV back to JSON
The reverse direction reads the first row as field names and turns each following row into an object. One thing to know: everything in CSV is text, so numbers and true/false values come back as strings unless you convert them yourself.
Also watch for a stray empty line at the end of the file — some tools turn it into an empty row.
Common mistakes to avoid
A few traps cause most conversion failures:
- JSON with trailing commas or single quotes — it must be strict JSON
- Objects with different keys — missing fields become empty cells
- Nested arrays or objects — flatten them first
- Opening CSV in Excel and saving it, which can mangle dates and long numbers
Convert your data
Paste your JSON array into the JSON ↔ CSV Converter and press JSON → CSV, or paste CSV and press CSV → JSON. The result replaces the input so you can keep converting, and any problem shows a clear error message. Your data never leaves your browser.
Try it yourself
Put this guide into practice with our free JSON ↔ CSV Converter — no sign-up, no download.
Open the JSON ↔ CSV Converter