Skip to the content

Convert CSV to JSON

Turn CSV into a JSON array of objects. The delimiter is detected, quoted fields are read properly and numbers become numbers.

JSON

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

How a field gets its type

A CSV file holds text and nothing else. Whether 42 is a number or a house number is not in the file, so the converter has to decide, and it is careful about it. One file with a few awkward fields:

CSV
name,joined,member,zip,note
"Jansen, A.",2024-03-01,true,0123,"said ""hi"""
Bob,2025-11-22,FALSE,90210,
JSON
[
  {
    "name": "Jansen, A.",
    "joined": "2024-03-01",
    "member": true,
    "zip": "0123",
    "note": "said \"hi\""
  },
  {
    "name": "Bob",
    "joined": "2025-11-22",
    "member": false,
    "zip": 90210,
    "note": ""
  }
]

What a field turns into

In the CSV42In the JSON42Written exactly like a JSON number.
In the CSV-1.50In the JSON-1.50A number too. Its digits are kept as they are.
In the CSV007In the JSON"007"A leading zero means a code, not a quantity.
In the CSV+31612345678In the JSON"+31612345678"A plus sign is not part of a JSON number, and a phone number is not one either.
In the CSV1,5In the JSON"1,5"A decimal comma is not how JSON writes numbers.
In the CSV12345678901234567890In the JSON"12345678901234567890"More digits than JavaScript holds exactly, so it stays text and keeps them all.
In the CSVTRUEIn the JSONtruetrue and false are recognised in any capitalisation.
In the CSVnullIn the JSONnullOnly in lowercase.
In the CSVNullIn the JSON"Null"Not lowercase, so it stays text. It is also a surname.
In the CSV(empty)In the JSON""An empty field is an empty text, not null.

Fields in quotes

Quotes are how a field holds the delimiter, a line break or a quote of its own. They are taken off when the file is read.

Written in the file"Jansen, A."The valueJansen, A.Quotes keep the comma inside one field.
Written in the file"said ""hi"""The valuesaid "hi"Two quotes in a row stand for one.
Written in the file" padded "The value padded Spaces inside the quotes belong to the value.
Written in the file6" nailsThe value6" nailsA quote in the middle of a field without quotes is just a quote.

Good to know

The decision is made per field, not per column. A column of postcodes can come out as text in one row and as a number in the next, as 0123 and 90210 do above. If that matters, switch the conversion off and every value stays text.

Dates stay text, because JSON has no type for them.

The delimiter is taken from the first twenty rows: comma, semicolon, tab or pipe, whichever gives every row the same number of fields. A first line such as sep=; is obeyed and left out of the result.

Column names come from the first row. An empty name becomes column_3, after its position, and a name that occurs twice gets _2 behind it. A row with too few fields is filled up with empty text.

With Nest names with dots switched on, a column called address.city becomes an object and lines.0.sku a list.

The JSON to CSV converter page has more on delimiters, Excel and cells that start with an equals sign.

See all 12