JSON to CSV Converter: Nested Data to Clean Rows, Both Ways
Paste JSON to get CSV, or paste CSV to get JSON. The AI handles nested objects, arrays, inconsistent fields, and malformed data. Free, no account required.
Converting Big API Exports?
Pro raises the input ceiling, so deeply nested payloads and long record sets convert in one shot.
JSON to CSV and CSV to JSON - Bidirectional Conversion
Data conversion is a routine but surprisingly annoying task. Nested JSON objects don't map cleanly to flat CSV rows. Missing fields in some records create inconsistent column counts. CSV quoting rules for fields containing commas or line breaks trip up basic converters. The AI handles all of this correctly and explains what decisions it made so you can adjust the output if needed.
Nested JSON is flattened with dot notation - address.city becomes a column header. RFC 4180 quoting rules are applied correctly for fields that contain commas or newlines. For querying the data once it's loaded into a database, our Text to SQL Generator writes the queries. For JSON parse errors before conversion, our Error Explainer diagnoses the issue. For jq and csvkit commands on the command line, see our Bash Command Generator.
Conversion Directions
How JSON Shapes Map to CSV: The Five Rules
JSON is a tree; CSV is a grid. Every converter, including this one, has to make the same five structural decisions to bridge that gap. Knowing them lets you predict the output before you convert.
| Situation | How it converts |
|---|---|
| Nested objects | Flattened with dot notation: {"address": {"city": "Oslo"}} becomes a column named address.city holding Oslo. |
| Arrays of primitives | Joined into one cell with a delimiter: "tags": ["a","b"] becomes a; b. The row count is preserved. |
| Arrays of objects | Either exploded into one row per array element (parent fields repeated) or serialised as a JSON string in a single cell. Row explosion changes your row count, so say which you want. |
| Nulls vs empty strings | CSV cannot distinguish them: both serialise to an empty cell. Converting back to JSON, empty cells become null by default. If the difference matters downstream, keep the data in JSON. |
| Mixed types in a column | A field that is a number in one record and a string in another forces the whole CSV column to text. Spreadsheets will no longer sum it until the values are normalised. |
Header ordering follows the first record's key order, with keys that appear only in later records appended at the end. If you need a fixed column order for an importer, list the desired headers in your request and the converter will match them.
Before and After: Nested JSON to Flat CSV
Here is a small worked example showing all the rules above acting at once: dot-notation flattening, array joining, and missing fields becoming empty cells.
// Input JSON
[
{"id": 1, "name": "Alice", "address": {"city": "London", "zip": "E1 6AN"}, "tags": ["vip", "beta"]},
{"id": 2, "name": "Bob", "address": {"city": "Paris"}, "tags": []}
]
// Output CSV
id,name,address.city,address.zip,tags
1,Alice,London,E1 6AN,"vip; beta"
2,Bob,Paris,,
Note how Bob's missing address.zip becomes an empty cell and his empty tags array stays blank, while Alice's tags are joined and quoted because the joined value contains the delimiter's companion space.
Common Conversion Scenarios
The most frequent data conversion tasks developers and analysts face every day.
Convert JSON from a REST API response into a CSV you can open in Excel or Google Sheets for analysis or reporting.
Convert a CSV export from a spreadsheet into a JSON configuration file or seed data for your application.
Export from one system as JSON, convert to CSV for import into another system with a different data format requirement.
Convert a small CSV of test cases into a JSON array for use in unit tests, or generate CSV fixtures from a JSON schema.