CSV to JSON
Convert CSV text to JSON.
About this tool
Paste CSV with a header row and get a JSON array of objects, one per line, keyed by the header names. Quoted fields with commas are handled. Every value comes out as a string, so numbers and booleans are not converted.
How to use
How it works
The CSV is parsed with Papa Parse using the first row as the header and skipping empty lines. Each remaining row becomes an object whose keys are the headers. Quoted fields may contain commas and doubled quotes. The result is printed with two-space indentation.
Worked example
A quoted comma and booleans
- Input
- id,name,active 1,Ada,true 2,"Lin, Jr.",false
- Output
- [ { "id": "1", "name": "Ada", "active": "true" }, { "id": "2", "name": "Lin, Jr.", "active": "false" } ]
- Walkthrough
- "Lin, Jr." stays one field because it is quoted. Note that 1 and true come out as the strings "1" and "true".
Limitations
- All values are strings. Convert numbers and booleans in your own code if you need real types.
- The delimiter is detected automatically, but the first row is always the header, so a file without headers turns its first data row into keys.
Questions
How do I convert CSV to JSON?
Why are my numbers strings in the JSON?
Does it handle commas inside quotes?
Does CSV to JSON need a header row?
Features
- Header row becomes keys
- Quoted commas handled
- Empty lines skipped
- Runs in your browser
Guides
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
SQL Tutorial - Full Database Course
freeCodeCamp.org
JSON often lands next to SQL exports when debugging data pipelines.
Watch on YouTubeInspect Network Activity - Chrome DevTools 101
Chrome for Developers
Debugging payloads you paste into JSON and JWT tools.
Watch on YouTube
- Introducing JSON
json.org
Canonical JSON grammar—handy when a formatter rejects a trailing comma.
- MDN Web Docs
MDN
Primary reference for web APIs these developer tools touch.