CSV to JSON Converter

Paste CSV or drop a file to get clean JSON, 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:

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.

Related tools