HassleFreeTools

CSV to JSON Converter

Convert CSV or TSV to JSON objects or arrays. Detects the delimiter, keeps leading zeros in phone numbers and PIN codes, and lists problem rows.

Paste CSV or TSV text, or drop a .csv file of up to 20 MB. Excel files need to be saved as CSV first.

JSON settings

Each row becomes an object with the header names as keys. Off: each row becomes a list of values.

Values with leading zeros, such as phone numbers and PIN codes, stay as text. Empty cells become null.

Convert your CSV to see the JSON here.

Runs entirely in your browser. Your files and text are not uploaded.

How to use CSV to JSON Converter

  1. Step 1: Add your CSV

    Paste CSV text or open a .csv file. For an Excel or Google Sheets file, save or download the sheet as CSV first.

  2. Step 2: Check the settings

    The delimiter is detected for you. Choose whether the first row is a header and whether numbers and true/false values are converted.

  3. Step 3: Convert and save

    Press Convert to JSON, review any problem lines that are listed, then copy the JSON or download it.

How the CSV is read

The tool uses Papa Parse, a widely used CSV parser that follows RFC 4180: fields can be wrapped in double quotes, quoted fields can contain commas and line breaks, and a doubled quote ("") inside a quoted field stands for one quote character. A byte order mark at the start of the file is ignored.

Delimiter detection looks at the first ten rows and picks the character (comma, tab, pipe or semicolon) that splits them into the most consistent number of fields. If it guesses wrong, for example in a file with only one column, choose the delimiter yourself.

Objects or arrays

With First row is the header switched on, every row becomes an object whose keys are the header names, in the same order as the columns. An empty header name becomes column1, column2 and so on, and a repeated name gets a suffix (email_2) so that no value is lost. With the header switched off, each row becomes an array of values and the first row is treated as data.

How values are converted

With Convert numbers, true/false and null switched on, a value is changed only when the change cannot lose information:

  • A value becomes a number only when it is written exactly like a JSON number, such as 42, -3.5 or 1.2e3.
  • Values with a leading zero stay text. 09876543210, 011001 and 007 would lose their zeros as numbers, which breaks phone numbers, PIN and ZIP codes and IDs.
  • Numbers with more than 15 significant digits, such as card or account numbers, stay text, because JavaScript would round them.
  • Values with a plus sign, thousands separators or spaces (+91 98765 43210, 1,250) stay text.
  • true, false and null become a boolean or null in any letter case, so Excel's TRUE works too.
  • Empty cells become null.

Dates are left as text, because a CSV file does not say which date format it uses. Switch conversion off to keep every value as text exactly as it appears, with empty cells as empty strings.

Problem rows

When a row has more or fewer values than the header, or a quote is never closed, the tool still creates the JSON but lists each problem with its line number in the file. Missing values are left empty and extra values are kept under names such as column7, so you can see what happened. Line numbers count the lines of the file itself, so a quoted value that spans several lines moves the rows after it down.

Privacy

Everything runs in your browser. Your file is not uploaded or stored.

Limitations

  • Files can be up to 20 MB. The output box shows the first 1,000,000 characters; Copy and Download always include the full JSON.
  • Excel workbooks (.xlsx, .xls) cannot be read directly. Save them as “CSV UTF-8” first.
  • A file that is not UTF-8 is read as Windows-1252 (Western European), and the tool tells you when that happens. Files in other encodings may show wrong characters.
  • Dates, amounts with currency symbols and numbers with thousands separators are not converted; they stay as text.
  • Nested JSON is not rebuilt from column names such as address.city. Each column becomes one flat key.
  • Comment lines and headers that span several rows are not recognised. Remove them before converting.

Frequently asked questions

Why are some numbers in quotes in the JSON?

They are kept as text on purpose: the value has a leading zero (such as a phone number or PIN code), more than 15 digits, a plus sign or a thousands separator. Converting those to numbers would change them. Everything else that looks like a number is converted.

How do I convert an Excel file to JSON?

In Excel, choose File › Save As and pick “CSV UTF-8 (Comma delimited)”. In Google Sheets, choose File › Download › Comma-separated values. Then open the CSV file here.

What happens to rows with missing or extra values?

They are still converted. Missing values are left empty, extra values are kept under names such as column7, and each of these rows is listed with its line number so you can fix the CSV if needed.

Can I get arrays instead of objects?

Yes. Switch off “First row is the header”. Each row then becomes an array of values, and the first row is included as data.

Which delimiters are supported?

Comma, semicolon, tab and pipe. The delimiter is detected automatically, and you can choose it yourself if the guess is wrong.

Is my data uploaded anywhere?

No. The CSV is read and converted in your browser. It is not sent to our server or stored.

Convert a JSON array into a CSV file for Excel or Google Sheets. Nested objects become columns, and formula protection is on by default.

Format, minify and validate JSON in your browser. Errors are shown with the exact line and column, and numbers are kept exactly as written.

Delete repeated lines from a list while keeping the original order, with options to ignore case, extra spaces and empty lines.