How to Convert JSON to CSV — Flatten Complex Data for Spreadsheets

You've got JSON data from an API, a database export, or a web application. It's full of nested objects, arrays, and complex structures that make perfect sense in code — but you need to analyze it in Excel. That means converting it to CSV.
The challenge is that JSON is hierarchical and CSV is flat. You're essentially taking a tree and pressing it into a table. Here's how to do it well.
The Core Challenge
JSON can represent complex structures:
{
"users": [
{
"name": "Sarah",
"contacts": {
"email": "sarah@email.com",
"phone": "+1234567890"
},
"tags": ["admin", "editor"]
}
]
}CSV needs flat rows:
name,contacts.email,contacts.phone,tags.0,tags.1
Sarah,sarah@email.com,+1234567890,admin,editorThe conversion tool has to "flatten" the nested structure into columns.
Quick Conversion
On ZipDownloader.com:
Open the JSON to CSV tool
Upload your JSON file
Click Convert
Open the CSV in Excel
How Flattening Works
Nested Objects
Nested JSON objects become dot-notation columns:
{"user": {"name": "Sarah"}} → column "user.name"
Arrays
Arrays are typically indexed:
{"tags": ["a", "b"]} → columns "tags.0" and "tags.1"
Or in some tools, joined with a delimiter:
{"tags": ["a", "b"]} → column "tags" with value "a;b"
Deeply Nested Data
Each level of nesting adds another dot to the column name:
{"a": {"b": {"c": "value"}}} → column "a.b.c"
This can create very long column headers for deeply nested data.
Handling Common JSON Patterns
Array of Objects (Most Common)
This is the typical API response format and converts most cleanly:
[
{"id": 1, "name": "Sarah", "city": "London"},
{"id": 2, "name": "James", "city": "Sydney"}
]Each object becomes a row. Keys become column headers. Clean and straightforward.
Inconsistent Objects
Real-world JSON often has objects with different keys:
[
{"id": 1, "name": "Sarah", "phone": "123"},
{"id": 2, "name": "James", "email": "j@mail.com"}
]The CSV will have columns for all possible keys, with empty cells where data is missing:
id,name,phone,email
1,Sarah,123,
2,James,,j@mail.comSingle Object
If your JSON is a single object (not an array), the conversion typically creates a one-row CSV.
Post-Conversion Cleanup
After converting, you'll often need to:
Rename columns — "user.contacts.primaryEmail" is accurate but unwieldy. Rename to "Email" for readability.
Fix data types — Excel might interpret dates, phone numbers, or IDs incorrectly. Format columns appropriately.
Remove unnecessary columns — The flattening process might create columns you don't need. Delete them.
Handle arrays — If arrays were expanded into numbered columns (tags.0, tags.1, tags.2), decide if you want to keep them separate or combine them.
Best Practices
Simplify the JSON first. If you only need certain fields, extract them before converting. Less data = cleaner CSV.
Check for large arrays. If one record has 100 array items and another has 2, the CSV will have 100 columns for that array. Consider preprocessing.
Validate the CSV. Open it in Excel and spot-check a few records against the original JSON.
Watch for special characters. Commas, newlines, and quotes in JSON values can break CSV structure. Good converters handle this with proper quoting.
Consider the size. JSON-to-CSV conversion typically produces smaller files (CSV is less verbose), but very wide tables (many columns) can be hard to work with in Excel.
Our editorial team is made up of file conversion and digital productivity specialists who have hands-on experience with the tools and workflows covered in our guides. Every article is researched, tested, and written to provide accurate, actionable information that helps you work more efficiently. Learn more about us →
Ready to try it yourself?
Use our professional tools to process your files safely and instantly in your browser.


