CSV to JSON Converter

Delimiter
JSON indentation

Quoted fields may contain delimiters, line breaks and doubled quotes (""), as in RFC 4180. Numbers with leading zeros, such as ZIP codes and IDs, stay text.

Paste CSV or open a file

The result updates as you type or open a file.

Processed locally in your browser. Your input is not uploaded or saved by this tool.

Need the other direction? Convert JSON to CSV

About this tool

This CSV to JSON converter turns a spreadsheet export into a JSON array you can paste into code, an API request or a configuration file. With a header row, each line becomes an object whose keys are the column names; without one, each line becomes an array. The parser follows RFC 4180, so quoted fields with commas, line breaks and doubled quotes come through intact.

Paste the CSV or open a .csv, .tsv or .txt file of up to 5 MB. The delimiter is detected automatically, the table preview shows how the columns were split, and the JSON can be copied or downloaded. Everything happens in your browser.

How it works

Paste CSV text or open a file. The converter reads the first lines to find the delimiter (comma, semicolon, tab or pipe) that splits them into the most consistent columns; choose one yourself if the guess is wrong. A UTF-8 byte order mark at the start is removed.

With First row contains column names switched on, the first row supplies the keys. Empty names become column_1, column_2 and so on, and repeated names get _2, _3 suffixes. Rows with fewer fields are padded with empty strings, and a note tells you how many rows did not match the header.

With Convert numbers, true/false and null switched on, values written like JSON numbers (42, -3.5, 1e3) become numbers, true and false become booleans and null becomes null. Numbers with leading zeros, decimal commas or more than 15 significant digits stay text so that ZIP codes, phone numbers and IDs are not changed.

Example

This CSV has a quoted name that contains a comma:

id,name,city,active 1,"Lovelace, Ada",London,true 2,Alan Turing,Wilmslow,false

With the header row and type conversion switched on, the result is [{"id": 1, "name": "Lovelace, Ada", "city": "London", "active": true}, {"id": 2, "name": "Alan Turing", "city": "Wilmslow", "active": false}]. The comma inside the quotes stays part of the name, the IDs become numbers and the last column becomes booleans.

Assumptions and limits

The input is limited to 5 MB of text; above 300,000 characters the result updates only when you press Convert. Files are read as UTF-8. Parsing follows RFC 4180 with relaxed rules: line endings may be CRLF, LF or CR, a stray quote inside an unquoted field is kept as text, and an unclosed quote is reported. Blank lines are skipped. Values are not trimmed, so spaces around a delimiter stay part of the value. Dates are not converted. The data never leaves your browser.

Frequently asked questions

How do I convert a CSV file to JSON?

Open the file with Open CSV file or paste its contents into the input box. Check the table preview to make sure the columns were split correctly, adjust the delimiter or header setting if needed, and then copy the JSON or download it as a .json file.

Why are my numbers still strings?

Numbers are converted only when Convert numbers, true/false and null is switched on and the value looks like a JSON number. Values such as 007, 1,5 (decimal comma), 1 234 or 12345678901234567890 stay text, because converting them would drop leading zeros, misread the decimal separator or lose digits.

My CSV uses semicolons. Does that work?

Yes. Spreadsheets in many European locales export CSV with semicolons because the comma is the decimal separator. The converter detects semicolons, tabs and pipes automatically, and you can choose the delimiter yourself.

What happens to commas and line breaks inside a field?

If the field is wrapped in double quotes, as RFC 4180 requires, commas and line breaks inside it belong to the value. A double quote inside a quoted field is written twice, so "He said ""hi""" becomes He said "hi".

Can I get arrays instead of objects?

Yes. Switch off First row contains column names and every row becomes an array of values, including the first one. This is useful when the file has no header or when you want to process the columns by position.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
csvCSV inputnot accepted in links: enter it on the page
delimiterDelimiterone of: auto, comma, semicolon, tab, pipedefault auto
headerFirst row contains column namestrue or falsedefault true
infer_typesConvert numbers, true/false and nulltrue or falsedefault true
indentJSON indentationone of: 2, 4, 0default 2

Examples

  • ?delimiter=semicolon&infer_types=false
  • ?header=false&indent=0

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="csv-json"]