CSV ↔ JSON

Convert CSV to JSON arrays and back, quoted fields supported. Handy for spreadsheets and API data.

Input (CSV or JSON array)
Hint: the first CSV row is the header; JSON must be an array, e.g. [{"a":1},{"a":2}].
Conversion result

How CSV quoting actually works

Comma-separated values has been used informally for decades and was only formally specified in RFC 4180 in 2005. The rules are short, but they matter the moment your data contains anything other than plain text:

According to the specification, a file should not change its delimiter and should not contain spaces between the delimiter and the field. In practice, both happen constantly.

Where CSV breaks in the real world

ProblemWhy it happens
Wrong delimiterMany European locales export with semicolons, because the comma is the decimal separator
Leading zeros lostSpreadsheets guess the type and turn 007 into 7
Long numbers mangledIDs above 15 digits are converted to floats and lose precision
Headaches with encodingA UTF-8 BOM, or a legacy Windows-1252 export, breaks accented characters
Line breaks inside fieldsValid CSV, but naive line-by-line parsers split the record in two

CSV versus JSON

CSV is compact and spreadsheet-friendly but represents only a flat table: no nested objects, no types, no arrays. JSON keeps structure and types but is roughly two to three times larger and does not open directly in a spreadsheet. The practical rule is to use CSV for tabular exports and JSON for anything with hierarchy or mixed types.

Converting safely

When turning JSON into CSV, pad missing keys with empty values so every row has the same column count, and quote every string. When turning CSV into JSON, keep unquoted numeric fields as numbers but be careful with postal codes, phone numbers and account identifiers, which only look numeric and should stay strings.

Related tools

JSON formatter XML formatter SQL formatter

FAQ

Is the first CSV row the header?
Yes. When converting CSV to JSON, the first row is treated as field names and each following row becomes an object. If the first row is already data, the object keys fall back to default column names like c1, c2…
Are quoted fields supported?
Yes. Fields may be wrapped in double quotes; commas and line breaks inside quotes count as field content, and two consecutive double quotes represent one quote character — following common RFC 4180 conventions.
Is my data uploaded?
No. Conversion happens entirely in your browser; the text is never sent to any server.