JSON ↔ CSV Converter

Flatten an array of JSON objects into CSV with correct quoting, or turn CSV back into structured JSON. Nested fields are flattened automatically.

Input
Output

Quoting is where most converters fail

CSV looks trivial until a value contains the delimiter. A field holding Smith, John written unquoted becomes two columns, and every row after it shifts. The RFC 4180 rule is simple but frequently ignored:

  • Wrap the field in double quotes if it contains the delimiter, a double quote, a carriage return or a line feed.
  • Escape a double quote inside a quoted field by doubling it: "".
  • Leave leading and trailing spaces alone — they are data in CSV, unlike in most formats.
ValueCorrect CSV fieldWrong
Smith, John"Smith, John"Smith, John
He said "hi""He said ""hi""""He said "hi""
line1
line2
"line1
line2"
line1
line2
0070077 — a spreadsheet silently drops the leading zeros

Flattening nested objects

CSV is a flat table, so a nested object has to be projected onto columns. This tool uses dot paths, which is the convention most data tools understand:

{"user":{"name":"Ada","address":{"city":"London"}}} becomes user.name and user.address.city.

Columns are the union of every key seen across all rows, in order of first appearance. Rows missing a key get an empty cell, which is what keeps the columns aligned when your records have optional fields.

CSV round-trips are lossy. CSV has no type system, so 1, true and null all come back as strings. Converting CSV back to JSON produces strings unless you post-process them. If types matter, use JSON or Parquet for the round trip and CSV only for the interchange.

Reading CSV back into JSON

When the header checkbox is on, the first row supplies the keys. With Expand dot paths enabled, a column named user.address.city is rebuilt into nested objects rather than a single flat key with a dot in it. Turn it off if your real keys genuinely contain dots.

Frequently asked questions

My CSV opens in Excel with one giant column. Why?

Excel infers the delimiter from your locale. In much of Europe the list separator is a semicolon, so a comma-delimited file opens as a single column. Switch the delimiter to semicolon, or use Excel's import wizard.

Why do long numbers turn into 1.2E+15?

That is the spreadsheet, not the file. Excel and Google Sheets auto-convert long digit strings to floating point on display. Prefix with an apostrophe on import, or set the column type to text.

Do I need a BOM for UTF-8?

Excel on Windows historically needed a UTF-8 byte order mark to detect encoding correctly. Modern versions usually manage without one, but adding it is still the safest choice if your data contains non-ASCII characters and the file will be opened in Excel.

Is there a row limit?

No fixed limit. Everything runs in your browser, so the practical ceiling is your device's memory.

Privacy. Conversion happens entirely on your device. Nothing is uploaded, so this is safe for customer exports and internal data that must not leave your machine.