CSV to JSON Converter
Spreadsheet data in, structured JSON out.
What this does
Paste CSV, get a JSON array. With "First row is headers" on, the header row becomes the keys and every line after it becomes an object. Turn it off and you get an array of arrays instead.
The delimiter is detected for you. After a conversion, the Auto option in the dropdown names what the parser picked: comma, semicolon, tab, or pipe. Wrong guess? Pick one yourself.
A two-row product export goes in:
sku,name,price,in_stock,zip
A-100,"Desk lamp, brass",24.99,TRUE,02134
A-101,Monitor arm,89,false, And this comes out:
[
{
"sku": "A-100",
"name": "Desk lamp, brass",
"price": 24.99,
"in_stock": true,
"zip": 2134
},
{
"sku": "A-101",
"name": "Monitor arm",
"price": 89,
"in_stock": false,
"zip": null
}
] Look at the zip code. We'll get to that.
Common use cases
Turning the spreadsheet your PM keeps in Google Sheets into seed data or test fixtures. Export as CSV, convert, commit.
Feeding a chart library or a frontend table. Most of them want an array of objects, which is exactly the shape you get here.
Checking what a CSV export really contains before you write the importer. Ragged rows and mystery columns are hard to miss once it's JSON.
Things to know
"Infer types" is on by default. Plain numbers become numbers, true and false (or TRUE and FALSE) become booleans, and empty cells become null. "yes" and "True" stay strings. So does anything that isn't a plain number, like $5 or 0x1F.
Inference costs you leading zeros. ZIP codes, phone numbers, and IDs like 007 lose them. Integers too big for JavaScript to hold exactly stay strings, so they keep every digit. Date-times that end in Z or an offset get rewritten as UTC: 2024-03-27T10:00:00+02:00 comes out as 2024-03-27T08:00:00.000Z. Plain dates are left alone. If any of that bothers you, untick the box and every value stays exactly as written.
Ragged rows don't break anything. Short rows get the missing keys filled with null, or "" with inference off. Long rows keep their spare cells in an _extra array, and a note next to the controls tells you how many rows overflowed.
Duplicate headers become name, name_1, name_2. Quoted cells can hold commas, line breaks, and doubled quotes. A quote that never closes stops the conversion with "Quoted field unterminated", which beats quietly swallowing the rest of your file.
Privacy
PapaParse runs in your browser tab. The customer export you just pasted stays on your machine, which is where it should have stayed all along. After one visit, it works offline too.
Questions
Why does my Excel CSV use semicolons?
Excel saves CSV with your system's list separator. In Germany, France, and most places where the comma is the decimal mark, that's a semicolon. Auto-detect handles it, and the dropdown shows "Auto (semicolon)". Prices like 3,50 come through as the string "3,50", because JSON numbers use a dot.
How do I keep leading zeros when converting CSV to JSON?
Untick "Infer types". Every value then stays a string, exactly as it appears in the CSV, so 02134 stays "02134". The catch is that 30 becomes "30" too. There's no per-column setting, so pick whichever side is easier to fix afterward.
Can I get an array of arrays instead of objects?
Yes. Untick "First row is headers" and each line becomes an array, header row included. Rows keep their own length, so a short line gives you a short array. Type inference still applies if it's on.
Does it handle CSV files saved from Excel?
Yes. Excel's "CSV UTF-8" option puts an invisible byte order mark at the start of the file. Plenty of parsers glue it onto the first header, giving you a key that looks like id and doesn't match id. This tool strips it.
How big a CSV can I convert?
Up to 500,000 characters, or about 5,000 rows at 100 characters a row. Past that, the tool refuses instead of freezing your tab. There's no file picker: open the file, copy, paste. Download saves output.json so you don't have to scroll.