Search tools

CSV to JSON

Turn CSV with a header row into a JSON array of objects.

Tables

Convert

How the CSV is read

  • A real parser: Fields are read character by character, following the CSV rules for quotes, so "Smith, John" stays one value.
  • Values stay text: Every value becomes a JSON string. CSV has no types, and guessing goes wrong with postcodes, phone numbers and IDs with leading zeros, so "007" stays "007". Convert types in your program, where you know what each column means.
  • Clear about fixes: Short rows are filled with empty values and empty or repeated column names get unique names; the page tells you when either happens.

Frequently asked questions

How does automatic delimiter detection work?

The first lines are read with comma, semicolon and tab; the delimiter that gives every row the same number of columns wins. If none does, choose it yourself.

What if my CSV has no header row?

Turn off "First row has the column names". The columns are then named column_1, column_2 and so on.