Convert CSV to JSON
Turn a CSV file or a pasted table into clean JSON — numbers and booleans typed, nested objects built from dotted headers, and exactly the shape your code expects.
- Never stored
- No queue, no waiting
- No signup, no watermark
How it works
Add CSV
Drop a .csv or .tsv file, or paste the data. The delimiter and encoding are detected for you.
Choose the shape
An array of objects, an array of arrays, an object keyed by the first column, or JSON Lines — plus types, empty values and indentation.
Copy or download
Copy the JSON to the clipboard or save it as a .json file.
Where CSV is vaguer than it looks
CSV has no real standard — there is an advisory specification from 2005 that describes what most tools do, and a great deal of software that does something else. So the first job is working out what the file actually is: whether values are separated by commas, semicolons or tabs (European locales export semicolons, because the comma is their decimal separator), whether the first row is a header, and how quoting is handled. A quoted field can legally contain commas, newlines and doubled quote marks, which is why splitting on commas is the wrong way to read one and why a naive parser corrupts any file containing an address.
Types are the second job, and JSON has opinions CSV does not. A CSV cell contains text and nothing else; JSON distinguishes numbers, strings, booleans and null. Something has to decide which is which, and the decisions that matter are the ones that go wrong: a leading zero is significant in a postcode, a phone number or an account reference, so a value like 01234 must stay a string rather than becoming the number 1234. The same applies to long identifiers, which lose precision as JSON numbers beyond about nine quadrillion.
Dates stay as the text they were, because JSON has no date type. 2024-03-05 comes out as the string "2024-03-05", and that is the honest answer rather than a limitation — the alternative is guessing, and guessing is how 03/05/2024 becomes March in one country and May in another. Converting them is a decision for whatever consumes the JSON, which knows the format it wants.
Encoding is the last quiet failure. A CSV carries no note of its character encoding, so a file saved as Windows-1252 and read as UTF-8 produces mojibake in exactly the rows containing accented names — and a byte order mark at the start, which Excel adds, appears as stray characters in the first field name if it is not handled. Both are properties of CSV rather than of any converter.
When you want something else
For files too large to hold in memory, or for anything scripted, csvkit is purpose-built: csvjson --stream data.csv converts incrementally, csvlook lets you see what you have first, and csvclean fixes the ragged rows that break everything downstream. Miller — mlr --icsv --ojson cat data.csv — does the same at considerable speed and handles line-delimited JSON, which is what most data pipelines actually want.
When the types matter more than the convenience, do the conversion in code with the types declared rather than inferred. Python's pandas with an explicit dtype mapping, or a small script with a schema, means a postcode stays a postcode and an identifier keeps every digit — which no automatic inference can guarantee across a file it has not seen all of.
Frequently asked questions
Which JSON shape should I choose?
An array of objects — [{"name": "Ada", "age": 36}] — suits almost every API and library. An array of arrays is the most compact. A keyed object lets code look records up by ID. JSON Lines puts one record per line, for streaming tools, BigQuery and log pipelines.
How are numbers and booleans decided?
Once per column: a column becomes numbers only when every value in it is a number, so "007" and 7 never end up mixed under one key. Values with leading zeros, and IDs too long for JavaScript to hold exactly, stay strings. true and false become booleans, and empty cells become null — or empty strings, or are left out, as you prefer.
Can it create nested JSON?
Yes. With nesting on, a header like address.city becomes {"address": {"city": …}}, and tags.0, tags.1 become an array.
Is my data stored anywhere?
No. Nothing is sent anywhere and nothing is stored.
What about semicolons, tabs and other encodings?
Commas, semicolons, tabs and pipes are detected automatically, as are UTF-8, UTF-16 and older Windows encodings, so accented and non-Latin text comes through intact.
What about duplicate or empty column names?
Duplicates get a number (name, name_2) and empty headers get a position-based name (column_3), so no value is overwritten and you are told what changed.
Good to know: Dates stay as the text in your file, because JSON has no date type. Very large files are limited by your browser's memory.
Put this tool on your website
Free for any blog, class page or help article. Paste one snippet and your visitors can use it right on your page.
More Spreadsheet tools
JSON to CSV
Nested JSON flattened into clean columns
CSV to Excel
CSV to XLSX with real numbers and dates
Excel to XML
Rows to clean, well-formed XML
XML to Excel
XML records to a formatted Excel sheet
Excel to CSV
Any sheet to CSV, in the encoding you need
ODS to XLSX
LibreOffice spreadsheets as Excel workbooks