CSV to JSON
Convert CSV files to JSON format.
How to Convert CSV to JSON
Select or paste CSV
Drop a .csv file or paste raw CSV data with a header row.
Parsing runs locally
Each row becomes a JSON object using the header row as keys โ all in your browser.
Copy or download the JSON
Grab an array of objects ready for APIs, scripts and databases.
CSV is not a standard, it is a habit
There is a specification, and almost nobody follows it exactly. Files use commas, semicolons or tabs as separators โ much of Europe uses semicolons because the comma is the decimal separator. Line endings differ between operating systems. Quoting rules vary between the tools that wrote the file.
So parsing CSV correctly means detecting conventions rather than applying rules. Most parsing failures are not corrupt files; they are files written under conventions the parser did not expect.
Quoting is where files actually break
A field containing the separator must be quoted, and a quote inside a quoted field is escaped by doubling it. A naive parser that splits on commas destroys any file containing an address, a decimal number in a European locale, or a sentence with a comma in it.
Fields can also contain line breaks inside quotes, which means a CSV row is not necessarily a line of the file. Any tool that reads the file line by line will mangle such a row, and the damage is silent โ you get the wrong number of rows, not an error.
Everything in CSV is text
CSV has no types. Converting to JSON therefore requires guessing whether a value is a number, a string, a boolean or a date โ and every guess has a failure case. Postal codes and identifiers with leading zeros lose them when read as numbers. Long numeric identifiers hit floating-point precision limits. Values like 'NA' or '1-2' can be misread as dates by some tools.
The safest default is to keep everything as strings and convert deliberately where you know the type. Aggressive type inference is convenient right up to the point where it quietly corrupts a column.
Headers, encoding and the invisible first character
Duplicate header names, empty headers and headers with trailing spaces all produce JSON keys that are not what you expect. Rows with more or fewer fields than the header are common in exported data and need a decision rather than a crash.
Encoding causes the other classic failure: a file saved as Windows-1252 read as UTF-8 turns accented characters into garbage, and a UTF-8 file with a byte order mark puts an invisible character at the start of the first header name, so the first key never matches what your code looks for.
Checking the result, and privacy
Verify the row count against the source, check any column that should contain leading zeros, and look at a row containing a comma or a quotation mark inside a field. Those three checks catch nearly every conversion problem.
Conversion runs in your browser. Exported CSVs are typically customer lists, transaction records and internal reports โ exactly the data that should not be pasted into an unfamiliar website โ and none of it is transmitted here.