Skip to content

JSON to CSV

Flatten an array of objects to a CSV with configurable nesting.

Live
Input

What this tool does

Flatten an array of JSON objects into a RFC 4180 CSV file — with configurable nested-key flatten (dot / bracket / stringify), a custom delimiter, and an optional header row. Everything runs locally; nothing is uploaded.

How to use it

Paste a JSON array of objects (or load the example), pick a delimiter and nested-key strategy (dot / bracket / stringify), and read the CSV on the right.

Input: [{"id":1,"name":"ada"},{"id":2,"name":"linus"}]

Output (CSV):

id,name
1,ada
2,linus

Limits and edge cases

  • CSV needs an array of objects (or a single object, which gets wrapped). Primitive arrays produce a one-column value table.
  • Nested objects are flattened via the chosen strategy. Arrays inside objects are JSON-stringified into a single cell — CSV can’t represent arbitrary nesting natively.
  • Output is RFC 4180 quoted: cells containing the delimiter, double-quotes, or newlines are wrapped in "…" with internal " doubled.
  • For invalid JSON input, run the JSON Repair tool first.
  • For deeper coverage of flattening strategies, see JSON to CSV: flattening nested data.

Frequently asked questions

Is my data sent to a server?
No. Every conversion runs in your browser — the page never uploads your JSON or its output.
Can I go YAML → JSON as well?
Yes — open /json/convert/yaml and toggle the 'YAML → JSON instead' option. CSV and XML are one-way for now (JSON → CSV / JSON → XML); the architecture supports reverse modes and they're on the roadmap.
How are nested objects handled in CSV?
By default nested keys are flattened with dots (e.g. user.address.city). Switch to bracket notation (user[address][city]) or 'stringify' to keep the nested value as a JSON-encoded cell. Arrays are JSON-stringified into a single cell — CSV's flat row-and-column model can't faithfully represent arbitrary nesting.
Does the XML output follow a schema?
No, it's a direct, conventional mapping: each object key becomes an element, arrays repeat the parent element, and primitive values become escaped text content. There's no attribute-vs-element heuristic — everything is an element. If you need attribute-style XML, a roadmap option is on the way.
Why does the CSV exporter complain about my input?
CSV needs an array (or single object). A bare string/number/boolean as the root has no row-and-column structure. Wrap it in an array of objects, or use the YAML / XML variant which handles arbitrary JSON.
Can the converter handle TSV, MessagePack, or TOML?
Not yet. The dispatch layer supports new targets — they're on the roadmap. Open an issue if you have a use-case.