CSV to JSON Converter

Convert CSV to clean JSON in your browser. Quoted fields, any delimiter, and safe number handling.

Ln 1, Col 11 lines · 0 chars
Ln 1, Col 11 lines · 0 chars
Row and column counts will appear here.

What Does This CSV to JSON Converter Do?

CSV (comma-separated values) is how spreadsheets, databases and many exports share tabular data. JSON is what most APIs, JavaScript code and configuration files expect. This tool turns one into the other: each CSV row becomes a JSON object, with the column names from the first row as keys.

Everything runs in your browser. The CSV you paste is not uploaded to a server, so it is fine to use with internal exports and test data.

How to Convert CSV to JSON

  1. 1

    Paste your CSV

    Paste it into the CSV input box, straight from Excel, Google Sheets, a database export or a .csv file opened in a text editor.
  2. 2

    Check the options

    The delimiter is detected automatically (comma, semicolon, tab or pipe). Untick First row is header if your data has no column names, and you'll get an array of arrays instead of objects.
  3. 3

    Click "Convert to JSON"

    The JSON appears on the right, with a count of rows and columns underneath so you can check nothing was missed.
  4. 4

    Copy or download

    Use Copy to paste it into your code, or Download .json to save it as a file.

Example

CSV input
id,name,city,active
1,"Smith, Jane",Austin,true
2,Bob,,false
3,Chloé,Pune,true
JSON output
[
  { "id": 1, "name": "Smith, Jane", "city": "Austin", "active": true },
  { "id": 2, "name": "Bob", "city": "", "active": false },
  { "id": 3, "name": "Chloé", "city": "Pune", "active": true }
]

The comma inside "Smith, Jane" stays part of the name because the field is quoted.

How Values Are Converted

With Detect numbers & true/false switched on, a value only becomes a number, boolean or null when that can't change what it means. Everything else stays a string:

  • ✓42 and -3.5 become numbers.
  • ✓true, false (or TRUE/FALSE from Excel) become booleans, and null becomes null.
  • ✓00123 stays the string "00123", so ZIP codes, phone numbers and IDs keep their leading zeros.
  • ✓Long IDs such as 12345678901234567890 stay strings, because JavaScript numbers can't hold that many digits exactly.
  • ✓1.50 and 1e3 stay strings, so the original formatting is preserved.
  • ✓Empty cells become empty strings "".
  • ✓Types are decided per column, so a column never mixes strings and numbers. If one ZIP code is 00123, every ZIP code in that column stays a string.

Switch the option off to keep every value as a string.

Frequently Asked Questions

Does it handle commas and line breaks inside fields?+
Yes. Fields wrapped in double quotes can contain the delimiter, line breaks and quotes (written as two double quotes, ""), following the standard CSV format (RFC 4180).
My CSV uses semicolons. Will that work?+
Yes. Spreadsheets in many European locales export with semicolons. The delimiter is detected automatically from the first row, or you can pick comma, semicolon, tab or pipe yourself.
What happens if rows have different numbers of columns?+
Missing values at the end of a short row become empty strings. Extra values in a long row are kept under keys like column_4, so no data is dropped.
What if two columns have the same name?+
JSON objects need unique keys, so repeats are renamed: name, name_2, name_3. Blank column names become column_1, column_2 and so on.
Can I turn JSON back into a table or Excel file?+
Yes. Paste JSON or CSV into the Data Grid Tool to see it as a table and export it to Excel. To tidy up or validate JSON, use the JSON Formatter.