CSV to JSON

Convert CSV text to JSON.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

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

1
Step 1
Paste CSV text whose first line holds the column names.
2
Step 2
Press Run.
3
Step 3
Copy the JSON array or download it.

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?
Paste the CSV with a header row and press Run. You get an array of objects, one per data row.
Why are my numbers strings in the JSON?
The converter does not guess types, so every value is a string. Cast them afterwards.
Does it handle commas inside quotes?
Yes. A quoted field such as "Lin, Jr." stays a single value.
Does CSV to JSON need a header row?
Yes. The first line is used for the keys.

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 YouTube
  • Inspect 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.