How to Convert CSV to JSON
To convert CSV to JSON, paste the CSV into a converter, confirm the delimiter and whether the first row is a header, then run it. Each remaining row becomes a JSON object keyed by the header names. Watch for quoted fields containing commas, and decide whether numeric-looking values should stay strings or be converted to numbers.
CSV to JSON Converter
Turn CSV rows into a clean JSON array of objects.
CSV is the format every system exports and no two systems agree on. The delimiter may be a comma, a semicolon or a tab; fields may or may not be quoted; a header row may or may not be present. Converting to JSON means making those three decisions explicitly rather than hoping a parser guesses correctly.
The one that catches people is quoting. A field containing a comma must be wrapped in quotes, and a naive split on commas will tear it in half. Any converter worth using implements RFC 4180 quoting rather than splitting on the delimiter.
Step by step
-
Paste or upload the CSV
Include the header row if the file has one. Keep the file intact rather than pasting a fragment, so quoting and row structure stay consistent.
-
Set the delimiter
Comma is the default. Choose semicolon for exports produced in locales where the comma is a decimal separator, or tab for TSV data. Getting this wrong produces one giant column.
-
Confirm the header setting
With headers on, the first row becomes the object keys. With it off, the converter generates positional keys such as column_1, and the first row is treated as data rather than being silently consumed.
-
Decide on type conversion
Type conversion turns "42" into 42 and "true" into a boolean. Leave it off for identifiers, postcodes, phone numbers and product codes, where a leading zero is meaningful and must stay a string.
-
Check the first object
Look at the first record in the output before trusting the rest. Almost every conversion problem — wrong delimiter, off-by-one headers, a stray byte-order mark on the first key — is visible in record one.
-
Copy or download
Copy the array for pasting into code, or download it as .json when it is large enough that the clipboard becomes unwieldy.
Example
Note the quoted field containing a comma: it stays a single value.
CSV
id,name,city
1,"Smith, John",Leeds
2,Ada Lovelace,London
JSON
[
{
"id": "1",
"name": "Smith, John",
"city": "Leeds"
},
{
"id": "2",
"name": "Ada Lovelace",
"city": "London"
}
]
Frequently asked questions
What happens to commas inside a field?
Why did my leading zeros disappear?
My whole file became one column. Why?
What if rows have different numbers of fields?
Is my data uploaded?
Tools used in this guide
All tools →- CSV to JSON Converter Turn CSV rows into a clean JSON array of objects. In your browser
- JSON to CSV Converter Flatten a JSON array into spreadsheet-ready CSV. In your browser
- CSV to TSV Converter Convert comma-separated data to tab-separated values. In your browser
- JSON Formatter Beautify, validate and sort JSON with precise error messages. In your browser
Related guides
All guides →Last reviewed .