Free online tools
English EN, Choose a language

CSV to JSON converter

Paste CSV to get a JSON array of objects. The delimiter is detected, quoted fields are handled, types are optional.

Delimiter

Indent

Result

Paste CSV and the JSON appears here.

Runs in your browser. Your data is never uploaded or stored.

How to convert CSV to JSON

  1. Paste your CSV into the box (copy cells from Excel or Sheets and you get tab-separated text, which works too), or press Insert example.
  2. Leave the delimiter on Detect, or set it if the first row is unusual. Untick First row is the header if there are no column names; you then get an array of arrays.
  3. Tick Convert numbers, true/false and null when you want real JSON types instead of strings.
  4. Copy the JSON or download it as a .json file.

A worked example

A CSV with a quoted comma, doubled quotes and an empty field:

id,name,score,active
1,Ada,9.5,true
2,"Grace, Admiral",10,false
3,"Linus ""Penguin""",,true

As JSON, with every value kept as text, the safe default:

[
  {
    "id": "1",
    "name": "Ada",
    "score": "9.5",
    "active": "true"
  },
  {
    "id": "2",
    "name": "Grace, Admiral",
    "score": "10",
    "active": "false"
  },
  {
    "id": "3",
    "name": "Linus \"Penguin\"",
    "score": "",
    "active": "true"
  }
]

With Convert numbers, true/false and null on, 9.5, 10, true and false become numbers and booleans. The empty score stays an empty string rather than a guessed null:

[
  {
    "id": 1,
    "name": "Ada",
    "score": 9.5,
    "active": true
  },
  {
    "id": 2,
    "name": "Grace, Admiral",
    "score": 10,
    "active": false
  },
  {
    "id": 3,
    "name": "Linus \"Penguin\"",
    "score": "",
    "active": true
  }
]

Keep types off when a column holds codes or ids: 007 must stay "007", and ids longer than 15 digits would lose digits as numbers, so the converter leaves such values as text even when types are on.

Delimiters, quotes and line breaks

CSV is not one format but a family. The converter reads the first line to choose between comma, semicolon, tab and pipe, counting only delimiters outside quotes. A European-style file:

name;city
Ada;London
Grace;New York
becomes
[
  {
    "name": "Ada",
    "city": "London"
  },
  {
    "name": "Grace",
    "city": "New York"
  }
]

The quoting rules are those of RFC 4180: a field containing the delimiter, a quote or a line break is wrapped in double quotes, and a quote inside it is written twice. Quoted fields may span several lines. Both Windows (CRLF) and Unix (LF) line endings work. A quoted field that never closes is reported: A quoted field is never closed (a " opened and has no closing quote).

Uneven rows and missing values

Real files often have rows with too few or too many fields. The converter counts them and shows a note:

a,b
1,2
3
has a short second row. Missing fields become empty strings, and the stats show Uneven rows: 1. Fields beyond the header are dropped when keys are used. Duplicate column names are made unique (name, name_2) so no data is lost. Empty header cells are named column1, column2 and so on.

Without a header row, you get an array of arrays:

[
  [
    "a",
    "b"
  ],
  [
    1,
    2
  ],
  [
    3,
    4
  ]
]

Getting the data back and checking it

To go the other way, use JSON to CSV. To read, sort or re-indent the result use the JSON formatter. If the CSV came from a spreadsheet, remember that Excel exports with the list separator of your region and may use a different text encoding; if accented letters look broken, re-export as UTF-8. Everything is converted in your browser.

Related tools

CSV to JSON converter FAQ

How do I convert CSV to JSON?

Paste the CSV, keep Detect for the delimiter and the header option on. The JSON array of objects appears at once; copy it or download the file.

How does it handle commas inside values?

Values wrapped in double quotes may contain commas, line breaks and doubled quotes, as RFC 4180 describes. The converter reads them as one field.

Why are all my numbers strings?

By default every value stays text so ids and codes are not altered. Tick Convert numbers, true/false and null to get real JSON types.

Can it convert semicolon or tab separated files?

Yes. The delimiter is detected from the first row, or you can choose comma, semicolon or tab yourself.

What if there is no header row?

Untick First row is the header and you get an array of arrays, one per row.

Is my CSV uploaded anywhere?

No. The conversion runs in your browser and nothing is sent or stored.

Missing something in the CSV to JSON converter?Suggest an idea. It takes 20 seconds and we read every one.Suggest an idea

Sends only what you type here, never the text you work with. Your email is used only to reply about this idea.

Free online tools