CSV to JSON Converter
Paste a spreadsheet export or open a file to turn CSV rows into clean JSON, or turn a JSON array back into a CSV you can open in Excel.
Runs entirely in your browser. Nothing you add is sent to us.
Create a free account to use the CSV to JSON Converter
Free forever for this tool. Takes a few seconds — then you come straight back here.
- All 150 free tools, one login
- Free website audit with fixes
- Search Console dashboard
- Free keyword rank tracker
Already have an account? Sign in
Converting CSV to JSON is a daily task when you move data between spreadsheets, websites and apps. Our free converter parses CSV properly, including quoted fields, commas and line breaks inside values and doubled quotes, detects whether your file uses commas, semicolons, tabs or pipes, and turns each row into a JSON object using the header row as keys. It can recognise numbers, true and false values and empty cells, and it works the other way too, turning a JSON array of objects into a clean CSV with nested fields flattened into dot-separated columns. Open a file from your computer or paste the data, preview it as a table, then copy or download the result. Files are read locally and never uploaded.
How to use the CSV to JSON
- 1 Choose the directionPick CSV → JSON to turn a spreadsheet export into JSON, or JSON → CSV to turn API data or a JSON file into something you can open in Excel or Google Sheets.
- 2 Paste data or open a filePaste into the box or use Open a file to load a .csv, .tsv, .txt or .json file. The file is read by your browser and the right mode is selected from the file extension.
- 3 Check the delimiter and headerAuto-detect works for most files and shows which delimiter it found. Untick First row is a header if your data has no column names, and the tool will output arrays instead of objects.
- 4 Decide on type detectionLeave Detect numbers on to get 12 rather than "12" and true rather than "true". Turn it off if every value should stay as text, for example account codes.
- 5 Preview, copy or downloadCheck the table preview and any warnings, then copy the output or download it. In JSON → CSV mode, Download for Excel adds a byte order mark so accented letters and £ signs display correctly.
CSV and JSON in plain English
CSV, short for comma-separated values, is the simplest way to store a table as text. Each line is a row and each value is separated by a comma, or sometimes a semicolon, tab or pipe. Every spreadsheet program can open and save CSV, which is why it is the standard export format for online shops, accounting packages, email marketing tools and CRMs.
JSON, short for JavaScript Object Notation, stores data as named fields and lists. It is the native language of web APIs, JavaScript applications and many configuration files, and it can hold nested structures such as an address inside a customer record. A CSV row like Ann,Leeds becomes a JSON object like {"name": "Ann", "town": "Leeds"}, where the column headers become the field names.
Neither format is better. CSV is compact and spreadsheet-friendly, JSON is structured and code-friendly. Most of the time you need to convert because one system speaks one and the next system speaks the other.
How the CSV parser handles tricky data
Splitting each line on commas works until a value contains a comma, such as a company called Smith & Sons, Ltd or an address line. The CSV standard, RFC 4180, solves this with quotes. A value wrapped in double quotes can contain commas and even line breaks, and a double quote inside a quoted value is written twice. Our parser follows these rules character by character rather than guessing with simple splitting.
- Quoted fields: "Smith & Sons, Ltd" stays as one value with the comma kept.
- Embedded line breaks: a quoted product description that spans several lines stays in a single cell instead of breaking into extra rows.
- Escaped quotes: "The ""Quote"" Shop" becomes The "Quote" Shop.
- Line endings: Windows (CRLF), Unix (LF) and old Mac (CR) line endings are all understood, and a byte order mark at the start of the file is ignored.
- Unclosed quotes: if a quote is never closed, you get a clear warning rather than silently broken output.
- Ragged rows: rows with more or fewer fields than the header are flagged, and extra values are given column_N keys so nothing is lost.
Delimiter detection and regional settings
Not every CSV uses commas. In many European countries the comma is the decimal separator, so Excel saves CSV files with semicolons instead. Tab-separated files are common from databases and analytics exports, and pipes appear in some finance and logistics systems. Auto-detect tries each of these delimiters on the start of your data and picks the one that gives the most consistent number of columns across rows. The detected delimiter is shown under the dropdown, and you can override it if a file is unusual.
When you convert JSON to CSV, choose the output delimiter to suit where the file is going. Comma is right for most UK and US software. Semicolon is the safer choice if colleagues open the file in Excel with European regional settings, where a comma-separated file can end up crammed into a single column.
Type detection: numbers, booleans and empty cells
CSV has no data types. Every value is just text, so 12, true and an empty cell are all strings until something decides otherwise. With Detect numbers turned on, the converter turns plain numbers into JSON numbers, true and false into booleans, and empty cells or the word null into null. That makes the JSON ready to use in code without extra conversion.
The detection is deliberately careful. Values with leading zeros, such as phone numbers like 07700 900123, product codes like 00451 or postcodes, stay as text so the zeros are not lost. Very long whole numbers that JavaScript cannot store exactly, such as some order and card reference numbers, also stay as text. Values with currency symbols, thousands separators or percentage signs are left alone. If you want everything kept exactly as typed, turn detection off and every value will be a string.
Header names are cleaned up too. Empty headers become column_1, column_2 and so on, and duplicate headers get a numbered suffix such as name_2, because JSON objects cannot have two fields with the same name.
Turning JSON back into CSV
JSON → CSV mode expects an array of objects, which is what most APIs return. If you paste an object that wraps the array, such as {"data": [...]}, the converter finds the first list of records inside it. Every key found in any record becomes a column, in the order it first appears, so records with missing fields simply get empty cells.
Nested objects are flattened into dot-separated column names. A customer record with an address object becomes columns such as address.town and address.postcode, which is easy to read in a spreadsheet and easy to rebuild later. Arrays inside a record, such as a list of tags, are kept as JSON text in one cell, because spreading them across a variable number of columns usually makes a spreadsheet harder to work with. Values containing commas, quotes or line breaks are quoted correctly, so the CSV opens cleanly in Excel, Google Sheets and Numbers.
Privacy, file size and performance
Customer lists, order exports and payroll data often contain personal information that should not be pasted into random websites. This converter reads files with your browser's own file reader and does all the parsing in JavaScript on your device. Nothing is uploaded, stored or logged, which also helps you stay on the right side of UK GDPR when you handle personal data.
Files up to 25 MB can be opened. Very large files may take a moment to convert on older laptops and phones, and the output preview is shortened once it passes 200,000 characters to keep the page smooth, but Copy and Download always give you the full result. The table preview shows the first 100 rows so you can check the columns quickly without waiting for thousands of rows to draw.
Examples you can copy
CSV with quotes and commas in values
name,town,employees
"Smith & Sons, Ltd",Leeds,12
"The ""Quote"" Shop",York,
[
{ "name": "Smith & Sons, Ltd", "town": "Leeds", "employees": 12 },
{ "name": "The \"Quote\" Shop", "town": "York", "employees": null }
]
Nested JSON flattened to CSV columns
[{"name": "Riverside Café", "address": {"town": "Bath", "postcode": "BA1 1LT"}}]
name,address.town,address.postcode
Riverside Café,Bath,BA1 1LT
Semicolon CSV from European Excel
product;price;in_stock
Notebook;4,50;true
Detected delimiter: semicolon
"price": "4,50" (kept as text because of the decimal comma)
Common mistakes to avoid
Splitting CSV on commas yourself
A quick split breaks as soon as a value contains a comma or a line break. Use a parser that follows RFC 4180 quoting rules.
Losing leading zeros
Opening a CSV in Excel can turn 07700 into 7700. Keep codes as text, and check the JSON before importing it elsewhere.
Saving with the wrong encoding
Files saved in older Windows encodings can turn £ and é into odd symbols. Save CSV as UTF-8, and use Download for Excel when the file is going to Excel users.
Assuming every row has the same columns
Exports often have blank trailing fields or extra notes columns. Read the ragged row warning and check those rows.
Converting numbers that are really identifiers
Order numbers, account codes and phone numbers are labels, not quantities. Turn type detection off if they must stay exactly as written.
Frequently asked questions
No. The file is read and converted by your own browser, so customer lists and other personal data never leave your device.
Yes. It reads comma and semicolon files saved by Excel, including quoted values with commas or line breaks, and can save CSV with a byte order mark for Excel.
Yes. As long as the value is wrapped in double quotes, as Excel and Google Sheets do automatically, line breaks inside it stay in the same cell.
Untick First row is a header. Each row then becomes an array of values instead of an object, and the table preview labels columns column_1, column_2 and so on.
Values with leading zeros, decimal commas, currency symbols or more digits than JavaScript can store exactly are kept as text on purpose, so nothing is changed or lost.
Yes. Nested objects are flattened into columns with dot-separated names such as address.town. Arrays are kept as JSON text in a single cell.
Comma works for Excel with UK and US settings. If your colleagues use European regional settings, choose semicolon so the columns split correctly.
You can open files up to 25 MB. Larger exports should be split into smaller files first so your browser stays responsive.
Learn more
- How to Convert CSV to JSON Without Losing Leading Zeros or £ Signs How to convert CSV to JSON reliably: header rows, quoted fields, Excel's semicolon and UTF-8 BOM quirks, and keeping leading zeros on phone numbers and IDs.
- User Onboarding and Offboarding Workflow for MSPs and IT Teams A user onboarding and offboarding workflow for MSPs and IT teams: verified requests, role templates, approved account changes, access removal and audit trails.
Free website audit
See how your site scores, free
Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.