CSV to JSON Converter

Turn CSV rows into a JSON array

Input (CSV)

Output (JSON)

CSV to JSON Converter guide

CSV exports from spreadsheets and databases are easy to produce but awkward to use in code. This converter turns each row into a JSON object, keyed by the header row, so you can feed the data to a script or API.

How it converts

  • Header row. The first line gives the key names.
  • Rows. Every following line becomes one object in a JSON array. Empty lines are skipped.
  • Values. Every value stays a string, including numbers, so "31" is not turned into 31. Convert types in your code if you need them.

Example

name,age
Ann,31
Raj,27

// converts to

[
  { "name": "Ann", "age": "31" },
  { "name": "Raj", "age": "27" }
]

Frequently asked questions

Why are my numbers in quotes?
CSV has no types, so every value is read as text. Keeping them as strings avoids surprises such as zip codes losing their leading zero.
Does it handle commas inside values?
Yes. Values wrapped in double quotes, such as "Doe, John", are read as one field.
Does my CSV need a header row?
Yes. The first row is always used for the key names.