TextSorter
CSV Input
JSON Output

How to Convert CSV to JSON Online

CSV is the format spreadsheets, databases, and CRMs export by default because it is just text: a header row, then one line per record, with commas marking where one column ends and the next begins. JSON is what modern web apps, REST APIs, and JavaScript itself actually want to consume: an array of objects, each one keyed by field name. This converter bridges the two entirely in your browser, turning rows of a CSV or TSV export into a clean, structured JSON array in the time it takes to click a button.

The gap between these two formats shows up constantly in ordinary work. A backend developer gets a spreadsheet of test users from QA and needs it as a JSON fixture for an integration test. A frontend developer receives a product catalog exported from an inventory system and needs an array of objects to render as cards. A data analyst pulls a report out of a CRM and needs to feed it into a script that only reads JSON. None of these people want to write a parser from scratch, and none of them want to install a command-line tool for a one-off conversion that takes ten seconds here.

Step-by-Step CSV to JSON Conversion

  1. Paste your CSV. Drop your rows into the "CSV Input" box, whether that is a copy-paste from Excel, Google Sheets, a database export, or a TSV file where tabs separate the columns instead of commas.
  2. Set the delimiter. Leave it on "Auto-Detect" for most files, or pick Comma, Tab, Semicolon, or Pipe directly if you already know which character your export uses.
  3. Choose your header and type options. Keep "First Row as Headers" checked to use your header row as JSON keys, and toggle "Parse Numbers" depending on whether numeric-looking fields, like ages or prices, should become real JSON numbers or stay as text.
  4. Click "Convert to JSON." The parser builds the array in well under a second, indented the way you picked, and drops it into the "JSON Output" box below.
  5. Copy or download the result. Grab it with one click of Copy, or use "Download .json" to save it as a file you can hand off, attach, or import directly into another tool.

Every step happens on your own device. There is no upload, no server queue, and no artificial row limit, since the JavaScript running in your tab does the entire job.

Why the Delimiter Matters: Commas, Semicolons, Tabs, and Pipes

"CSV" is really a family of formats rather than one strict standard, and the character separating your columns is not always a comma no matter what the file extension says. This tool ships with an Auto-Detect step for exactly that reason: it samples the first five lines of your pasted text, counts how many times each candidate delimiter (tab, comma, semicolon, and pipe) appears outside of quoted sections, and picks the character that shows up the most consistently across those lines rather than just the one that appears most often overall. A file where every line has exactly three semicolons and zero commas is a clear signal, even if a semicolon also sneaks in inside a quoted note field somewhere.

The most common surprise is the semicolon. Windows ties Excel's default list separator to your regional settings, and across most of continental Europe, the comma is already the decimal separator, so a price is written as 12,50 rather than 12.50. If Excel used a comma as the field separator too, a single price column would silently split into two columns every time it exported. To avoid that collision, Excel on German, French, Spanish, Italian, and many other European locales exports CSV files with semicolons as the delimiter instead, even though the file still ends in .csv. A row that looks like Name;Stadt;Gehalt with a value of 4500,75 is a completely standard export from a German or French spreadsheet, not a broken file.

DelimiterTypical SourceExample Row
Comma (,)US/UK Excel, Google Sheets, most APIsAlice,30,New York
Semicolon (;)German, French, Spanish, Italian Excel exportsAlice;30;New York
TabTSV exports, database dumps, copy-paste from spreadsheetsAlice   30   New York
Pipe (|)Legacy mainframe exports, some log formatsAlice|30|New York

If Auto-Detect ever guesses wrong, most often on a very short file with only one or two rows to sample, simply pick the correct delimiter from the dropdown yourself. The rest of the parsing logic, quoted fields, escaped quotes, and type inference, works exactly the same regardless of which delimiter is active.

Quoted Fields, Embedded Commas, and Line Breaks

A naive CSV parser just splits every line on the delimiter character, and that breaks the instant a field contains the delimiter itself. Real-world CSV data is full of exactly that: a "Last name, First name" column, an address with a comma before the state, a product description with a comma-separated list of features. The fix, standardized decades ago in what is now commonly called RFC 4180, is to wrap any field containing the delimiter in double quotes, and this converter implements that rule as a proper character-by-character state machine rather than a simple split.

