CSV to JSON Converter
Convert CSV files to JSON format.
Drop CSV file here
or click to select file
About CSV to JSON Converter
Drop a .csv file above and it becomes a JSON array with one object per row, keyed by the column headings in the first line. Nothing is uploaded: the browser reads the file, parses it in page memory and prints the result, so a spreadsheet of customer or payroll data never leaves your machine.
CSV is messier than it looks
Splitting each line on commas fails on the first field that contains one. Real CSV allows a value to be wrapped in double quotes, to contain commas and line breaks inside those quotes, and to escape a literal quote by doubling it — so a single record can span several physical lines. This converter runs a proper parser rather than a split, and it also works out the delimiter, which means European exports using semicolons and tab-separated data both convert without any setting to change.
Types are guessed, and that is the catch
CSV has no type system, so every value arrives as text and the parser has to infer what it meant. Numeric-looking cells become JSON numbers, uppercase TRUE and FALSE become booleans, and date-like cells become spreadsheet serial numbers. That is convenient for genuine measurements and quietly destructive for identifiers: leading zeros vanish, a value written as 1e5 becomes 100000, and 50% becomes 0.5. Read the first few objects in the output before wiring them into anything.
Getting a clean result
A file converts predictably when the first row holds unique, non-empty headings, no columns were merged in the export, and there is no title line or blank row above the header — that first line becomes the keys whatever it contains. Empty cells produce no key rather than a null, so filling gaps in the source is worthwhile if the consumer expects a uniform shape. Copy puts the JSON on your clipboard and Download saves it as a file.
Related conversions
Going the other way is the JSON to CSV converter, which flattens nested objects into dotted column names. If the destination is a spreadsheet rather than code, CSV to Excel writes a real .xlsx workbook — it reads the file with the same parser, so the type-inference caveats above still apply. And once you have JSON, the JSON Formatter is useful for inspecting or re-indenting the result.
Handles Real CSV, Not Just Split-On-Comma
Quoted fields containing commas, embedded newlines and doubled quotes are parsed properly, and the delimiter is detected — semicolon and tab files convert without being told.
An Array Of Objects, Indented
Output is a JSON array with one object per data row, keyed by the header, pretty-printed with two-space indentation and ready to paste into a fixture or a request body.
The File Is Never Uploaded
The browser reads it with FileReader and parses it in page memory. Nothing crosses the network, which matters when the spreadsheet holds customer records or payroll.
Frequently Asked Questions
Why did my postcode 01234 come out as the number 1234?
Because the parser infers types, and anything that looks numeric becomes a JSON number with its leading zeros dropped. Quoting the field in the CSV does not prevent it. This hits postal codes, phone numbers with a leading zero or a plus, account references and zero-padded IDs. The reliable fix is to make the value non-numeric before conversion — add a prefix your import step can strip, or convert with the leading zeros already handled downstream. Check any identifier column in the output before you trust it.
My dates turned into five-digit numbers.
Those are Excel date serials. A cell reading 2024-01-31 is recognised as a date and stored as the number of days since 1899-12-30, so it emerges as roughly 45322 with a fraction for the time of day. Quoting does not stop this either. If you need the original strings, alter them so they no longer parse as dates — a leading letter or a different separator both work — or convert the serials back on the receiving side.
Some rows are missing keys entirely.
An empty cell produces no key at all rather than a null. In a file where the first row is complete and later rows have gaps, the objects end up with different shapes, which breaks code that assumes every element has the same fields. Iterate with a default rather than indexing directly, or fill the blanks in the source before converting. Rows that are entirely blank are skipped outright.
What happens to duplicate or empty column headings?
Keys have to be unique, so a second column called name becomes name_1, a third name_2, and so on in the order they appear. A heading cell that is empty becomes __EMPTY, with __EMPTY_1 for the next. Both are signals worth acting on: they usually mean the header row picked up a stray trailing comma or that the export merged two columns with the same label.
Which files can I drop here?
Files with a .csv extension. A tab-separated .tsv or a plain .txt export is rejected by the picker even though the parser would cope, so rename the extension first. Only the first sheet of the file is read, which is not a limitation for CSV but is worth knowing if you are used to the multi-sheet behaviour of spreadsheet formats. The text is read as UTF-8 and a leading byte-order mark is removed automatically.
How large a file will it take?
There is no coded limit, but the whole file is read into memory as a string, parsed into an object graph, and then serialised again as indented JSON, so peak usage is several times the file size. A few megabytes is comfortable on a normal machine; tens of megabytes will hang the tab while it works, and a very large export is better handled by a script. The output textarea also becomes sluggish long before the parser does.