CSV to JSON converter

Paste CSV and get clean JSON in one step. It detects the separator, handles quoted fields and line breaks, and can turn numbers into real JSON numbers. Free, and your data never leaves your browser.

How to use it

  1. Paste your CSV into CSV data.
  2. Leave Separator on auto-detect, or pick comma, semicolon or tab.
  3. Keep First row is the header checked to get a list of objects, or clear it to get a list of arrays.
  4. Copy the JSON or use Download to save a .json file.

Complete guide to converting CSV to JSON

Why convert CSV to JSON

CSV is what spreadsheets and databases export, while JSON is what web APIs, JavaScript code and many configuration files expect. A product list exported from Excel, a mailing list from a CRM or a report from an analytics tool often has to become JSON before an app can read it. This converter does it in one step, handling the details that break quick scripts: separators inside quotes, line breaks inside cells and numbers that must stay as text.

How the conversion works

The tool reads your text character by character following the usual CSV rules. A field wrapped in double quotes may contain the separator and line breaks, and two quotes in a row inside it stand for one literal quote. Rows can end with \n or \r\n, and empty lines are skipped. With Separator on auto-detect, it counts commas, semicolons, tabs and pipes in the first line (outside quotes) and uses the most frequent one. The result is shown with 2-space indentation and a summary of records, columns and the separator used. It all happens in your browser, so the file is never uploaded.

OptionEffect
First row is the headerOn: a list of objects, one per row, with the header names as keys. Off: a list of arrays.
Convert numbersValues such as 31, -2.5 or 1e3 become JSON numbers. Everything else stays text.
SeparatorAuto-detect, comma, semicolon or tab.

Worked example

Paste this into CSV data:

name,age,city
Ana,31,São Paulo
"Smith, John",45,"New York"
Luis,,Madrid

With Convert numbers checked, the summary shows 3 records, 3 columns and a comma separator. The JSON contains the objects {"name": "Ana", "age": 31, "city": "São Paulo"}, {"name": "Smith, John", "age": 45, "city": "New York"} and {"name": "Luis", "age": "", "city": "Madrid"}. Notice that the comma inside "Smith, John" did not split the field, and that Luis's empty age became an empty string, not null or 0.

Edge cases the tool handles

  • Leading zeros, as in ZIP codes or IDs like 007, stay text so no information is lost, and so do integers larger than JavaScript can represent exactly.
  • Empty header names become column1, column2 and so on, and repeated names get a suffix such as name_2.
  • A row with fewer cells than the header is filled with empty strings. Extra cells get names like column4.
  • A quote that is never closed produces an error message instead of a wrong result.

Tips and common mistakes

  • Numbers written with a decimal comma, such as 12,50, are not converted: the tool only recognizes a dot as the decimal mark. They stay text, so convert them in your code if needed. In a semicolon file, 12,50 is read as one field, which is correct.
  • If the columns look shifted, check the separator. A European CSV often uses semicolons, and choosing comma by hand would split on the wrong character.
  • Dates stay as text. JSON has no date type, so parse them in the code that uses the data.
  • Keep a header row with unique, simple names; they become the JSON keys your code will reference.

Related tools

To go the other way, use the JSON to CSV converter. To clean the text first, see the duplicate line remover and the line sorter.

Questions

Is my data uploaded anywhere?

No. The conversion runs in your browser, so the CSV is never sent or stored.

How are quotes and commas inside a field handled?

Fields wrapped in double quotes can contain separators and line breaks. Two quotes in a row ("") become one literal quote, as in the standard CSV format.

What does Convert numbers do?

Values such as 31, -2.5 or 1e3 become JSON numbers. Values with leading zeros (like 007) and very large integers stay as text so no information is lost.

What happens to empty cells and short rows?

Empty cells become empty strings. If a row has fewer cells than the header, the missing ones are filled with empty strings. Extra cells get names like column4.