Free exact browser converter
CSV to JSON
Parse CSV, semicolon or tab-separated records into a JSON array. Support quoted delimiters, escaped quotes and multiline fields while preserving leading zeros.
Interactive tool
CSV to JSON
Ready
Choose a clear output representation.
Detailed conversion guide
How CSV to JSON Works
The parser reads records with quoted delimiters and multiline fields. A doubled quote inside a quoted cell represents one literal quote. It then maps each record to the header keys.
Cells stay strings: 001 remains "001" and true remains "true". This avoids guessing types or rounding long numeric identifiers.
| Input | Output | Meaning |
|---|---|---|
name,code
Ada,001
Lin,002 | [
{
"name": "Ada",
"code": "001"
},
{
"name": "Lin",
"code": "002"
}
] | Default example |
a
x | [
{
"a": "x"
}
] | Boundary example |
JavaScript Example
Runnable example for the default sample. The tool also validates its full input contract.
const headers=["name","code"];
// Rows shown here are already parsed from CSV.
const rows=[["Ada","001"],["Lin","002"]];
const json=JSON.stringify(rows.map(r=>Object.fromEntries(headers.map((h,i)=>[h,r[i]]))),null,2);Formats, Boundaries and Limitations
Rows must have the same number of cells as the header. Empty or duplicate headers, unterminated quotes and characters after a closing quote are rejected.
A leading UTF-8 BOM is removed from the header. A final line ending does not add a blank record. The converter does not flatten or infer nested object structures.
Related converters
More Text and Encoding Tools
Choose the tool that matches your text or byte workflow.