Back Professions
Back Dating
Back Writing Tools
Back Programming Tools
Back AI Chat
Back AI Image
Back AI Video

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.

Open JSON/CSV Converter chat →

Converting Big API Exports?

Pro raises the input ceiling, so deeply nested payloads and long record sets convert in one shot.

See Pro Plans →

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

JSON Array → CSV CSV → JSON Array Nested JSON Flatten Missing Field Handling RFC 4180 CSV Tab-Separated Values JSON Object → CSV Row Type Inference

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.

API Response to Spreadsheet

Convert JSON from a REST API response into a CSV you can open in Excel or Google Sheets for analysis or reporting.

CSV Import to JSON Config

Convert a CSV export from a spreadsheet into a JSON configuration file or seed data for your application.

Data Migration Between Systems

Export from one system as JSON, convert to CSV for import into another system with a different data format requirement.

Test Data Generation

Convert a small CSV of test cases into a JSON array for use in unit tests, or generate CSV fixtures from a JSON schema.

Frequently Asked Questions

Arrays of primitives are joined with a delimiter in the CSV column. Arrays of objects get separate rows or a nested JSON string, depending on your preference - just specify which approach you want.
Yes. The converter follows RFC 4180: fields containing commas, double quotes, or line breaks are enclosed in double quotes. Double quotes within fields are escaped as two double quotes.
Yes. Ask for TSV output and the converter uses tab delimiters instead of commas. Useful for data that frequently contains commas such as addresses or descriptions.
The AI identifies the specific syntax error in your JSON - missing bracket, trailing comma, unquoted key - and describes what needs to be fixed before conversion.