CSV to JSON Converter — Rows to a JSON Array Online
Turn a CSV with a header row into a clean JSON array of objects, with quoted commas handled correctly. Paste a spreadsheet export and copy code-ready JSON.
Examples
name,age,city Ada,36,London Linus,54,Helsinki
[
{ "name": "Ada", "age": "36", "city": "London" },
{ "name": "Linus", "age": "54", "city": "Helsinki" }
]With the header toggle on, each column name becomes a key on every row object.
product,note Pen,"red, fine tip"
[
{ "product": "Pen", "note": "red, fine tip" }
]The comma inside the quotes stays part of the value instead of starting a new column.
How to use this tool
- Paste your CSV into the input box.
- Choose whether the first row contains headers.
- Click Convert to JSON.
- Copy or download the JSON result.
What is CSV to JSON?
CSV to JSON parses comma-separated values and produces a JSON array. When the first row is treated as a header, every column name becomes an object key and each following row becomes one object — the shape most APIs and JavaScript code expect. The parser follows RFC 4180 conventions, so fields wrapped in double quotes keep any commas, line breaks, or escaped quotes inside them instead of being split into extra columns.
Specifications
| Input format | Comma-separated values (RFC 4180 style) |
|---|---|
| Output | JSON array of objects (or arrays without a header) |
| Quoting | Double-quoted fields; "" escapes a literal quote |
| Value types | All values are strings (CSV is untyped) |
Tips & gotchas
- Turn the header toggle off when there is no header row — each row then becomes an array of values instead of a named object.
- Numbers come through as JSON strings ("36"), not numbers, because CSV has no types; cast them in your code if you need real numbers.
- Wrap any field that contains a comma, quote, or newline in double quotes, and escape an inner quote by doubling it ("").
- A trailing blank line at the end of the CSV can create an empty object — trim it before converting.
Features
- Convert CSV to a JSON array of objects
- Toggle whether the first row is a header
- Quoted fields keep embedded commas and quotes
- Pretty-printed JSON output
- Copy the JSON or download it as a .json file
When to use it
- Loading a spreadsheet export into a JavaScript app or test fixture.
- Posting tabular data to a REST API that only accepts a JSON body.
- Seeding a database or mock server from a CSV someone emailed you.
- Eyeballing a CSV's structure as objects to spot a misaligned column.
This tool runs in your browser. Your files and text are not uploaded to our servers, and we do not store your input.
Frequently asked questions
What if my CSV has no header row?+
Turn off the header option and each row becomes an array of values instead of a named object.
Does it handle quoted values and commas?+
Yes. Fields wrapped in double quotes keep any commas, line breaks, or doubled quotes inside them, so they are not split into extra columns.
Why are my numbers wrapped in quotes?+
CSV has no data types, so every value is read as text and emitted as a JSON string. Convert the fields you need to numbers in your own code after parsing.
Related tools
Related guides
Looking for more Developer Tools?
Browse the full collection of free, browser-based tools.