I need to convert a CSV file to JSON
Move data between a spreadsheet and code without a script. Header row becomes keys, each row becomes an object.
To convert CSV to JSON, use a CSV-to-JSON tool: it reads the header row as keys and turns each row into an object, giving you a JSON array ready for an API or app. Paste or drop your file and copy the result. Ours parses everything in your browser, so your data is never uploaded, and it converts back to CSV too.
4 tools for this
Each one is free, private and runs in your browser. No sign-up, no watermark.
CSV to JSON
Convert CSV to JSON in your browser. Paste or drop a.csv and get a clean array of objects or arrays with a header toggle, optional number/boolean type inference and pretty or minified output. Nothing is uploaded.
JSON to CSV
Convert JSON to CSV in your browser. Paste an array of objects and get a spreadsheet-ready CSV with a header row, automatic flattening of nested keys, and a choice of comma, semicolon or tab delimiter. Copy or download instantly. Nothing is uploaded.
JSON Formatter
Format, validate and minify JSON in your browser with pinpoint error line + column, jump-to-error, key sorting and live editing: nothing is uploaded.
CSV Viewer
View CSV files online as a fast, sortable spreadsheet, search across every cell, sort any column, and read a live per-column profile with row/column counts and numeric stats. Read-only, so you never touch the data. Nothing is uploaded.
How to fix it
Follow these steps and you'll have it sorted in a couple of minutes.
- 1
Add your CSV
Paste the CSV or drop the file into the CSV to JSON tool. It parses in your browser.
- 2
Map the header row
The first row becomes the JSON keys. Each following row becomes one object in the array.
- 3
Get clean JSON
Copy the JSON array. Run it through the Formatter if you want it pretty-printed.
- 4
Convert back if needed
Need a spreadsheet again later? Use JSON to CSV to reverse it.
- A messy header row, spaces, duplicates or blank columns become awkward JSON keys. Clean the header first.
- Commas inside a field that aren't quoted, which shift the columns. Make sure text fields with commas are wrapped in quotes.
- Assuming numbers stay numbers. Check whether values that look numeric should be strings for your target system.
Frequently asked questions
More problems we solve
Ran into one of these too? Here's the fix.
- My JSON is invalid and I can't find the error'Unexpected token' almost always means one stray character. A validator points straight at it so you're not hunting by eye.
- My code or data is minified and unreadableOne long line of minified everything? Pick the matching formatter and get properly indented, readable code back.
- My site has no meta tags or preview when sharedA blank preview costs you clicks. Add the right tags so Google and social show a proper title, description and image.
Keep exploring
Problems we solve
From the blog
Compare formats
By file type
Common tasks
Ready? Start with CSV to JSON
Free, private and instant: everything runs in your browser.