Concretely, a row like "Doe, John",42,"New York, NY" converts correctly to a name field of "Doe, John" and a city field of "New York, NY", each staying as one value instead of splitting into extra columns. The parser tracks an inQuotes flag as it reads character by character, and only treats a comma as a field separator when that flag is off.

Escaped quotes and multi-line fields

Two related edge cases show up constantly in real exports. First, a literal double quote inside a quoted field is written as two double quotes in a row, so "She said ""hello"" to me" decodes to a single field reading She said "hello" to me, with the doubled quotes collapsed back to one. Second, a quoted field is allowed to contain an actual line break, which happens whenever a spreadsheet column holds a multi-line address, a note, or a comment. The parser does not stop reading a field at the first newline character; it keeps consuming text, newlines included, until it hits the closing quote, so a customer address exported across two physical lines still lands in JSON as a single string value with an embedded \n rather than being cut in half or spilling into the next row.

Getting this wrong is exactly what breaks spreadsheet-to-JSON conversions done with a quick regular expression or a one-line split(','). This parser exists specifically so those cases do not need to be handled by hand.

Header Rows and Duplicate Column Names

With "First Row as Headers" checked, the first line of your pasted data supplies the key name for every field in every object that follows, so a header of name,email,age means every output object has exactly those three keys, in that order. Uncheck the option for CSV data that has no header row at all, perhaps a raw database export or a log file, and the tool falls back to generic keys instead, col1, col2, col3, and so on, numbered by column position so nothing is silently dropped.

Duplicate header names deserve special attention because the failure mode is silent rather than an error message. A JSON object can only hold one property per key, so a header row like name,phone,phone, perhaps a spreadsheet with separate "work phone" and "mobile phone" columns both simply labeled "phone", produces an object where the second phone value overwrites the first during conversion. The output JSON is perfectly valid, it just quietly contains one phone number instead of two, with no warning that data went missing. The fix is entirely on the input side: rename duplicate columns before pasting, for example to phone_work and phone_mobile, so every key in the header row is unique before conversion even starts.

Type Inference: Numbers, Booleans, and the "007" Problem

CSV has no concept of data types. Every single cell, whether it holds a name, an age, a price, or a checkbox value, is stored as plain text, and it's the "Parse Numbers" checkbox that decides how much of that text gets promoted into a real JSON type rather than staying a string. With the option checked, any field that passes a numeric check is converted with JavaScript's Number(), so "age": "30" in the CSV becomes "age": 30 in the JSON, ready for math or comparison operators without an extra parsing step in your own code.

That convenience has a real cost for values that only look numeric. A product code of "007", an account number of "0042", or a ZIP code like "02139" all pass the numeric check and get converted to 7, 42, and 2139 respectively, silently losing the leading zeros that made them meaningful in the first place. A ZIP code is an identifier, not a quantity, and once it becomes the number 2139 there is no way to tell it apart from the ZIP code 21390 with a trailing digit typo. If your data has IDs, codes, or ZIP codes mixed in with genuine numeric fields, uncheck "Parse Numbers" before converting and keep everything as strings, or convert twice and manually patch just the identifier fields in the output.

CSV ValueParse Numbers OnParse Numbers Off
3030 (number)"30" (string)
0077 (number, zero lost)"007" (string, preserved)
truetrue (boolean)true (boolean, always converted)
empty cellnullnull (always converted)

Two of those rows are easy to miss: boolean conversion and empty-cell handling both happen unconditionally, regardless of the "Parse Numbers" checkbox. A cell containing the text true or false, case-insensitively, always becomes a real JSON boolean, and a genuinely empty cell always becomes null rather than an empty string "". That matters if code reading the output checks a field with === null specifically, or expects every value of a given key to share the same JavaScript type; a column that is sometimes empty will produce a mix of strings and null values across the array rather than a column of empty strings throughout.

UTF-8 vs. Windows-1252: Fixing Garbled Characters from Excel

