Flatten Nested JSON to CSV
To convert nested JSON to CSV, flatten each nested object into flat columns using dot notation (e.g. address.city), and either join arrays into one cell or expand them across rows. CSV is the universal format for spreadsheets and analytics, but most APIs return nested JSON. This guide explains exactly how flattening works and how to handle arrays, deep nesting, and common edge cases.
[
{
"name": "Alice",
"city": "New York",
"score": 95,
"active": true
},
{
"name": "Bob",
"city": "Los Angeles",
"score": 87,
"active": false
},
{
"name": "Carol",
"city": "Chicago",
"score": 92,
"active": true
}
]How to Convert JSON to CSV — 3 Steps
How Nested Objects Are Flattened
CSV is a flat format — it has rows and columns but no nesting. When you convert JSON with nested objects, the converter flattens nested keys using dot notation:
{
"name": "Alice",
"address": {
"city": "NYC",
"zip": "10001"
}
}name,address.city,address.zip Alice,NYC,10001
The nested address object becomes two columns: address.city and address.zip.
How Nested Arrays Are Handled
When a field contains an array of values (e.g. "tags": ["web", "api"]), the converter joins the values into a single cell separated by semicolons:
tags web;api
For arrays of nested objects, each array element is typically expanded into separate rows or columns, depending on the structure. For complex nested arrays, it is often easier to process the JSON with a script than to flatten it automatically.
Common Use Cases for JSON to CSV Conversion
Convert JSON to CSV Now
Paste your JSON array and download a CSV in seconds — free, no sign-up.
Open JSON to CSV