JSON and CSV in one minute
Picture a list of users. In JSON each user is an object, and objects can hold other objects, arrays and mixed types, so Alice can have two roles while Bob has one. In CSV (comma-separated values) everything is a flat grid: one row per user, one column per field, just like a spreadsheet.
[
{ "name": "Alice", "age": 30, "roles": ["admin", "editor"] },
{ "name": "Bob", "age": 25, "roles": ["viewer"] }
]name,age,roles
Alice,30,"[""admin"",""editor""]"
Bob,25,"[""viewer""]"APIs and web apps love JSON because it can describe anything. Spreadsheets, databases and pandas love CSV because it is a simple table. Converting is mostly about deciding what to do with the bits that don't fit in a grid.
When to convert JSON to CSV
To analyze data in a spreadsheet
You can't double-click a JSON file and get a tidy sheet in Excel or Google Sheets. Convert it to CSV first and you can sort, filter and chart it like any other data.
To import into a database
MySQL, PostgreSQL and SQLite can all bulk-import CSV out of the box, so a quick conversion can save you from writing a one-off import script.
To share with people who do not read JSON
Your product manager probably doesn't want to read curly braces. Hand them a spreadsheet and they can explore the data on their own.
How to use the JSON to CSV converter
- Open the JSON to CSV converter and paste a JSON array of objects, for example the list above. A single object is not accepted, so wrap it in
[ ]first. - Select Convert. Each object becomes a row, and the header row lists every key found in any of the objects.
- Download the result as a
.csvfile or Copy it to the clipboard.
Everything runs in your browser, so the data you paste never leaves your machine. Handy when it's a customer export you would rather not upload anywhere.
How nested data is handled
This is where conversions get interesting. CSV has no idea what nesting is, so anything that isn't a plain value has to squeeze into a single cell. The converter follows three rules:
- Missing keys become empty cells. If only some objects have an
emailkey, the others get a blank in that column. - Nested objects and arrays are written as JSON text inside the cell, so no information is lost.
- Quotes, commas and line breaks are escaped the standard way, by wrapping the cell in double quotes and doubling any quote inside it.
[{ "name": "Alice", "address": { "city": "NYC" }, "tags": ["admin"] }]name,address,tags
Alice,"{""city"":""NYC""}","[""admin""]"If you would rather have separate address.city columns, flatten the objects before converting, for example with pandas’ json_normalize or a few lines of JavaScript.
CSV good habits
- Save files as UTF-8 so names and symbols from any language survive.
- Write dates as ISO 8601 (
2026-02-07) so nobody confuses month-first and day-first formats. - Keep an eye on Excel. It loves turning long IDs and phone numbers into scientific notation (
1.23E+15is nobody’s phone number). Import those columns as text to keep them exact. - Be careful with cells that start with
=,+,-or@, which spreadsheets may run as formulas. The converter adds a leading'to such values to keep them as plain text.
Using the CSV file
The downloaded file opens in Excel, Google Sheets and LibreOffice Calc, and imports into any database. In code, use Python’s built-in csv module, papaparse in JavaScript or Ruby’s CSV class.
