Skip to main content

CSV to JSON

Convert CSV rows into a JSON array. Supports comma, semicolon, tab and pipe delimiters.

Built and tested by Muhammad Irfan Liaqat · Updated

CSV to JSON: key facts

  • Converts CSV to JSON with comma, semicolon, tab or pipe delimiters
  • With a header row you get an array of objects; without one, an array of arrays
  • All values are output as strings, and fields wrapped in double quotes can contain the delimiter
  • Copy the JSON or download it as data.json; the data stays in your browser

How CSV rows become JSON

Paste CSV data and the converter turns it into JSON as you type. With First row is header turned on, each row becomes an object whose keys come from the header row; with it off, each row becomes an array of values. Comma, semicolon, tab and pipe delimiters are supported, and the result can be copied or downloaded as a .json file.

A field wrapped in double quotes may contain the delimiter, so "Smith, John" stays a single value, but line breaks inside a field are not supported. Every value comes out as a string, numbers and true/false included, so convert types in your own code if you need them. Spreadsheet programs in many European locales export CSV with semicolons, because they use the comma as a decimal separator; choose Semicolon if every row ends up in one field.

How to convert CSV to JSON

  1. 1Paste your CSV data into the input box
  2. 2Choose the delimiter: comma, semicolon, tab or pipe
  3. 3Turn First row is header on or off
  4. 4Copy the JSON or click Download to save it

Frequently Asked Questions

Which delimiters are supported?
Comma, semicolon, tab and pipe (|).
Does it handle quoted fields?
Yes, a quoted field can contain the delimiter. Line breaks inside a quoted field are not supported; each line is read as a new row.
Why are my numbers in quotes?
CSV has no data types, so every value is output as a string. Convert numbers and true/false values in your code after parsing.
Why is all my data in one column?
The file probably uses a different delimiter. Files exported from Excel in many European locales use semicolons; files copied from a spreadsheet often use tabs.
Is my data uploaded?
No. The conversion runs in your browser and the data never leaves your device.
How do I convert an Excel sheet to JSON?
Select the cells in Excel or Google Sheets, copy them, paste them here and choose the Tab delimiter, because copied cells are tab-separated. You can also save the sheet as CSV and paste the file's contents.
What happens to empty or missing values?
A missing value becomes an empty string. If a row has more values than there are headers, the extra values are dropped, and blank lines are skipped.
Can it convert JSON back to CSV?
No, it only converts CSV to JSON. To check or tidy the JSON it produces, use the JSON formatter.

Related Tools

Guides