JSON arrays map naturally to spreadsheet rows: each object in the array becomes a row, and each key becomes a column header. The conversion is straightforward for flat arrays, but requires decisions about nested objects and arrays. This guide covers how the mapping works, what to do with nested data, and how to get the cleanest CSV output for Excel or Google Sheets.
How JSON-to-CSV mapping works
The converter expects a JSON array of objects at the top level — the most common shape of API list responses and database exports. Each object contributes one row. Keys across all objects are unioned to form the complete set of column headers. If an object is missing a key that others have, its cell in that column is left empty.
// Input JSON
[
{ "id": 1, "name": "Alice", "role": "admin" },
{ "id": 2, "name": "Bob" }
]
// Output CSV
id,name,role
1,Alice,admin
2,Bob,Handling nested objects
When an object value is itself an object, the converter flattens it using dot notation for keys:
// Input
{ "user": { "id": 1, "name": "Alice" }, "score": 98 }
// Flattened CSV columns
user.id, user.name, scoreFor arrays nested within objects (e.g. a tags array), the values are joined as a semicolon-separated string within a single cell. This is the most practical approach for spreadsheet consumption, since a cell cannot contain multiple rows.
Delimiter options
The default CSV delimiter is a comma (,). However, if your string values contain commas (addresses, descriptions, prose text), you should use a different delimiter — semicolon (;) or tab (\t) — to avoid quoting every field. The converter lets you select the delimiter before downloading.
Opening CSV in Excel and Google Sheets
Excel: Double-clicking a .csv file opens it with Excel's default settings. If your data contains non-ASCII characters (Arabic, Chinese, etc.), use Data → From Text/CSV and select UTF-8 encoding explicitly to avoid garbled text.
Google Sheets: File → Import → Upload the CSV file. Select "Comma" as the separator type. Google Sheets handles UTF-8 correctly by default.
Converting CSV back to JSON
CSV-to-JSON conversion is the reverse: each row becomes an object, column headers become keys, and all values come back as strings (you need to parse numbers and booleans manually). For round-tripping data, prefer JSON or YAML exports over CSV when possible. Use CSV only as a final output format for human consumption in spreadsheets.
Convert any JSON array to a clean CSV file — download for Excel or Google Sheets:
Convert JSON to CSV →