WW Tools

JSON ↔ CSV Converter

Convert a JSON array, object, or NDJSON to CSV/TSV with documented nested-key flattening, and convert CSV back to nested, typed JSON, both directions on one screen.

CSV output appears here

About JSON ↔ CSV Converter

Paste a JSON array, an API response, or NDJSON into this JSON to CSV converter and a spreadsheet-ready file appears as you type. Flip the direction and the CSV to JSON side returns a JSON array of objects, with real types instead of strings. Converting flat data is the easy part. The trouble starts with nesting: most converters either dump a nested object into one cell as a JSON string or flatten it with a convention they never explain, so you cannot reliably reverse it. This tool documents the notation. An object key becomes a dot path like address.city, an array index becomes a bracket like items[0].sku, and a legend above the output shows exactly which headers were generated. The CSV to JSON direction reads the same notation and rebuilds the nested structure, while type inference turns 42, true, and null back into a number, a boolean, and null, with guards so codes like 007 and IDs too long for a JavaScript number stay strings. Arrays get a choice: index columns, a joined cell like red|blue, a JSON string, or one row per element. NDJSON (JSON Lines) works in both directions, which matters for log exports and data pipelines. What you paste here is often a real API response with real values in it. The conversion runs in your browser; nothing you paste leaves it.

How to convert between JSON and CSV

  1. Choose the direction with the JSON → CSV and CSV → JSON tabs, or press Swap to flip it and carry the output across.
  2. Paste your data or drop a file. JSON input can be an array, a single object, or NDJSON; CSV input can use commas, tabs, semicolons, or pipes, and the delimiter is auto-detected.
  3. For JSON → CSV, pick how arrays are handled: index columns like tags[0], a joined cell like red|blue, a JSON string, or one row per element.
  4. Pick the output delimiter. Choose Tab to produce TSV.
  5. For CSV → JSON, set the header, type inference, nested-key, and empty-cell options, and choose a JSON array or NDJSON output.
  6. Check the header legend to see how nested keys were flattened. The same dot and bracket paths convert back.
  7. If the CSV is headed for Excel, turn on the UTF-8 BOM option or use the Excel preset (semicolon plus BOM).
  8. Copy the result, copy it in another format with the Copy as buttons, or download the file.

Common Use Cases

API response to spreadsheet

Flatten a JSON API response into CSV that a PM or an analyst can open in Excel or Google Sheets, with nested fields as readable dot columns instead of JSON blobs.

Spreadsheet export to JSON fixture

Turn a CSV export into a typed JSON array for a seed script, an API import, or a test fixture. With type inference on, 42 arrives as a number and true as a boolean, not as strings.

Large exports and NDJSON logs

Convert NDJSON event exports to CSV for pivot tables. Free, with no signup and no metered quota. Inputs up to one million characters are converted locally in your browser.

Round-trip editing

Export JSON to CSV, fix values in a spreadsheet, and convert back to nested JSON with types intact, using the documented round-trip options.

Frequently Asked Questions

How do I convert JSON to CSV?

Paste or upload the JSON on the left with the JSON → CSV tab selected. The tool accepts an array, a single object, or NDJSON, flattens nested keys into documented headers, and shows the CSV as you type, so you get the file without writing a script. Copy it, copy it as TSV, or download it. The other direction works the same way and produces a JSON array of objects.

How do I convert nested JSON to CSV?

Nested objects flatten into dot paths and arrays into bracket indices, so {"address":{"city":"Tokyo"}} becomes a column named address.city and the first item's SKU becomes items[0].sku. The legend above the output lists the generated headers. Many converters instead stuff the whole nested object into one cell as a JSON string, which spreadsheets cannot do much with. The full notation, including how keys that contain dots are quoted, is written up in the JSON flattening reference linked from this page.

How are arrays handled when JSON is converted to CSV?

You choose one of four strategies. Index columns turns ["red","blue"] into tags[0] and tags[1] columns. Join with | puts red|blue in a single cell. JSON string writes ["red","blue"] into one cell as text. Expand to rows emits one row per array element and repeats the record's other fields on each row.

Can I convert CSV back to JSON without losing types?

Mostly, yes. With type inference on, 42 becomes a number, true and false become booleans, and null becomes null. Cells like 007 keep their leading zero as a string, and integers too long to be exact JavaScript numbers stay strings, so long IDs are safe. The empty-cell option decides whether an empty cell becomes an empty string, null, or no key at all; rows that contain nothing but delimiters, which spreadsheet exports often pad files with, are skipped entirely. A full round trip (index columns and a header row on the way out; inference, nested keys, and the omit policy on the way back) reproduces the original records with four documented exceptions: strings that look like typed values ("true", "42") come back typed, empty-string values are dropped by the omit policy, empty objects or arrays do not survive, and whole numbers beyond JavaScript's safe-integer range, like nanosecond timestamps or snowflake IDs, come back as strings rather than rounded numbers. The last one is the same guard that keeps long IDs from being silently corrupted: 10000000000000000 returns as the string "10000000000000000", not as an approximation. That is CSV's lossiness as a format, stated plainly.

What is NDJSON (JSON Lines) and how do I convert it to or from CSV?

NDJSON, also called JSON Lines, is one complete JSON value per line with no surrounding array. Log pipelines, bulk APIs, and data exports use it because each line can be processed on its own. On the JSON → CSV side the format is auto-detected, or you can force it with the Input option; blank lines are skipped and a bad line is reported with its line number. On the CSV → JSON side, set Output to NDJSON to get one compact record per line.

Can Excel open a JSON file?

Not directly, short of building a Power Query import. The practical route is converting the JSON to CSV here and opening that. If your data has accented or non-Latin characters, turn on the UTF-8 BOM option, or click the Excel preset to set a semicolon delimiter and the BOM together. Without the BOM, Excel tends to misread UTF-8 and shows broken characters.