Skip to content
Buy me a coffee
Converters

CSV to JSON Converter

Convert a CSV file into a JSON array. Each line becomes an object and each column a property, using the header line as property names.

0 characters · 0 lines
Option 2: Or upload your CSV file
Ctrl + Enter

CSV to JSON conversion rules

  • The result is a JSON array with one object per CSV line; each column becomes a property of the object.
  • When the first line contains the header, its cells are used as property names (trimmed; an empty header cell becomes columnN, duplicated names get a numeric suffix). Without a header, the properties are named column1, column2
  • Lines with fewer cells than columns get null for the missing properties; lines with more cells get extra columnN properties.
  • Empty cells become null or empty strings, depending on the option.
  • Every value is a string unless "Convert numbers and booleans automatically" is checked: 42, -3.5, 1e3 then become JSON numbers and true/false booleans. Values with leading zeroes (007) stay strings so that identifiers are not damaged.
  • "Output an array of arrays" produces [["1","Scott"],["2","Maria"]] instead of objects – compact and ideal for spreadsheets or charting libraries.
  • Values enclosed in the quote character may contain the delimiter, line breaks and doubled quotes (""), as specified by RFC 4180. Blank lines are ignored; a UTF-8 BOM is stripped.

Example

Input CSV:

id,first_name,last_name,email,age,active
1,Scott,Fargus,[email protected],34,true
2,Maria,"Gonzalez, Ruiz",[email protected],,false

Output JSON (with "Convert numbers and booleans automatically" checked):

[
   {
      "id": 1,
      "first_name": "Scott",
      "last_name": "Fargus",
      "email": "[email protected]",
      "age": 34,
      "active": true
   },
   {
      "id": 2,
      "first_name": "Maria",
      "last_name": "Gonzalez, Ruiz",
      "email": "[email protected]",
      "age": null,
      "active": false
   }
]