Output appears here.
CSV to JSON turns spreadsheet rows into a JSON array of objects, using the header row as keys. It detects the delimiter, converts numbers and booleans, and can rebuild nested objects from dotted column names. Use it to prepare fixtures, seed data or API payloads from an Excel export. Everything runs in your browser; nothing is uploaded.
How to convert CSV to JSON
- Paste CSV, drop a
.csv,.tsvor.txtfile, or press ⌘/Ctrl O. The delimiter is detected automatically. - Check First row is header and Convert numbers & booleans, and turn on Rebuild nested objects if your columns are named like
user.name. - Copy the JSON with ⌥/Alt C, download it with ⌘/Ctrl S, or use a Next action: Preview as table, format the JSON or convert it to YAML.
Examples
Users export
A comma-separated export with a header row. Numeric IDs become numbers and true/false become booleans.
id,name,email,active
1,Asha Rao,[email protected],true
2,Ben Ortiz,[email protected],falseResult:
[
{
"id": 1,
"name": "Asha Rao",
"email": "[email protected]",
"active": true
},
{
"id": 2,
"name": "Ben Ortiz",
"email": "[email protected]",
"active": false
}
]Semicolon-separated file with decimal commas
A European-style export. The semicolon is detected ("Detected delimiter: ;"), and prices written with a decimal comma stay strings rather than being misread.
sku;product;price
A-100;Keyboard;49,90
A-101;Mouse;19,50Result:
[
{
"sku": "A-100",
"product": "Keyboard",
"price": "49,90"
},
{
"sku": "A-101",
"product": "Mouse",
"price": "19,50"
}
]Rebuilding nested objects
With Rebuild nested objects on, user.name becomes a nested object and tags.0, tags.1 become an array. The ZIP code keeps its leading zero.
id,user.name,user.city,tags.0,tags.1,zip
1,Asha,Pune,admin,beta,07302Result:
[
{
"id": 1,
"user": {
"name": "Asha",
"city": "Pune"
},
"tags": [
"admin",
"beta"
],
"zip": "07302"
}
]Options explained
- Delimiter — the column separator: Auto-detect sniffs the first lines, or force Comma, Semicolon, Tab or Pipe when detection guesses wrong.
- First row is header — uses the first row as object keys; when off, every row, including the first, becomes an array of values.
- Convert numbers & booleans — turns
"42"into42,"true"intotrueandnullintonull; values with leading zeros or more than 15 characters stay strings so IDs are not damaged. - Rebuild nested objects — splits column names on dots, so
user.namebecomes{"user": {"name": …}}and numeric parts such astags.0become array positions. - Indent — the whitespace used for each nesting level in the JSON output: 2 spaces, 4 spaces or a tab.
Troubleshooting CSV to JSON
Quoted field unterminated
A field opens with " and never closes, so the rest of the file would be swallowed into one value. The error gives the row. Close the quote, and write a literal quote inside a quoted field as two quotes: "said ""hi""".
"Row N has X fields; the header has Y"
That row has more or fewer values than the header, usually because a value contains the delimiter without being quoted. Missing values become empty strings and extra values are dropped, so fix the row by quoting the value that contains the delimiter.
Duplicate column names
Two columns share a name, and the notice lists them. Each object can hold a key only once, so the later column's value wins. Rename one of the headers before converting.
The wrong delimiter was detected
Detection looks at the first lines, and a file with commas inside text and semicolons between fields can mislead it. Set Delimiter explicitly.
Numbers I wanted as text became numbers
Plain integers and decimals are converted when Convert numbers & booleans is on. Turn it off to keep every value as a string, then convert specific fields in your code.
A flat column disappeared with Rebuild nested objects
A file can contain both user and user.name. One key cannot hold a plain value and a nested object at once, so the nested columns win and the notice "Column user also has nested columns; the nested values win." names the column that was dropped. Rename the flat column if you need both values.
Empty header cells
A column with no name is given a generated key such as column3, so no data is lost. Add a proper header in the source to control the key.
FAQ
Is it safe to convert spreadsheets with personal data?
Yes. The CSV is parsed in your browser inside an isolated frame that blocks network requests, so names, emails and account data never leave your device, and nothing is stored on a server. Settings are remembered locally; the input is kept only if you turn on "Remember my last input".
Can I convert Excel files to JSON?
Save or export the sheet as CSV first — in Excel, use Save As and choose CSV UTF-8 — then paste or drop the file here. Excel's byte-order mark is removed automatically. Formulas are exported as their calculated values, which is what ends up in the JSON.
Why do some numbers stay as strings?
To protect values that only look numeric. 07302 keeps its leading zero, IDs longer than 15 characters are not rounded, and decimal commas such as 49,90 are not misread. Everything else that is a plain number, true, false or null is converted while Convert numbers & booleans is on.
How do I get an array of arrays instead of objects?
Turn off First row is header. Each row, including the header, becomes an array of values in column order. This is useful for charting libraries and for CSV files that have no header row at all.
Does it handle quoted fields with commas and line breaks?
Yes. A field wrapped in double quotes can contain the delimiter, line breaks and doubled quotes, following RFC 4180, and it is read as a single value. Only an unclosed quote is treated as an error.
Can I preview the rows before converting?
Yes. Preview as table shows the parsed rows as a table, which is the quickest way to confirm the delimiter and header were read correctly. For a closer look or to clean up the file itself, open it in the CSV Viewer & Formatter.
Related tools
To go the other way, convert JSON to CSV. The guide How nested JSON becomes CSV columns explains the dotted-column convention used by Rebuild nested objects. For tab-separated files, TSV to CSV converts between the two.
Related tools
Guides
- How Nested JSON Becomes CSV Columns — How do I convert nested JSON to CSV?