All Tools View Categories Blog About Contact Privacy

How to Convert JSON to CSV Online (Step-by-Step)

How to Convert JSON to CSV Online (Step-by-Step)

APIs return JSON — nested objects and arrays with typed values — but spreadsheets, data analysis, and bulk imports need CSV — flat rows and columns with headers. Converting JSON to CSV means turning an array of objects into a header row plus data rows, flattening nested fields, and choosing a delimiter that Excel will open correctly. A JSON to CSV converter that handles nested objects, arrays, and large files with a preview does the mapping without writing jq or Python.

This step-by-step guide shows how to convert JSON to CSV online — the JSON vs CSV mapping, how to handle nested objects and arrays, delimiter and header options, and the common errors that break the CSV — with references to RFC 8259 (JSON), RFC 4180 (CSV), and MDN: JSON.

TL;DR — Quick Answer: Paste a JSON array of objects (e.g., [{"name":"Anna","age":28}]) into a JSON to CSV converter, choose the delimiter (comma for US, semicolon for EU Excel), decide how to handle nested objects (flatten to address.city or keep as JSON string), and copy the header + rows. The converter handles quoting and large files browser-side with no install.
JSON to CSV converter - convert JSON array to spreadsheet step-by-step

JSON vs CSV — Structure and Mapping

JSON is hierarchical and typed; CSV is flat and textual. The conversion maps the JSON structure to a table:

JSON vs CSV structure and mapping - array of objects to header and rows
AspectJSONCSV
StructureArray of objects, nested, typed (number, boolean, null, array)Header row + flat rows, all strings
HeadersKeys per object (may vary per object)Union of all keys → header row
Nesting{"address":{"city":"Berlin"}}Flatten to address.city or stringify
Best forAPIs, configs, NoSQLSpreadsheets, imports, Excel/Sheets

Mapping: Each object becomes a row, each key becomes a header. For [{"name":"Anna","age":28,"address":{"city":"Berlin"}}], headers are name,age,address.city (flattened) or name,age,address with "{\"city\":\"Berlin\"}" as a JSON string in one cell. Unmatched keys across objects (e.g., one has email, another doesn't) become empty cells in that column.

How to Convert JSON to CSV Online — 3 Steps

How to convert JSON to CSV in 3 steps - paste, choose options and copy
  1. Paste JSON: A JSON array of objects ([{"name":"Anna","age":28},...]), NDJSON (one JSON per line), or a single object. The converter validates per RFC 8259 — strict double quotes, no trailing commas — and flags the exact line if invalid.
  2. Choose options:
    • Delimiter: Comma (,) for US/UK Excel and most tools; semicolon (;) for EU Excel where comma is the decimal separator; Tab for TSV; pipe (|) for logs.
    • Nested handling: Flatten → dotted keys (address.city, address.zip) for spreadsheet readability; Stringify → nested value as a JSON string in one cell ("{\"city\":\"Berlin\"}") for fidelity and re-import.
    • Headers: Auto from the union of all keys, in order of first appearance, or custom order. Unmatched keys produce empty cells.
  3. Copy CSV: The header plus rows, with quoting per RFC 4180 — fields containing the delimiter, quotes, or line breaks are quoted, and inner quotes are doubled ("He said ""hi"""). The preview shows the first rows before downloading, so quoting and headers can be verified.

Handling Nested Objects and Arrays — Options Compared

Handling nested JSON objects and arrays - flatten vs stringify

Example input:

[{"name":"Anna","address":{"city":"Berlin","zip":"10115"},"tags":["vip","eu"]}]
StrategyHeaderRowWhen to Use
Flattenname,address.city,address.zip,tags.0,tags.1Anna,Berlin,10115,vip,euExcel/Sheets analysis
Stringifyname,address,tagsAnna,"{\"city\":\"Berlin\"}","[""vip"",""eu""]"Preserve for re-import

Flatten is readable in spreadsheets; stringify preserves the original structure for programs that will parse the CSV back to JSON. The choice depends on whether the CSV is for human analysis or round-trip fidelity. Arrays as tags.0, tags.1 is one flatten style; another is joining as "vip;eu" — the converter offers the former for columnar analysis.

Common Errors and How to Fix Them

Common JSON to CSV errors and fixes - trailing comma, single quotes and nested
  • "Unexpected token" or trailing comma: JSON forbids trailing commas — {"a": 1,} → remove the comma before } or ]. The validator pinpoints the line.
  • Single quotes: JSON requires double quotes — {'name': 'Anna'}{"name": "Anna"}.
  • [object Object] in CSV: Nested object was not flattened or stringified — choose Flatten (dotted keys) instead of the default that calls toString().
  • Uneven keys: Objects have different keys → missing cells are empty. Check the header union and provide a default if needed.
  • Delimiter in data not quoted: Per RFC 4180, fields with the delimiter, quotes, or line breaks must be quoted — e.g., "a,b" for a value containing a comma. The converter handles this; manual CSV often forgets.
  • EU Excel shows one column: Delimiter mismatch — EU Excel expects semicolon (;) where US expects comma. Switch the delimiter to ; and re-download.

Delimiter and Header Options — When to Choose Which

  • Comma (,): Default for US/UK and most imports — choose for generic CSV.
  • Semicolon (;): For EU Excel where comma is the decimal separator — e.g., 1,5 in EU is 1.5 in US.
  • Tab: For TSV or data containing many commas.
  • Headers: Auto from keys is correct for most cases; custom order is useful when the downstream importer expects a specific column sequence.

FAQs About Converting JSON to CSV

How do I convert JSON to CSV without code?

Paste a JSON array of objects into a JSON to CSV converter, choose the delimiter and nested handling (flatten or stringify), and copy the header plus rows. No install or jq needed.

How do I handle nested JSON when converting to CSV?

Flatten to dotted keys (address.city) for spreadsheet readability, or stringify the nested value into one cell as a JSON string to preserve structure for re-import. The converter offers both.

Why does my CSV show [object Object]?

The nested object was not flattened — the converter called toString(). Select Flatten (a.b) instead of the default to create proper columns.

What delimiter should I use for Excel?

Comma for US/UK Excel, semicolon for EU Excel where comma is the decimal separator. If the CSV opens in one column, the delimiter is wrong.

Can I convert large JSON files to CSV?

Yes — the tool handles 100k+ rows with chunked parsing browser-side. For multi-megabyte files, use a streaming converter or jq locally: jq -r '(.[0]|keys_unsorted) as $k | $k, (.[]|[.[$k[]]]) | @csv'

Is the conversion private?

When it runs entirely in the browser, the JSON never leaves the device or touches a server — unlike server-side converters. This is preferable for sensitive data.

Conclusion

Converting JSON to CSV is header mapping plus nested handling plus delimiter choice — the header from the union of keys, nested as dotted columns or JSON strings, and the delimiter that matches the spreadsheet's locale. With the right options, the same JSON becomes a spreadsheet-ready CSV or a losslessly stringified one, and the preview confirms quoting before downloading.

Paste the next JSON array, choose delimiter and nested handling, and copy a CSV that opens correctly in Excel or Sheets on the first try.