CSV to JSON Converter
Paste CSV or drop a file to get clean JSON — indented, minified, or NDJSON with one object per line — with correct handling of quoted fields, embedded commas and line breaks. Converts back to CSV too.
Why CSV parsing is harder than it looks
CSV has no single specification, but RFC 4180 describes what most tools produce. Three rules cause nearly every parsing bug:
- A field containing the delimiter must be wrapped in double quotes.
- A double quote inside a quoted field is written twice —
"she said ""no""". - A quoted field may contain line breaks, so lines and records are not the same thing.
That last rule is why splitting a CSV on newlines fails on real exports. The parser here reads character by character and tracks whether it is inside quotes, which handles all three cases.
The leading-zero trap
Type detection is convenient and occasionally destructive. A postal code of
01234 becomes the number 1234, and a phone number
in scientific notation is unrecoverable. If your data contains identifiers
rather than quantities, turn type detection off and keep everything as
strings.
Frequently asked questions
Does this handle commas inside quoted fields?
Yes. The parser follows RFC 4180: a field wrapped in double quotes may contain commas, line breaks and escaped quotes written as two double quotes in a row. Splitting on commas with a regular expression is the usual shortcut and it corrupts any file containing an address or a quoted description.
How are numbers and booleans handled?
With type detection on, values that look like numbers become JSON numbers, true and false become booleans, and empty fields become null. Turn it off when you have identifiers that must stay strings — postal codes, phone numbers and anything with leading zeros lose those zeros the moment they become numbers.
What if my file uses semicolons or tabs?
Set the delimiter manually, or leave it on auto-detect, which samples the first few lines and picks whichever of comma, semicolon or tab appears most consistently. Semicolons are standard in locales where the comma is the decimal separator, so European exports frequently need this.
Can I convert JSON back to CSV?
Yes — switch the direction at the top. JSON to CSV expects an array of objects, and the column order is taken from the union of all keys found, so records with missing fields still line up correctly.
Why does the downloaded CSV open correctly in Excel?
Two deliberate details. The file starts with a byte-order mark, without which Excel reads UTF-8 in the system code page and destroys every non-ASCII character. And lines end with CRLF, which Excel expects. The JSON side accepts NDJSON too — the same shape this tool emits — so a round trip through both directions returns the data you started with.
Related tools
- PDF StudioSee every page of every PDF you open, drag them into order, rotate, delete, split and watermark, then export. Nothing is uploaded.
- Merge PDF FilesMerge PDFs and images into one PDF, extract or reorder pages, split into separate files, rotate scans. JPG to PDF works offline too.
- Base64 Encoder & DecoderEncode and decode Base64 text, and turn any file into a Base64 data URI for embedding.