Tools
Guides

JSON to CSV Converter

JSON

Flatten an array of JSON objects into CSV with RFC 4180 quoting. Download the result as a file.

100% client-side No backend
Input
Output
On this page

What is a JSON to CSV converter?#

A JSON to CSV converter takes a JSON array of objects — the shape most APIs and databases emit when they return rows — and writes it out as CSV text, comma-separated values. Each object becomes a line, each top-level key becomes a column, and the first line holds the field names. The result is plain text that spreadsheets, data tools, and databases import directly.

CSV looks trivial until you have to produce it correctly. The format that actually works everywhere is RFC 4180: fields containing a comma, a double quote, or a line break must be wrapped in double quotes, and any double quote already inside the field must be doubled up (""). Lines are separated by CRLF, not a bare newline. Get any of that wrong and a name like Smith, John or a value like He said "hi" silently corrupts the columns downstream — the spreadsheet sees an extra column or truncates a field.

This converter handles all of that for you, and also copes with the awkward fact that JSON is hierarchical and CSV is flat: nested objects are flattened into dot-notation columns (address.city), and array or object fields that cannot be flattened are serialised as JSON text inside their cell. You also pick the delimiter — comma, semicolon, tab, or pipe — because “CSV” means different things in different locales.

How to use it#

  1. Paste a JSON array of objects into the Input pane on the left. A lone object, or an object wrapping the rows under a single key like {"data": [...]}, is also accepted.
  2. Choose the Delimiter — , (default), ;, Tab, or |. Semicolon is what many European locales expect from Excel; tab gives TSV.
  3. Tick Flatten nested (on by default) to expand nested objects into dot-notation columns. Untick it to keep nested objects as JSON text in a single cell.
  4. The CSV appears live in the Output pane, with quoting applied wherever a field needs it. The status line reports the row count.
  5. Click Download to save data.csv, or Copy to take the text to the clipboard.
  6. Sample loads a small two-row dataset; Clear resets both panes.

Key features#

  • RFC 4180 quoting. Fields are wrapped and inner quotes are doubled exactly when the spec requires, so commas, quotes, and line breaks inside values never break the column structure.
  • CRLF line endings. Output uses Windows-style line breaks, which maximises compatibility with Excel and other spreadsheet software across platforms.
  • Choice of delimiter. Comma, semicolon, tab, or pipe — pick whichever your downstream tool expects, and quoting adapts to the chosen delimiter.
  • Dot-notation flattening. Nested objects expand into named columns so their inner fields can stand alone; arrays and stubborn objects become JSON text cells instead of being dropped.
  • Stable columns on uneven rows. The header is the union of every row’s keys in first-seen order, so rows with extra or missing fields still line up correctly.

Worked example#

Load Sample and the input is a two-row array:

[
  { "name": "Ada Lovelace", "role": "Engineer", "skills": ["math", "logic"] },
  { "name": "Bob",          "role": "PM",       "skills": ["docs"] }
]

With the delimiter set to , and Flatten nested on, the columns are name, role, skills. The skills field is an array, so it is serialised to JSON text; because that text contains commas and double quotes, it is quoted and its inner quotes are doubled:

name,role,skills
Ada Lovelace,Engineer,"[""math"",""logic""]"
Bob,PM,"[""docs""]"

Notice two things the converter did silently and correctly. Ada Lovelace is not quoted, because it contains only a space — no delimiter, no quote, no newline — so wrapping it would be pointless. And the skills cell for Ada is quoted with doubled inner quotes, because it contains both commas and " characters that would otherwise corrupt the row.

Switch the Delimiter to ; and the commas inside the skills cell no longer clash with the separator, but the field is still quoted because of the embedded double quotes — the converter quotes whenever any RFC 4180 trigger is present, not just the delimiter.

FAQ#

Why are the double quotes in my data doubled to ""?#

That is the RFC 4180 rule for embedding a literal double quote inside a quoted field: write it twice. A value like He said "hi" becomes "He said ""hi""" in the CSV — outer quotes wrap the field (because it contains a "), and each inner " is doubled so the parser knows it is data, not the end of the field. Tools that read CSV correctly will restore the original single quotes on import.

My field contains a comma. Will it break the columns?#

No. Any field that contains the delimiter, a double quote, a carriage return, or a newline is automatically wrapped in double quotes, so a value like Smith, John becomes "Smith, John" and stays in one column. You do not have to escape anything by hand.

Why would I pick semicolon or tab instead of comma?#

Locale. Excel on many European locales uses ; as the default list separator, so a comma-separated file opens with everything jammed into one column until you re-import it. Tab-separated (TSV) is the safest when your data might contain both commas and semicolons — tabs essentially never appear in real values. Pick whichever your downstream tool expects.

What happens to a nested object or an array field?#

With Flatten nested on, a nested object expands into dot-notation columns (address.city, address.zip), so each inner value gets its own column. An array field cannot be flattened into columns losslessly, so it is serialised as JSON text inside its cell — for example ["math","logic"]. Nothing is dropped; if you would rather have each array element on its own row, restructure the JSON first.