CSV to JSON converter

Convert CSV text to a JSON array. The first row is used as headers. Numbers and booleans are automatically typed. Runs entirely in your browser.

CSV input

JSON output

How CSV to JSON works

The first row is the header row, and its names become the keys of each JSON object. Each following row becomes one object. Values that look like numbers become JSON numbers, and true and false become booleans. Empty cells stay as empty strings.

Example

name,age,active Ada,36,true Ben,,false

is equivalent to:

[ {"name": "Ada", "age": 36, "active": true}, {"name": "Ben", "age": "", "active": false} ]

Limitations

  • Fields are split on every comma. A quoted field that contains a comma, such as "Smith, Jane", is split into two cells.
  • Leading zeros are lost, so 007 becomes 7.
  • A row with fewer cells than headers gets empty values for the missing cells. Extra cells are ignored.