Skip to content

CSV to JSON Converter

Paste delimited rows and get a JSON array back: one object per row keyed by the header, or plain arrays when there is no header row.

Runs in your browserFree, no sign-upLast reviewed

Settings

Results update automatically as you type.

JSON

[
  {
    "id": 1,
    "name": "Ada",
    "active": true
  },
  {
    "id": 2,
    "name": "Grace",
    "active": false
  }
]

Summary

Records
2
Columns
3

Quick answers

How do I convert CSV to JSON?
Use the first row as the keys and turn every following row into an object that pairs each key with the cell in the same position, then wrap the objects in an array. Paste the CSV above, choose the delimiter, and the JSON array is produced for you to copy or download.
How do I convert CSV to a JSON array of objects?
Keep First row is a header ticked. Two data rows under the header id,name produce [{"id": 1, "name": "Ada"}, {"id": 2, "name": "Grace"}]. Unticking the box gives an array of arrays instead, with the header row included as the first array.
Why did my leading zeros disappear in the JSON?
Number detection read the cell as a number, and JSON numbers cannot have leading zeros, so 02134 became 2134. Untick Detect numbers and booleans and every value, including ZIP codes, phone numbers and product codes, is kept as a quoted string.
Can I convert TSV to JSON?
Yes. Set Delimiter to Tab. Rows copied from Excel or Google Sheets are tab-separated on the clipboard, so this is also the setting to use when pasting cells directly from a spreadsheet.
How are commas inside a CSV field handled?
A field wrapped in double quotes is read as one value, so "Smith, John" stays together as Smith, John. Inside quotes a line break is kept as part of the value, and two double quotes in a row stand for one literal quote character.
What happens to empty cells?
An empty cell becomes an empty string, "", not null, and a missing cell at the end of a short row is filled the same way. Only a cell containing the lowercase word null is converted to JSON null, and only while Detect numbers and booleans is on. Rows in which every cell is blank are left out altogether.

About CSV to JSON Converter

This CSV to JSON converter turns each data row into one JSON object whose keys come from the first row. The default input, id,name,active followed by 1,Ada,true, becomes {"id": 1, "name": "Ada", "active": true}. Pick comma, semicolon, tab or pipe as the delimiter; the tool does not guess it. Quoted fields may contain the delimiter, line breaks and doubled quotes. With Detect numbers and booleans on, whole and decimal numbers, true, false and null become real JSON values, which also means an ID such as 007 becomes 7. Turn detection off to keep every cell as a string exactly as typed.

CSV to JSON examples for each option

Outputs are shown with Pretty print off so they fit on one line.

Header row on (default)

id,name,active / 1,Ada,true / 2,Grace,false

[{"id":1,"name":"Ada","active":true},{"id":2,"name":"Grace","active":false}]

Summary: Records 2, Columns 3.

First row is a header unticked

The same three lines

[["id","name","active"],[1,"Ada",true],[2,"Grace",false]]

Summary: Records 3, Columns 3. The first line is now data.

Detect numbers and booleans unticked

The same three lines, header on

[{"id":"1","name":"Ada","active":"true"},{"id":"2","name":"Grace","active":"false"}]

Quoted fields with a comma, a line break and quotes

name,address,note / "Smith, John","12 High St (line break) Leeds","He said ""hi"""

[{"name":"Smith, John","address":"12 High St\nLeeds","note":"He said \"hi\""}]

The two physical lines of the address are one record.

Semicolon-separated file with decimal commas

sku;price;stock / A-100;12,50;40 / B-200;7,99;0 with Delimiter set to Semicolon

[{"sku":"A-100","price":"12,50","stock":40},{"sku":"B-200","price":"7,99","stock":0}]

12,50 stays a string because only a dot is recognised as a decimal point.

Tab-separated rows pasted from a spreadsheet

city, population, capital / Paris, 2102650, true / Lyon, 522250, false, separated by tabs, with Delimiter set to Tab

[{"city":"Paris","population":2102650,"capital":true},{"city":"Lyon","population":522250,"capital":false}]

What number and boolean detection does to each kind of cell

With detection off, every cell in this table is output as a string exactly as typed, spaces included.

Cell contentsJSON with detection onWhy
4242Digits only: number
3.143.14Digits, a dot, digits: number
-2-2A leading minus sign is allowed
0077Read as a number, so the zeros are lost
021342134Same: ZIP and postal codes need detection off
90071992547409939007199254740992Too large for exact storage as a JSON number in JavaScript; the last digit changes
true / falsetrue / falseLowercase only: boolean
TRUE"TRUE"Uppercase is not converted
nullnullLowercase only: JSON null
(empty)""Empty string, not null
+15551234567"+15551234567"A plus sign is not part of the number pattern
1,200"1,200"Thousands separators are not numbers
50%"50%"Any extra character keeps it a string
1e5"1e5"Scientific notation is not converted
0x1F"0x1F"Hexadecimal is not converted
.5 or 1.".5" or "1."A digit is required on both sides of the dot
2026-10-08"2026-10-08"Dates are always strings

