CSV to JSON
Convert CSV into a JSON array of objects, with header detection and optional type inference.
What is CSV to JSON Conversion?
CSV (Comma-Separated Values) stores tabular data as plain text rows and columns, with the first row usually naming the fields. JSON represents the same data as an array of objects — one object per row, with each column becoming a key. Converting CSV to JSON means parsing those rows and columns back into structured, typed data that APIs, scripts, and JSON-based tools can work with directly.
The parsing itself has real edge cases: a field can contain a comma or a line break as long as it's wrapped in quotes, and a literal quote inside a quoted field is written as two quotes in a row (""). A naive split(',') breaks on data like that — this tool follows the RFC 4180 rules that real CSV exports (Excel, Google Sheets, most APIs) use.
This page converts CSV to JSON entirely in your browser. Paste CSV — an exported report, a spreadsheet, a data dump — or drag and drop a .csv file, and download the resulting JSON array.
Why Convert CSV to JSON?
Importing Spreadsheet Data
Data collected in Excel or Google Sheets often needs to become JSON before it can be sent to an API, seeded into a database, or used as test fixtures.
Completing the Round Trip
Paired with JSON to CSV, this closes the loop — export JSON as a spreadsheet for someone to edit, then bring their edits back in as JSON.
Working with Exported Reports
Analytics platforms, payment processors, and admin panels frequently only offer CSV export. Converting to JSON makes that data scriptable again.
Real Types, Not Just Strings
Raw CSV is all text. Type inference means an age column comes back as a number and an active column as a boolean, ready to use without a manual parsing step.
Example
With type inference on: id and the plain zip value become numbers, the UK postcode fragment 0161 stays a string to preserve its leading zero, active becomes a real boolean or null for the missing value, and the embedded comma and escaped quote in row two are parsed correctly.
id,name,city,zip,active
1,Ada Lovelace,"London, UK",SW1,true
2,"Grace ""Amazing"" Hopper",New York,10001,false
3,Alan Turing,Manchester,0161,[
{
"id": 1,
"name": "Ada Lovelace",
"city": "London, UK",
"zip": "SW1",
"active": true
},
{
"id": 2,
"name": "Grace \"Amazing\" Hopper",
"city": "New York",
"zip": 10001,
"active": false
},
{
"id": 3,
"name": "Alan Turing",
"city": "Manchester",
"zip": "0161",
"active": null
}
]Features
RFC 4180 Parsing
Handles quoted fields, commas and line breaks inside quotes, and doubled "" as an escaped quote — the same rules real spreadsheet exports use.
Header Row Detection
Uses the first row as field names by default, or turns it off to auto-generate column1, column2… for headerless CSV.
Type Inference
Numbers and true/false/empty values become real JSON numbers, booleans, and nulls instead of staying as strings — toggle it off to keep everything as text.
Upload a File
Drag and drop or upload a .csv file to convert it directly, no copy-pasting required.
Download JSON
Save the result as a standalone .json file for use in your project.