CSV to JSON

Convert CSV text or files into JSON records.

CSV to JSON converts comma-separated text into a JSON array of objects, using the first row as the header. Paste CSV or open a .csv file and the result appears on the right as pretty-printed JSON with two-space indentation. It suits developers building fixtures, seeding databases or turning spreadsheet exports into API-ready data.

What is CSV?

CSV (Comma-Separated Values) is a plain-text table format described informally in RFC 4180. Each line is a row and commas separate the fields. Fields containing commas, quotes or line breaks are wrapped in double quotes, and a quote inside a quoted field is written as two quotes. CSV carries no data types, so every value is simply text. Converting to JSON turns each row into an object keyed by the header names, which makes the data easy to use in code, but the values stay strings unless you convert them yourself.

How to use CSV to JSON

  1. Add CSV Paste into the CSV box or use the file load button for a .csv file.
  2. Convert Convert to JSON is the selected operation and runs automatically as you type.
  3. Check the output Read the JSON array in the output pane; an error message appears below if the quotes are malformed.
  4. Save it Use Copy or Download to get data.json.

Frequently asked questions

Why are my numbers strings?

CSV has no types, and the converter keeps every cell as text so nothing is changed silently. Convert fields to numbers or booleans in your own code if you need them.

Does it support other delimiters?

This tool uses a comma. For tab-separated data use TSV to JSON. The CSV Viewer can auto-detect semicolons and pipes for browsing.

What happens to empty cells?

They become empty strings. Rows with fewer cells than headers simply omit the missing keys.

What if headers repeat?

With duplicate header names, later columns overwrite earlier ones in the object, so rename headers to be unique before converting.

Is the output always an array?

Yes. Each data row becomes one object in a JSON array, formatted with two-space indentation.