Quoting a cell in the CSV does not protect it: "7" and "true" are still converted to 7 and true while detection is on. Surrounding spaces are ignored when testing a cell, so a cell of 42 with spaces around it becomes 42, while text values keep their spaces.

How untidy CSV is handled

SituationInputResult
Row shorter than the headera,b,c / 1,2{"a":1,"b":2,"c":""}: missing cells become empty strings
Row longer than the headera,b,c / 3,4,5,6{"a":3,"b":4,"c":5}: the extra cell is dropped
Two columns with the same nameid,id,name / 1,2,x{"id":2,"name":"x"}: the later column wins
A column with no namea,,c / 1,2,3{"a":1,"":2,"c":3}: the key is an empty string
Blank lines between rowsa,b / (blank) / 1,2 / , / 3,4Two records; blank and all-empty rows are skipped
Header row onlya,b,c[] with Records 0, Columns 3
Wrong delimiter selectedsku;price;stock read as CommaOne key named sku;price;stock, and Columns shows 1
A quote that is never closeda,b / "1,2 / 3,4Everything after the quote becomes one value: {"a":"1,2\n3,4","b":""}
Spaces around header names First Name , Last Name Keys are trimmed to First Name and Last Name; cell values keep their spaces
Windows line endingsa,b (CRLF) 1,2 (CRLF)Read the same as Unix line endings

Flat rows in, flat objects out

CSV is a table and JSON is a tree, and this converter does not try to rebuild a tree from column names. A header such as user.name becomes the literal key "user.name"; it is not expanded into a nested user object. If you need nesting, convert first and reshape the array in code.

Keys keep the header text as written apart from trimming, so a column called First Name gives the key "First Name". Rename the columns in the source if you want camelCase or snake_case keys.

The Columns figure in the Summary counts the cells in the first row, and Records counts the items in the output array. Checking those two numbers against what you expect is the quickest way to spot a wrong delimiter or an unclosed quote before you use the result.

What this converter does not do

  • Read a file from disk. Input is pasted text; open the .csv in a text editor or spreadsheet and copy the contents.
  • Detect the delimiter. Comma is assumed until you change it.
  • Use other quote characters. Only the double quote wraps a field; single quotes are ordinary text.
  • Build nested objects or arrays from dotted or bracketed header names.
  • Convert dates, currencies or numbers with decimal commas. They are output as strings.
  • Choose types per column. Detection is on or off for the whole table.

Step by step

  1. 1

    Paste your rows into CSV data. For data copied from a spreadsheet, which arrives tab-separated, set Delimiter to Tab.

  2. 2

    Set Delimiter to match the file: Comma, Semicolon, Tab or Pipe. If Columns in the Summary shows 1 for a table with several columns, the wrong delimiter is selected.

  3. 3

    Leave First row is a header ticked to get objects keyed by column name, or untick it to get one array per row.

  4. 4

    Untick Detect numbers and booleans if any column holds codes with leading zeros, long IDs or anything else that must stay text.

  5. 5

    Leave Pretty print on for indented output or turn it off for a single line, then copy the JSON or download it as data.json.

Common questions

Is my CSV uploaded to a server?
No. Parsing and conversion run as JavaScript in your browser, so the rows you paste are not sent anywhere. That matters for exports containing customer or financial data.
What if my CSV has no header row?
Untick First row is a header. Each row is then output as a JSON array of values, and the whole result is an array of arrays. If you want objects anyway, add a line of column names at the top and leave the box ticked.
Why is everything in one column?
The Delimiter setting does not match the file. A semicolon-separated export read as comma-separated produces a single key holding the whole header line. Change Delimiter until Columns in the Summary matches the number of columns you expect.
Why do CSV files from Excel use semicolons?
In regions where the comma is the decimal separator, Excel writes CSV with semicolons between fields so that a price such as 12,50 does not split in two. Choose Semicolon for those files. The decimal-comma values will come through as strings.
Does the converter follow RFC 4180?
It follows the quoting rules described there: fields may be wrapped in double quotes, a quoted field can contain the delimiter and line breaks, and a doubled quote inside a quoted field is one literal quote. It is more lenient than the specification about rows of unequal length, which it pads or trims.
Is there a size limit?
No fixed limit is set. The conversion runs in the page, so very large pastes are limited by your browser's memory and may make the tab slow. For files of many megabytes, a command-line tool or a short script is a better fit.
How do I go the other way, from JSON to CSV?
Use the JSON to CSV Converter on this site, which takes an array of objects and writes a header row plus one line per object.

Looking for something else? Browse all developer tools or see every tool.