About this tool
CSV looks simple until a value contains a comma. "Smith, John" in a name column, an address with commas in it, or a note that spans two lines will all break a converter that just splits each line on commas. This converter uses a proper parser that follows the rules in RFC 4180, the closest thing CSV has to a standard, so quoted fields come through intact. The conversion happens in your browser; the data is never uploaded.
How to use the CSV to JSON Converter
- Paste your CSV, or copy a range of cells from Excel or Google Sheets and paste it straight in — spreadsheets copy as tab-separated text, which the auto-detect picks up.
- Check the options. Keep "First row is headers" on to get objects keyed by column name, or turn it off for plain arrays.
- Click Convert to JSON. The status line reports how many rows and columns were read and warns about any row with a different number of fields.
- Copy or download the result as a .json file.
How the parser handles tricky CSV
- Quoted fields: a field wrapped in double quotes can contain the delimiter, so
"Smith, John"stays one value. - Escaped quotes: inside a quoted field, two double quotes stand for one, so
"She said ""hi"""becomesShe said "hi". - Line breaks inside quotes are kept as part of the value instead of starting a new row.
- Line endings from Windows (CRLF), macOS and Linux (LF), and old Mac files (CR) are all accepted, and a byte-order mark at the start of an Excel export is removed.
- Delimiters: auto-detect counts commas, tabs, semicolons and pipes in the first row (ignoring any inside quotes) and picks the most common. Many European Excel installs export with semicolons because the comma is their decimal separator; you can also pick the delimiter yourself.
Worked example
This three-line CSV has a comma inside a quoted name and a quoted phrase with escaped quotes:
name,email,age,active "Smith, John",john@example.com,42,true "O'Neil, Ann","ann@example.com",007,"said ""hi"""
With headers and type detection on, the output is an array of two objects. John's age becomes the number 42 and active becomes true. Ann's age stays the string "007", because turning it into the number 7 would lose the leading zeros — the same rule protects ZIP codes, phone numbers and product codes. Her active field becomes the text said "hi", with the doubled quotes collapsed back to single ones.
Data types: what gets converted
JSON has real numbers, booleans and null, while CSV only has text. With "Detect numbers, true/false, empty" on, a field is converted only when the conversion is lossless: plain numbers such as 42, -3.5 or 1e6 become numbers; true and false (in any capitalisation) become booleans; and an empty field becomes null. Values with leading zeros, thousands separators such as 1,200, currency symbols, or integers too large for JavaScript to store exactly (above 9,007,199,254,740,991, like many database IDs) are left as strings so nothing is silently changed. Turn the option off to keep every value as a string.
Headers and uneven rows
Blank header cells are named column_1, column_2 and so on, and repeated headers get a suffix (email, email_2) so no column overwrites another. If a row has fewer fields than the header, the missing keys are filled with null (or an empty string with type detection off); extra fields beyond the header are kept under column_N keys. Either way the status line tells you which rows were uneven, since that usually means an unquoted comma in the source data.
Common use cases
- Turning a spreadsheet export into test fixtures or seed data for an app
- Preparing data for a JavaScript chart library or a static site
- Feeding a list of records to an API that expects a JSON array
Once you have JSON, the JSON Formatter can validate or re-indent it, and the JSON Diff tool compares two versions of it. To go the other way, the JSON to CSV converter turns JSON back into a spreadsheet-ready file.
Frequently asked questions
Values that contain commas should be wrapped in double quotes, as spreadsheets do when they export CSV. The parser treats everything inside the quotes as one field, so "Smith, John" stays a single value.
Yes. Copied cells are pasted as tab-separated text, and auto-detect picks the tab delimiter. You can also choose the delimiter yourself.
Values are only converted when nothing would be lost. Numbers with leading zeros, thousands separators, currency symbols, or more digits than JavaScript can store exactly stay as strings so ZIP codes, IDs and phone numbers are not changed.
Missing fields are filled with null (or an empty string when type detection is off) and extra fields are kept under column_N keys. The status line lists the uneven rows so you can check the source data.
No. The conversion runs entirely in your browser with JavaScript, and nothing is sent to a server.