CSV to JSON Converter — Clean, Quoted, In-Browser
Turn CSV into a JSON array of objects, with correct handling of quoted fields, commas inside values and the header row — parsed entirely in your browser.
—
What this tool does
It reads CSV text and emits JSON. By default the first row is treated as a header, so each of the remaining rows becomes one JSON object: the header names are the keys and the row’s cells are the values. Untick the header option to get an array of arrays that preserves every row. The parser is written for real CSV, not just the simple comma-separated kind, so it copes with the cases that break naive splitting.
It parses CSV properly
A line-by-line split on commas fails the moment a value contains a comma, a quote or a line break.
This converter follows the CSV convention instead: a field wrapped in double quotes may contain the
delimiter, newlines and doubled quotes (""), and those are returned as literal text.
So a spreadsheet export containing an address, a job title with a comma, or a multi-line note
converts without corrupting into extra columns or extra rows.
Values are kept as strings on purpose. CSV has no type information, and treating “007” or a phone number as a number would silently drop the leading zero — so the converter leaves coercion to your own code, where the rules are known.
How to use it
- Paste the CSV into the box (open a .csv in any text editor and copy its contents).
- Leave the delimiter on auto-detect, or set it explicitly for an unusual file.
- Keep the header option on for objects keyed by column name, or off for raw arrays.
- Press Convert and copy the JSON.
Frequently asked questions
How do I handle semicolon or tab delimiters?
Choose the delimiter explicitly if auto-detection guesses wrong. Files from locales where the decimal separator is a comma often use semicolons, and spreadsheet copies often use tabs. The delimiter selector overrides detection for the whole file; mixing delimiters within one file is not supported, because a record boundary would be ambiguous.
What happens to empty values and short rows?
An empty field becomes an empty string, not null, because CSV has no null. Short rows produce objects missing the absent keys rather than padding them with empty strings, which keeps the output honest about what the file contained. If a downstream schema requires every key, fill the gaps after conversion rather than assuming the parser did it.
Can I keep numbers as numbers in the JSON?
No, and that is deliberate. CSV has no types, so “007” may be a postcode, “1e5” may be an ID, and “+44…” is not a number at all. Guessing turns those into different values. Keep the strings and convert the fields you know are numeric in your own code, where the schema is known.
How is the header row used?
With “First row is a header” ticked, the first row becomes the property names and every later row becomes one JSON object keyed by those names. Empty header cells are named column_1, column_2 and so on. Untick it to get an array of arrays instead, which keeps every row including the first.
What delimiter should I choose?
Leave it on “Auto-detect” and the tool counts commas, tabs, semicolons and pipes in the first line and picks the one that appears most. You can also set it explicitly — comma for .csv, tab for files copied from a spreadsheet, semicolon for many European exports.
How are quotes and commas inside a value handled?
Properly. A field wrapped in double quotes may contain the delimiter, line breaks and doubled quotes (""), all of which are kept as literal text — that is why “Rear Admiral, USN” survives as a single value rather than splitting into two columns.
Are numbers converted to JSON numbers?
No. Every value is emitted as a string, because CSV has no types and guessing would corrupt values such as postal codes, phone numbers and IDs that look numeric but must keep leading zeros. Convert the fields you need in your own code after parsing.
Is a file uploaded?
No. Paste or type the CSV and it is parsed entirely in your browser; nothing is sent anywhere. For a file, open it in a text editor and paste its contents.
What if the JSON has duplicate keys?
If two header cells have the same name, the later column overwrites the earlier one in each object, because a JSON object cannot hold the same key twice. Rename the duplicate headers in the CSV first if both matter.
Go deeper
Longer explanations of the problems this tool solves:
Sources
- RFC 4180, Common Format and MIME Type for Comma-Separated Values (CSV) files. rfc-editor.org/rfc/rfc4180
- RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format.
Everything runs in your browser — nothing you type is uploaded.