CSV to JSON
Convert CSV or spreadsheet exports into a JSON array of objects, with headers as keys and types inferred per cell.
CSV input
JSON output
Enter CSV on the left to convert it.
What is CSV to JSON?
A CSV to JSON converter turns spreadsheet-shaped rows and columns into a JSON array of objects — one object per data row, keyed by the column headers in the first line. This is the direction you need when the data arrives as an export: a report downloaded from Excel or Google Sheets, a database dump, a billing statement from a payment provider, or a client's product catalogue that has to be loaded into an application, seeded into a database, or posted to an API that only accepts JSON. The conversion involves more than splitting on commas: the parser has to respect CSV's quoting rules, so a field containing a comma, a line break, or a double quote inside quotes stays a single value instead of tearing the row apart. Each cell also gets a type inferred for it — numbers become JSON numbers, "true" and "false" become booleans, empty cells become null, and everything else stays a string.
How to use CSV to JSON
- Paste your CSV into the left panel, or use the folder icon in the side rail to load a .csv file straight from disk — the first row is read as the column headers.
- The JSON array appears on the right immediately, pretty-printed with two-space indentation and one object per data row.
- Check the inferred types before you copy — cells that look numeric are converted to numbers, which matters for things like ZIP codes or product codes with leading zeros.
- Copy the result, or hit the swap button to flip the converter around and go from JSON back to CSV.
Examples
Headers become keys, types are inferred
Input
id,name,active 1,Ada,true 2,Grace,false
Output
[ { "id": 1, "name": "Ada", "active": true }, { "id": 2, "name": "Grace", "active": false } ]
A short row pads the missing columns with null
Input
a,b,c 1,2
Output
[ { "a": 1, "b": 2, "c": null } ]
Common mistakes
- Converting a CSV whose first row is data rather than headers — the first row is always consumed as the key names, so you'd end up with keys like "1" and "Ada" and one fewer record than you expected.
- Assuming identifier-like columns stay strings — order numbers, ZIP codes, and phone numbers written as bare digits are converted to JSON numbers, losing leading zeros and any value beyond JavaScript's safe integer range.
- Pasting a CSV that was exported with semicolons as the separator (common in European locale spreadsheets) — this parser splits on commas, so a semicolon-separated file arrives as a single column per row.
Why use this tool
- Runs entirely client-side, so a spreadsheet full of customer or financial data never leaves your machine.
- Correctly handles quoted fields containing commas, embedded quotes, and multi-line values instead of naively splitting on every comma.
- Produces a uniform array — short rows are padded with null — so the output is immediately safe to iterate over in code.