DataSwap Fast file & data format converters, no signup

JSON to CSV Converter

Paste a JSON array of objects below. Keys are unioned across every object for the header row, missing keys become empty cells, and output fields are quoted only when they actually need it. Nothing you paste ever leaves your browser.

Quoting only when it's actually needed

Writing CSV correctly is the mirror image of parsing it: a field only needs to be wrapped in double quotes if its text would otherwise be misread — because it contains the delimiter, a double quote, or a newline. This tool checks every field individually and quotes exactly the ones that need it, doubling any literal " inside a quoted field (" becomes "") so it can never be mistaken for the closing quote. Skipping unnecessary quotes keeps the output readable; never skipping a necessary one keeps it correct.

Worked example

Input:

[
  {"name": "Smith, John", "note": "has \"quotes\""},
  {"name": "Lee"}
]

The first object's name contains a comma and its note contains literal double quotes; the second object has no note key at all. This tool produces:

name,note
"Smith, John","has ""quotes"""
Lee,

name and note both had to be quoted for row one because of the embedded comma and quotes, the doubled "" preserves the literal quote marks, and Lee's missing note is simply an empty cell rather than a crash or a missing row. Paste this exact output into the CSV to JSON converter and you get the original two objects back.

Frequently asked questions

What if my objects don't all have the same keys?

That's expected and handled: the header row is the UNION of every key that appears anywhere in the array, in first-seen order. Any object missing a given key just gets an empty cell in that column instead of causing an error — nothing crashes, and no data from other objects is lost.

How are nested objects and arrays handled?

Nested objects are flattened into dot-notation columns — {"user":{"name":"Ada"}} becomes a column literally named user.name. Arrays are kept as a single cell containing their JSON text (e.g. ["dev","ops"]), since a list doesn't have an obvious column-per-item mapping. This keeps every value visible in the CSV rather than silently dropping anything.

Why are some of my output fields wrapped in quotes and others aren't?

A field only gets wrapped in double quotes when it actually needs it: when its text contains the delimiter you selected, a double quote, or a newline. Any literal double quote inside the field is doubled (" becomes "") so it can't be confused with the closing quote. Plain values like Boston are left bare — this keeps the output readable while staying unambiguous for anything that parses it back.

Will this round-trip back to the same JSON?

Yes — paste the CSV this tool produces into the CSV to JSON converter with the same delimiter selected, and you get back the original data (nested paths become dotted keys rather than reconstructed nested objects, since that reversal is ambiguous in general, but no values are lost). We test exactly this round-trip on every release.