CSV to JSON Converter Online Free — Complete Guide
CSV (Comma-Separated Values) is the universal format for tabular data — exported by spreadsheets, databases, CRMs, analytics platforms, and virtually every business application that exports data. JSON is what modern APIs, web applications, and databases expect. The free CSV to JSON Converter bridges this gap instantly in your browser with no server, no upload, and no account.
What Is CSV Format? History and Specification
CSV stands for Comma-Separated Values. Despite the name, "CSV" broadly refers to any delimiter-separated values format — the delimiter may be a comma, semicolon, tab, pipe, or any other character. The format has no formal standard; RFC 4180 (2005) documents common usage but is not an official standard.
The format originated in the early 1970s as a way to exchange tabular data between programs. It predates the internet, predates personal computers, and predates virtually every other widely-used data format. This longevity makes CSV both ubiquitous and frustrating — its lack of standardization means every application that exports CSV makes slightly different choices about quoting, line endings, encoding, and handling special characters.
CSV Format Rules (RFC 4180)
The closest thing to a CSV specification is RFC 4180, which defines:
- Each record is on its own line, ending with CRLF (
\r\n) or LF (\n) - The last record may or may not have a trailing line break
- An optional header record may appear as the first line
- Each record must have the same number of fields
- Fields may be enclosed in double quotes; if so, embedded double quotes are escaped as
"" - Fields containing commas, double quotes, or line breaks must be quoted
- Spaces are significant (not trimmed by default)
- Comma is the field separator; RFC 4180 specifies only comma, not alternatives
CSV vs JSON — When to Use Each
| Aspect | CSV | JSON |
|---|---|---|
| Data structure | Flat tabular — rows and columns only | Hierarchical — nested objects and arrays |
| Data types | All values are strings | String, number, boolean, null, array, object |
| File size | Compact (no structural overhead) | Larger (key names repeated per row) |
| Human readability | Excellent for tabular data | Good for hierarchical data |
| Spreadsheet compatibility | Excellent — opens in Excel/Sheets natively | Poor — requires conversion |
| API compatibility | Poor — most APIs use JSON | Excellent — universal REST API format |
| Database import | Widely supported (MySQL, PostgreSQL COPY) | Supported by document databases (MongoDB) |
| Nested data | Not supported — all data must be flat | Native support for nested structures |
How CSV to JSON Conversion Works
The conversion follows a straightforward mapping: the header row provides keys, and each data row becomes a JSON object with those keys:
| CSV Element | JSON Equivalent | Notes |
|---|---|---|
| Header row | Object keys applied to every row | Column names become JSON keys |
| Data row | JSON object in the output array | One object per data row |
| Quoted field | String value (quotes stripped) | Embedded doubled quotes become single quotes |
| Empty cell | Empty string "" or null | Depends on tool setting |
| Numeric cell | JSON number (no quotes) | Numeric detection converts "42" to 42 |
| Boolean-like cell | JSON boolean | "true"/"false" optionally converted to boolean |
A complete conversion example
Given this CSV:
name,age,city,active
Alice Chen,32,London,true
Bob Smith,28,New York,false
"Jones, Mary",45,"San Francisco",trueThe converter produces:
[
{ "name": "Alice Chen", "age": 32, "city": "London", "active": true },
{ "name": "Bob Smith", "age": 28, "city": "New York", "active": false },
{ "name": "Jones, Mary", "age": 45, "city": "San Francisco", "active": true }
]Note: the quoted value "Jones, Mary" is correctly parsed as a single field despite the embedded comma. Numbers (32, 28, 45) are converted to JSON numbers (no quotes). Booleans are detected and converted to JSON true/false.
How to Convert CSV to JSON — Step by Step
- Open the tool. Navigate to the CSV to JSON Converter.
- Paste or upload your CSV. Paste CSV text directly, or click to select a .csv file from your device.
- Review the output. The JSON array appears in the right panel. Verify that column names became keys, values are correctly typed (numbers, booleans), and quoted fields with embedded commas are correctly parsed.
- Copy or download. Click Copy to copy the JSON array to your clipboard, or Download to save as a .json file. Paste into the JSON Formatter for syntax highlighting.
Handling Common CSV Variations
Semicolon-separated (European CSV)
CSV files exported from Microsoft Excel on European regional settings often use semicolons as delimiters instead of commas, because commas are used as the decimal separator in many European countries (where 1.000,50 means one thousand and fifty cents). The converter detects the delimiter automatically by scanning the first line.
Tab-separated values (TSV)
Tab-separated values files (.tsv or .txt) use tabs as delimiters. They are common exports from databases, Google Sheets ("Download as TSV"), and bioinformatics tools. The converter handles TSV by detecting the tab delimiter automatically.
Quoted fields with commas
Fields that contain the delimiter character are enclosed in double quotes:"Smith, John". The parser correctly treats the comma inside quotes as part of the field value, not a field separator. Fields can also contain newlines if quoted: this produces multi-line strings in the JSON output.
No header row
If your CSV has no header row, the converter generates generic key names:column0, column1, column2, and so on. Rename these in the JSON output manually, or add a header row to the CSV before converting.
Byte Order Mark (BOM)
CSV files exported from Windows applications sometimes include a UTF-8 BOM (Byte Order Mark — the byte sequence 0xEF 0xBB 0xBF) at the start of the file. This can cause the first column name to appear as name (with a hidden BOM character prefix). The converter strips BOMs automatically, but if you see strange prefixed key names in the output, check for a BOM.
Special characters and encoding
CSV files do not include an encoding declaration — the file might be UTF-8, Latin-1 (ISO 8859-1), or Windows-1252. Characters outside ASCII may render incorrectly if the encoding is wrong. When pasting CSV from another application, the clipboard transfer uses Unicode, so encoding issues are less common. For uploaded .csv files, the browser reads the file as UTF-8 by default. If your CSV uses a different encoding (common for files from older European or East Asian systems), convert the encoding to UTF-8 first using a text editor.
Use Cases for CSV to JSON Conversion
Importing spreadsheet data into a web application
When users upload a CSV file (a common pattern in business applications — bulk-import users, products, contacts), the application needs to parse the CSV and validate each row. Converting to JSON first provides a JavaScript-native data structure that is easier to validate and process than raw CSV strings.
Feeding spreadsheet exports into REST APIs
Marketing teams export contact lists from Excel or Google Sheets as CSV. The CRM or email marketing API expects JSON arrays. Converting the CSV export to JSON provides the correct format for API import endpoints.
Loading data into document databases
MongoDB, Elasticsearch, and Firestore store data as JSON-like documents (BSON, JSON, or Firestore documents). Importing data from legacy systems that export CSV requires converting to JSON first. The mongoimport utility accepts JSON directly; Elasticsearch's Bulk API accepts newline-delimited JSON (NDJSON).
Convert CSV to JSON, then convert to NDJSON for Elasticsearch bulk indexing:
# Convert JSON array to NDJSON (one object per line)
cat data.json | python3 -c "
import json, sys
data = json.load(sys.stdin)
for item in data:
print(json.dumps(item))
" > data.ndjson
# Bulk index into Elasticsearch
curl -X POST 'http://localhost:9200/_bulk' --header 'Content-Type: application/x-ndjson' --data-binary @data.ndjsonData analysis with Python/pandas
While pandas can read CSV directly, JSON provides typed data — numbers and booleans are already the correct type, not strings. This reduces the type-conversion code needed when processing data.
Configuration data for static site generators
Static site generators (Hugo, Eleventy, Gatsby, Astro) can use JSON files as data sources for templating. If you maintain reference data (product catalog, team bios, event list) in a spreadsheet, converting the CSV export to JSON provides the data format these generators accept natively.
Handling Nested Data in CSV
CSV is a flat format — it cannot represent nested structures. Teams use several conventions to represent hierarchical data in CSV:
Dot-notation column names
Some CSV exports use dot-notation to represent nesting:address.city, address.country. The converter outputs these as flat string keys, not nested objects. To reconstruct the nested structure, use a post-processing step:
// Flatten a CSV row with dot-notation keys into nested JSON
function unflatten(flatObj) {
const result = {};
for (const [key, value] of Object.entries(flatObj)) {
const parts = key.split('.');
let current = result;
for (let i = 0; i < parts.length - 1; i++) {
current[parts[i]] = current[parts[i]] || {};
current = current[parts[i]];
}
current[parts[parts.length - 1]] = value;
}
return result;
}
const nested = flatData.map(unflatten);Frequently Asked Questions
Is my CSV data uploaded to a server?
No. The conversion runs entirely in your browser using JavaScript. Your CSV data never leaves your device — not even when you upload a file (the browser reads the file locally).
Is there a file size limit?
No hard limit — conversion is in-browser and limited by available browser memory. Very large CSV files (millions of rows) may cause slowness in the browser. For files over 50 MB, use command-line tools: Python's csv module, Node.js'sfast-csv library, or jq for streaming JSON output.
How are empty cells handled?
Empty CSV cells are output as empty strings ("") by default. Some tools optionally convert empty cells to JSON null. If your downstream application differentiates between empty string and null, post-process the output to convert empty strings to null where appropriate.
Does the converter detect numeric values automatically?
Yes — cells that contain only digits (with optional decimal point) are converted to JSON numbers. Cells matching "true" or "false" (case-insensitive) are optionally converted to JSON booleans. Cells with leading zeros (like ZIP codes 01234) are kept as strings to preserve the leading zero.
How do I handle a CSV with no header row?
The converter uses the first row as headers by default. If your CSV has no header row, add one before converting — add a line at the top with your desired column names — or the converter will use the first data row as headers, which is incorrect.
Convert CSV to JSON Free Online
Instant structured JSON from any CSV. No uploads, no account, runs entirely in your browser.
Open CSV to JSON Converter