Format Code Now
/
ConvertCSV to JSON Next: JSON to CSV ›

CSV to JSON Converter

CV-01

Paste CSV and get a JSON array with one object per row, using the first row as the keys. Quoted fields that contain commas, quotes or line breaks are read correctly.

Runs in your browser. Nothing is uploaded.

CSV

JSON

How to use it

  1. Paste your CSV into the input box, or open a .csv file (up to 5 MB) or drop it on the box.
  2. Leave Delimiter on Auto, or choose comma, semicolon, tab or pipe.
  3. Untick First row is header if your CSV has no header row.
  4. Tick Convert numbers and true/false if you want typed values instead of text.
  5. Copy the JSON or download it as a .json file.

How rows become objects

The first row becomes the keys, and each later row becomes an object. The parser follows the CSV standard (RFC 4180): a quoted field can hold the delimiter, line breaks and doubled quotes, so "Said ""hello""" comes out as Said "hello". Empty lines are skipped and a leading byte order mark is dropped. A blank header becomes column_1, column_2 and so on, and a repeated header gets _2, _3 added so no key is overwritten. With the header option off you get an array of arrays.

Text by default, numbers when you ask

Every value stays a string unless you turn on Convert numbers and true/false. That keeps leading zeros in IDs and zip codes safe. With it on, whole numbers up to 15 digits, decimals, true and false become real JSON values, and empty cells become null. Integers longer than 15 digits, or with a leading zero like 007, stay text so they are not rounded or changed. A row with fewer cells than the header gets null for the missing ones, and extra cells are added as column_N keys.

Delimiters from Excel and other exports

Auto reads the first line, counts commas, tabs, semicolons and pipes, and picks the most common, with comma winning a tie. Many European exports use semicolons, and database dumps often use tabs or pipes. Auto counts every delimiter character on the first line, even inside quotes, so if your header has quoted commas, choose the delimiter yourself. The output is indented with 2 spaces, 4 spaces or a tab, and nothing is uploaded.

Error messages and what to do

MessageWhat it meansFix
A quoted field is never closed (missing closing ")A field starts with a double quote but the text ends before the closing quote, so the parser cannot tell where the field stops.Add the missing closing quote, or double any quote that belongs inside the text, as in "".

Questions people ask

How do I convert CSV to JSON?

Paste your CSV into the input box. The converter reads the first row as the keys and returns a JSON array with one object per row. Copy the result or download it as a .json file. It runs in your browser, so the data is not uploaded.

How do I convert CSV to JSON when a field contains a comma?

Wrap the field in double quotes, as in "Writes, codes", and the comma stays part of the value. Quotes inside a quoted field are doubled. Line breaks inside quotes also stay in the value. The converter follows the CSV standard, RFC 4180.

Can I convert a semicolon or tab separated file?

Yes. Delimiter is on Auto by default and picks comma, tab, semicolon or pipe from the first line. You can also choose one yourself, which is safer when the header line contains quoted commas.

Why are the numbers in my JSON strings?

By default every value stays text so leading zeros in IDs are not lost. Tick Convert numbers and true/false to get JSON numbers and booleans. Empty cells then become null, and values such as 007 or numbers over 15 digits stay text.

How do I convert CSV to JSON without a header row?

Untick First row is header. You then get an array of arrays, one inner array per row, with no keys. With the header option on, a blank header name becomes column_1, column_2 and so on.

Is my CSV file uploaded when I convert it?

No. The CSV is read and converted in your browser and nothing is sent to a server. Files must be under 5 MB. A share link keeps your input after the # in the address, which browsers never send.

About this tool

Follows the CSV standard (RFC 4180): quoted fields can contain delimiters, quotes and new lines. By default every value stays text, so leading zeros in IDs are safe.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.