Text encoding bugs are some of the most confusing to diagnose because the file looks completely fine in the program that made it and only breaks somewhere downstream. The classic case: a name field containing "café" or "François" gets exported from Excel, pasted into this converter or any other UTF-8-aware tool, and comes out reading café or François instead. That double-encoded garbling has a name, mojibake, and a specific cause: the file was saved using an 8-bit Windows code page, most often Windows-1252, where "é" is a single byte, but it is then read by something expecting UTF-8, where the same character takes two bytes, and each of those two bytes gets misinterpreted as its own separate character.

The fix lives in Excel's Save As dialog, not in this tool, since by the time garbled text has been pasted in, the original bytes are already gone. On Windows, choosing plain "CSV (Comma delimited)" from the file type list still defaults to the system's regional code page on many installs, while "CSV UTF-8 (Comma delimited)" explicitly writes the file using UTF-8 encoding, matching what browsers and this converter expect. If you regularly receive CSV files with garbled accented characters from a colleague, asking them to re-export using the UTF-8 option, or opening the file in a plain text editor and re-saving it with UTF-8 encoding selected explicitly, fixes the problem at the source rather than needing to be patched after the fact.

Byte order marks and trailing blank rows

Two smaller encoding artifacts are worth knowing about. Excel often prepends a byte order mark, an invisible UTF-8 signature sometimes visible as  if misread, to the very start of a UTF-8 CSV file, which is meant to help other programs detect the encoding automatically but occasionally shows up as a stray character glued to the first header name if a tool doesn't strip it. Separately, spreadsheet exports commonly end with a trailing blank line after the last real row of data. This converter filters out any row where every cell is empty before building the JSON array, so a trailing newline at the end of your file does not produce a spurious empty object at the end of your output.

Why This Converter Runs Entirely in Your Browser

Plenty of "convert CSV to JSON online" tools quietly upload whatever you paste to a server, process it there, and send back a result. That round trip is invisible in normal use, but it means your data sat, even briefly, on a machine you don't control. For a public sample dataset that's a non-issue. For a payroll export, a customer list, a vendor pricing sheet, or anything covered by a confidentiality agreement, it's a real risk that most people never think to check for.

This converter never makes that trip. The parsing logic is plain JavaScript shipped with the page, and it runs entirely inside your own browser tab the moment you click Convert. Open your browser's network tab while using it and you will not see a single request carrying your CSV data anywhere. That has a practical side effect beyond privacy too: there is no server-side rate limit, no file size cap imposed by an API, and no queue to wait behind, since your own device is doing all the work rather than a shared backend.

What that means for confidential exports

If you are converting employee records, financial data, unreleased product information, or anything else that shouldn't leave your organization, a purely client-side tool removes that risk from the equation entirely instead of asking you to trust a privacy policy you haven't read. It's the same reasoning that leads developers to run a code formatter locally rather than paste proprietary source into a random web form: the safest tool is the one that never had the chance to leak anything in the first place.

Common Ways People Use This CSV to JSON Converter

The same conversion step shows up across very different jobs. A few patterns come up constantly.

Frontend prototyping without a backend

Frontend developers building a component, a table, or a dashboard mockup often need realistic sample data before an actual API exists. Exporting a spreadsheet of sample rows and converting it here produces a ready-to-use JSON array that can be dropped straight into a mock data file or a local fixture.

Feeding a document database or NoSQL store

Databases like MongoDB store documents as JSON-like objects, not tables, so a dataset that started life as a spreadsheet export often needs to become a JSON array before it can be imported with a tool like mongoimport. Converting the export here is usually the fastest way to get from a spreadsheet to an importable file.

API testing and mock payloads

QA engineers and backend developers building test cases in tools like Postman or Insomnia frequently start with a spreadsheet of example inputs, one row per test case, and need that same data as a JSON array of request bodies. Converting once here keeps the spreadsheet as the source of truth while producing the exact JSON shape a test runner expects.

Data migration and one-off scripts

Migrating data between systems, an old CRM export into a new platform's import format, or a legacy database dump into a modern application, frequently involves a script that reads JSON. Converting the raw export here first removes the need to write a CSV-parsing step inside that script at all.

Configuration and content from spreadsheets

