ZeroFee Tools

Home › Blog › Free JSON to CSV Converter Online

JSON to CSV converter guide cover illustration

JSON to CSV Guide: Flatten Nested Data for Spreadsheets

APIs hand you JSON, but your accountant, your marketer, and your spreadsheet all want CSV. Turning a JSON array of objects into a spreadsheet is not just joining values with commas: nested objects need flattening, commas inside values need quoting, and rows with different shapes need to stay aligned. Get any of that wrong and Excel shows you scrambled data.

The ZeroFee Tools JSON to CSV converter handles all of it: nested objects are flattened with dot-notation keys like address.city, values with commas or quotes are escaped per standard CSV rules, and arrays are preserved as compact JSON strings. Paste your JSON, press Convert, then copy the result or download it as a .csv file for Excel or Google Sheets. The reverse trip lives in the CSV to JSON converter, and oversized payloads shrink first with the JSON minifier.

How do I convert JSON to CSV online?

Paste a JSON array of objects and press Convert. Each object becomes one CSV row, keys become the header row, and nested objects are flattened with dot notation. Press Copy output or Download .csv to use the result in Excel or Google Sheets. If your JSON is a single object instead of an array, the tool wraps it automatically.

Paste a JSON array of objects and press Convert. Each object becomes one CSV row, keys become the header row, and nested objects are flattened with dot notation. Press Copy output or Download .csv to use the result in Excel or Google Sheets. If your JSON is a single object instead of an array, the tool wraps it automatically so you still get a valid one-row table.

Key collection is smarter than it looks. Real API responses are ragged: the first object has an email, the second does not, the third has an extra field. The tool gathers keys across all rows in first-seen order, so rows with different shapes still align under one header row. Missing values become empty cells rather than shifting columns out of place, which is exactly how a human would lay the table out by hand.

Before converting a huge payload, sanity-check it. Invalid JSON produces a clear error instead of a mangled file, but it is worth validating first with the CSV to JSON reverse tool's discipline in mind: garbage in, garbage out applies to both directions. And if you want to eyeball the finished spreadsheet before sending it to someone, open the download in the CSV table viewer, which renders it as a sortable, searchable table in the browser.

How are nested objects handled in the CSV?

Nested objects are flattened: {"address":{"city":"London"}} becomes a column named address.city. This keeps every value in its own column without inventing a custom format. Keys are collected across all rows in first-seen order, so rows with different shapes still align: missing values become empty cells rather than shifting columns out of place.

Nested objects are flattened: {"address":{"city":"London"}} becomes a column named address.city. Deeper nesting keeps extending the chain, so company.address.zip is one column with a self-describing name. This keeps every value in its own column without inventing a custom format that Excel cannot read.

Why dot notation instead of something fancier? Because it is unambiguous, sortable, and reversible: anyone reading the header address.city knows exactly where the value came from in the original JSON. Alternatives like dumping the nested object as raw JSON inside a cell are harder to sort and filter in a spreadsheet, which defeats the purpose of converting in the first place.

One trade-off to know: deeply nested data produces wide tables. An API response nested four levels deep can yield dozens of columns, which is fine for analysis but noisy for sharing. When the full flattening is too much, consider converting a filtered subset: paste only the fields you need into a smaller array first, or use the JSON minifier to slim the payload before conversion. The converter preserves everything it is given, so controlling the input is how you control the width of the output.

What happens to arrays inside values?

Arrays are serialized as compact JSON strings inside their cell, so ["x","y"] stays intact and readable instead of being split across columns. This preserves the structure in a form any JSON-aware consumer can reverse, and standard CSV quoting keeps the embedded commas from breaking the row layout.

Arrays inside values are preserved as compact JSON strings. A field like ["x","y"] lands in its cell as ["x","y"], properly quoted so the commas inside do not split the row. The data stays intact and readable, and anyone who needs the individual values can parse that cell back into an array later.

This is a deliberate design decision, and the alternative would be worse. Expanding an array into numbered columns (tags.0, tags.1, tags.2) produces ragged tables where the column count depends on the longest array in the dataset, and re-importing that layout back to JSON requires custom logic. Keeping the array as one cell preserves the structure in a form that any JSON-aware consumer can reverse.

Quoting works hand in hand with this. Any value containing a comma, quote, or line break is wrapped in double quotes, with inner quotes doubled, exactly per standard CSV rules. That is why the JSON-string arrays open correctly in Excel and Google Sheets instead of splitting into extra columns. If your arrays contain very long lists and the cells feel unwieldy, the practical fix is the same as for deep nesting: trim the input to the fields you actually need before converting.

How to use the JSON to CSV converter in 4 steps

  1. Paste your JSON. Drop in an array of objects, or a single object; the tool wraps it automatically.
  2. Press Convert. Nested objects flatten to dot-notation columns and values are quoted correctly.
  3. Check the layout. Verify the header row and spot-check a few rows for alignment.
  4. Copy or download. Use Copy output for quick pasting or Download .csv for Excel and Google Sheets.

5 practical tips for JSON to CSV conversion

Frequently asked questions

Is this JSON to CSV converter free?

Yes. Convert unlimited JSON with no account and no limits. It runs entirely in your browser, so even large payloads stay on your own machine and never upload anywhere at all.

What JSON format does it accept?

An array of objects is ideal. A single object is wrapped into a one-row table automatically. Anything else, like a bare string or number, produces a clear error message instead.

How are commas inside values handled?

Any value containing a comma, quote, or line break is wrapped in double quotes, with inner quotes doubled, per standard CSV rules. Excel and Google Sheets open the result correctly.

What happens to nested arrays?

Arrays are serialized as compact JSON strings inside their cell, so ["x","y"] stays intact and readable instead of being split across columns. The data remains fully reversible for JSON-aware consumers.

Is my JSON uploaded anywhere?

No. Conversion happens locally in your browser. Your data never leaves your device, which makes the tool safe for exports containing customer records or sensitive business data of any kind.

Ready to try it yourself? It's free, no signup required.

Try the free JSON to CSV Converter →