CSV to JSON Converter
Paste CSV where the first row is your headers and get back a pretty-printed JSON array of objects — quoted fields with embedded commas handled — all in your browser.
[
{
"name": "Ada",
"role": "Engineer",
"years": "7"
},
{
"name": "Grace",
"role": "Admiral, USN",
"years": "40"
}
]How it works
The first line of your CSV is read as the column names. Every line after that becomes one object, matching each cell up with its header, so a row like 'Ada,Engineer' turns into a name/role pair.
Parsing CSV by hand is trickier than splitting on commas, because a field can be quoted and contain its own commas or newlines. This tool follows the quoting rules: text inside double quotes is kept intact, and a doubled quote inside a quoted field becomes a single literal quote.
The result is printed as a formatted JSON array with two-space indentation, so it's easy to read and drop straight into code. If a row has fewer cells than there are headers, the extra keys are filled with empty strings rather than left undefined.
Frequently asked questions
Can a field contain a comma?
Yes, as long as it's wrapped in double quotes — like "Admiral, USN". The parser respects the quotes and keeps that comma inside the value instead of splitting on it.
Are all values strings?
Yes. CSV has no type information, so every cell comes through as a string. If you need numbers or booleans, convert them in your own code after parsing.
What if a row is shorter than the header?
Missing trailing cells become empty strings, so every object still has the full set of keys. That keeps the shape consistent for whatever consumes the JSON.