Change CSV to JSON
Paste CSV text and instantly convert it to a JSON array of objects with first-row headers as keys
JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is built on two structures: a collection of name/value pairs (objects) and an ordered list of values (arrays). JSON is the most widely used format for APIs, configuration files, and data storage in modern web applications.
Paste CSV rows, hit Convert, and grab a ready-to-use JSON array — headers become keys, each row becomes an object. Quoted fields, commas inside values, and empty cells are all parsed correctly. And everything runs in your browser. Nothing gets uploaded.
How It Works
The parser reads your CSV character by character, respecting quoted fields and escaped double-quotes. It splits the first row into header names, then maps each subsequent row into a JSON object using those headers as keys. The result is a standard JSON array you can drop straight into any application or API call.
Examples
Simple contact list
A basic three-column spreadsheet export — the kind you deal with every week.
name,email,city
Alice,[email protected],Denver
Bob,[email protected],Austin
[
{"name":"Alice","email":"[email protected]","city":"Denver"},
{"name":"Bob","email":"[email protected]","city":"Austin"}
]
Quoted fields with commas inside
This is the one that trips people up. Company names with commas, addresses with extra punctuation — the parser handles all of it.
company,revenue,notes
"Acme, Inc.",540000,"Q1 results, strong"
GlobalTech,280000,Pending review
[
{"company":"Acme, Inc.","revenue":"540000","notes":"Q1 results, strong"},
{"company":"GlobalTech","revenue":"280000","notes":"Pending review"}
]
Product inventory with empty fields
Real-world data is messy. Some rows have blank cells — the converter fills those with empty strings instead of crashing.
sku,name,color,stock
W-100,Widget,Blue,350
W-101,Gadget,,120
W-102,Sprocket,Red,
[
{"sku":"W-100","name":"Widget","color":"Blue","stock":"350"},
{"sku":"W-101","name":"Gadget","color":"","stock":"120"},
{"sku":"W-102","name":"Sprocket","color":"Red","stock":""}
]
Who Uses This
Converting CSV exports into JSON payloads for REST APIs or database seed files.
Reformatting spreadsheet data for tools that only accept JSON input, like D3.js or chart libraries.
Turning homework datasets from CSV into JSON for web development projects and assignments.
Converting exported task lists or reports into JSON for importing into project management APIs.
Common Mistakes
The first row is always treated as keys. If you paste data without headers, your first record becomes the key names — and you get garbage output. Add a header row before converting.
A field like Smith, Jr. without quotes gets split into two separate fields. If your source data has commas in values, wrap those fields in double quotes before pasting.
Every value comes out as a string — "42" not 42. This is intentional so your data stays exactly as written. If you need typed values, parse them in your code after converting.
Technical Details
- Processing: 100% client-side — nothing leaves your browser
- CSV Parsing: RFC 4180 compliant (quoted fields, escaped quotes, CRLF/LF)
- Output Format: JSON array of objects with optional pretty-print indentation
- Browser Support: Chrome, Firefox, Safari, Edge
Frequently Asked Questions
How do I convert a CSV file to JSON?
Open the CSV file in any text editor, copy the contents, and paste them into the input box above. Hit Convert and you'll get a JSON array instantly. You can also just drag data straight out of Excel or Google Sheets — it copies as tab-separated or CSV text that the parser picks up.
Can CSV to JSON handle large files?
It works well for files up to a few thousand rows. Since everything runs in your browser, very large files (50,000+ rows) might slow things down depending on your machine. For massive datasets, a command-line tool or scripting language is a better fit.
Does this converter keep my data private?
Yes. Your CSV data is processed entirely in the browser using JavaScript. Nothing is sent to any server — not even temporarily. Close the tab and it's gone.
Why are all my JSON values strings instead of numbers?
CSV doesn't have data types — everything is plain text. The converter preserves values exactly as they appear rather than guessing which ones should be numbers or booleans. You can parse types in your own code after converting if you need them.
What's the difference between CSV to JSON and CSV to JSON array?
They're usually the same thing. "CSV to JSON" almost always means converting into an array of objects where each row is one object. Some tools offer a "CSV to JSON array of arrays" option — that gives you nested arrays without keys. This tool outputs the object format, which is what most APIs and applications expect.