DEVELOPER TOOL

CSV to JSON Converter

Paste CSV (or a table copied from a spreadsheet) and get clean JSON. Quoted commas, line breaks inside quotes and escaped quotes are handled correctly.


  

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

  1. 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.
  2. Check the options. Keep "First row is headers" on to get objects keyed by column name, or turn it off for plain arrays.
  3. 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.
  4. Copy or download the result as a .json file.

How the parser handles tricky CSV

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

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

How does the converter handle commas inside a value?

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.

Can I paste data straight from Excel or Google Sheets?

Yes. Copied cells are pasted as tab-separated text, and auto-detect picks the tab delimiter. You can also choose the delimiter yourself.

Why did a number stay in quotes in the output?

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.

What happens if rows have different numbers of columns?

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.

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript, and nothing is sent to a server.