Non-technical teammates are often far more comfortable maintaining a list in Google Sheets than editing a JSON file directly, whether that's a list of FAQ entries, product categories, or feature flags. Converting their spreadsheet here on each update keeps the JSON file in sync with whatever they most recently edited, without them needing to touch a text editor.

Tips for Clean Conversions and Common Pitfalls

Most conversion surprises trace back to one of these five things: the wrong delimiter, an unwanted number conversion, a duplicate header, an encoding mismatch, or trimmed whitespace. None of them are bugs in the parser, they're properties of the source data that are worth a quick glance before you click Convert.

Frequently Asked Questions

How do I convert CSV to JSON?
Paste your CSV or TSV data into the input box and click "Convert to JSON." The parser reads it row by row, uses the first row as object keys by default, and builds a JSON array where every remaining row becomes one object. Copy the result or download it as a .json file, all without leaving the page.
Does this tool support TSV files (tab-separated values)?
Yes. Select "Tab (TSV)" in the Delimiter menu, or leave it on Auto-Detect and the tool will recognize tab characters on its own. TSV is common for exports from spreadsheet tools and databases where the text itself is likely to contain commas.
Why does my CSV file from Excel use semicolons instead of commas?
Excel ties its default CSV delimiter to your Windows regional settings, and in most of continental Europe, including Germany, France, Spain, and Italy, the comma is already reserved as the decimal separator for numbers like 12,50. To avoid a field separator colliding with a decimal point, Excel in those locales exports semicolons instead. Auto-Detect handles this automatically, or you can pick "Semicolon (;)" directly.
How are quoted fields with commas or line breaks inside them handled?
The parser is a proper state machine, not a naive comma split, so it tracks whether it is currently inside a quoted field. A cell written as "Doe, John" keeps its internal comma and stays one field, and a quoted field containing an actual line break, like a multi-line address, is read as a single value spanning multiple lines of raw text rather than being cut off at the first newline.
What happens to a value like "007" or a ZIP code with a leading zero?
It depends on the "Parse Numbers" checkbox. With it checked, any field that looks numeric is converted to a real JSON number, so "007" becomes 7 and "02139" becomes 2139, both losing their leading zeros the same way a spreadsheet would. Uncheck "Parse Numbers" before converting if your data has identifiers, codes, or ZIP codes that need to stay intact as strings.
Does the converter treat empty cells as null or as an empty string?
Empty cells always become JSON null, regardless of whether "Parse Numbers" is checked, because that conversion happens unconditionally in the parsing step. A row like "Alice,,Engineer" produces a middle field of null rather than an empty string "", which matters if downstream code checks for null specifically or expects a string type on every key.
Why do accented characters like café or naïve show up as garbled text?
That garbling, often called mojibake, happens when a file was saved in an 8-bit Windows encoding like Windows-1252 but your browser or a downstream tool reads it as UTF-8, or the reverse. A common symptom is "café" turning into "café" or "François" into "François". The fix is exporting from Excel using "CSV UTF-8 (Comma delimited)" in the Save As dialog rather than the plain "CSV" option, which still defaults to Windows-1252 on many installs.
What happens if my CSV has duplicate column names in the header row?
JSON objects cannot hold two properties with the same key, so if your header row has two columns both named "Phone", the second one silently overwrites the first in every output object and the first phone number is lost. Rename duplicate headers, for example to "Phone1" and "Phone2", before pasting your data in to avoid losing a column of data without any error message.
Is there a limit to how large a CSV file I can convert?
There is no artificial file size cap set by this tool, since conversion runs locally rather than through a server API with a request size limit. In practice, spreadsheets with tens of thousands of rows convert in well under a second on a normal laptop, and the real ceiling is how much memory your browser tab has available for very large files.
Is my CSV data private, or does anything get uploaded to a server?
Nothing is uploaded anywhere. Parsing runs as JavaScript inside your own browser tab, so payroll exports, customer lists, and other spreadsheet data covered by confidentiality agreements never leave your device. You can disconnect from the internet after the page loads and the converter still works exactly the same.

Related developer tools

🔒 100% Client-Side Privacy

All CSV parsing and JSON generation happens <strong>entirely in your browser</strong>. No data is ever uploaded to any server. Your data stays on your device at all times.