CSV to JSON Converter

Turn CSV with a header row into a JSON array of objects, ready for APIs, scripts and test fixtures.

JSON

Convert CSV rows to JSON objects

CSV exports from Excel, Google Sheets or a database are easy to produce but awkward to use in code. This converter reads the first line as column names and turns every following line into a JSON object with those keys, giving you an array you can send to an API or load in a script. Quoted fields with commas, quotes or line breaks are parsed correctly, empty lines are skipped, and the delimiter is detected automatically, so semicolon- and tab-separated files work too.

How to use

  1. Make sure the first line of your CSV contains the column names.
  2. Paste the CSV; the JSON array appears in the output editor, and malformed rows are reported under the input.
  3. Copy the JSON, or press Swap to convert it back to CSV.

Frequently asked questions

Why are numbers and booleans strings in the output?
CSV has no data types, so every cell is kept as text. This avoids losing data such as leading zeros in IDs or phone numbers. Convert specific fields to numbers in your code where needed.
Does it work with semicolon- or tab-separated files?
Yes. The delimiter is detected from the content, so files exported with semicolons, as Excel does in many European locales, or with tabs convert without extra settings.
What if my CSV has no header row?
The first line is always used as the keys. Add a line with column names at the top before converting, otherwise the first data row becomes the keys.

Example: CSV to JSON

CSV input

id,product,price,in_stock
1,Keyboard,49.99,yes
2,Mouse,19.99,no
3,"Monitor, 27""",229.00,yes

JSON output

[
  {
    "id": "1",
    "product": "Keyboard",
    "price": "49.99",
    "in_stock": "yes"
  },
  {
    "id": "2",
    "product": "Mouse",
    "price": "19.99",
    "in_stock": "no"
  },
  {
    "id": "3",
    "product": "Monitor, 27\"",
    "price": "229.00",
    "in_stock": "yes"
  }
]

Other conversions