CSV to JSON Converter – Convert CSV to JSON Online Free
Convert CSV spreadsheets, TSV, and delimited text files into structured JSON arrays, nested objects, and JSONLines (NDJSON). Features automated delimiter detection, dot-notation unflattening, smart type casting, and real-time live preview.
Convert valid CSV to preview tabular records.
Auto-Delimiter Detection
Intelligently scans comma (,), semicolon (;), tab (\t), and pipe (|) separators across records for instant plug-and-play conversion.
Smart Type Casting
Automatically infers integers, floating-point numbers, booleans (true/false), and null values so your JSON output uses native data types.
Dot-Notation Unflattening
Converts flattened column headers like user.address.city directly back into deep, structured nested JSON objects and hierarchies.
JSONLines / NDJSON Export
Generate newline-delimited JSON streams optimized for ingestion into Elasticsearch, Google BigQuery, AWS Athena, and LLM fine-tuning datasets.
Dual Editor & Table View
Inspect output as formatted 2-space indented JSON or switch to the interactive data table view to visually verify records and headers.
Zero-Server Data Privacy
Conversions execute locally in your web browser. Proprietary customer lists, financial figures, and API records never leave your machine.
A CSV to JSON converter is an online data transformation tool that turns flat, 2-dimensional Comma-Separated Values (CSV) spreadsheets and delimited text into hierarchical JavaScript Object Notation (JSON) structures. It is essential for feeding spreadsheet data into REST APIs, NoSQL databases (MongoDB, DynamoDB), frontend applications, and machine learning pipelines.
contact.city → { contact: { city } }).true/false), and nulls natively.What is CSV to JSON Conversion and Why Do You Need It?
Direct Answer: CSV to JSON conversion parses 2D tabular rows and delimited text into hierarchical key-value JSON objects and arrays. Column headers become JSON object keys, while each CSV row becomes an independent structured JSON record ready for web APIs, MongoDB, and frontend state.
Convert CSV files to JSON online for free. Upload a CSV or TSV file, paste CSV data, or import a CSV URL. The converter turns each row into a JSON object and supports automatic delimiter detection, nested objects, type conversion, JSON Lines (NDJSON), and live preview.
Comma-Separated Values (CSV) is the universal format for spreadsheets (Microsoft Excel, Google Sheets), database exports, and accounting reports. However, modern web software, cloud applications, and microservices communicate exclusively using JSON (JavaScript Object Notation).
Our free online CSV to JSON converter bridges this gap. It handles complex CSV parsing edge-cases such as quoted commas, escaped double quotes (""), multi-line cell text, European semicolon delimiters, and dot-notated column headers (e.g. user.address.zip) to produce clean, well-typed JSON payloads in milliseconds.
CSV to JSON Example (Simple & Nested)
Direct Answer: In a standard conversion, each CSV line becomes an object in a JSON array. In a nested conversion, dot-separated headers (contact.city) become sub-objects, and bracketed values become native JSON arrays.
id,name,email,age
1,Aarav Sharma,aarav@example.com,28
2,Priya Patel,priya@example.com,26[
{ "id": 1, "name": "Aarav Sharma", "email": "aarav@example.com", "age": 28 },
{ "id": 2, "name": "Priya Patel", "email": "priya@example.com", "age": 26 }
]For more complex developer datasets with nested attributes and arrays:
id,name,role,contact.email,contact.city,skills,active
101,Aarav Sharma,Lead Architect,aarav.sharma@example.com,Bengaluru,"[""PHP"",""Laravel"",""Vue""]",true
102,Priya Patel,Security Engineer,priya.patel@example.com,Mumbai,"[""Python"",""Rust""]",true
103,Rohan Mehta,Frontend Dev,rohan.mehta@example.com,Delhi NCR,"[""React"",""TypeScript""]",false[
{
"id": 101,
"name": "Aarav Sharma",
"role": "Lead Architect",
"contact": {
"email": "aarav.sharma@example.com",
"city": "Bengaluru"
},
"skills": ["PHP", "Laravel", "Vue"],
"active": true
},
{
"id": 102,
"name": "Priya Patel",
"role": "Security Engineer",
"contact": {
"email": "priya.patel@example.com",
"city": "Mumbai"
},
"skills": ["Python", "Rust"],
"active": true
},
{
"id": 103,
"name": "Rohan Mehta",
"role": "Frontend Dev",
"contact": {
"email": "rohan.mehta@example.com",
"city": "Delhi NCR"
},
"skills": ["React", "TypeScript"],
"active": false
}
]Transformation Breakdown Table
| CSV Column | Sample Raw Value | Target JSON Key & Type | Transformation Strategy |
|---|---|---|---|
id | 101 | "id": 101 (Number) | Smart numeric detection casts string to integer. |
contact.email | aarav.sharma@example.com | "contact": { "email": "..." } | Dot-notation unflattening: Creates nested object contact. |
skills | "[""PHP"",""Laravel""]" | "skills": ["PHP", "Laravel"] | Nested JSON sub-string parser parses string into native JSON array. |
active | true | "active": true (Boolean) | Smart boolean casting converts string "true" to literal boolean. |
CSV vs JSON: Key Differences and Comparison Table
Direct Answer: CSV is a lightweight, 2D tabular format designed for spreadsheets and bulk database imports. JSON is a flexible, tree-structured format supporting hierarchical objects, arrays, and typed primitives designed for web APIs and modern applications.
| Feature | CSV (Comma-Separated Values) | JSON (JavaScript Object Notation) |
|---|---|---|
| Data Structure | Flat 2D grid (Rows and Columns) | Hierarchical tree (Objects, Arrays, Primitives) |
| Data Types | Untyped raw text strings only | Typed: String, Number, Boolean, Array, Object, Null |
| File Size Overhead | Minimal (no closing tags or property repetition) | Moderate (keys are repeated on every record) |
| Best Environment | Excel, Google Sheets, SQL COPY/LOAD, Pandas | REST APIs, GraphQL, MongoDB, Web Frontends |
| Nested Hierarchy | Requires artificial delimiters (dot notation) | Native multi-level object and array nesting |
How to Convert Microsoft Excel CSV Files to JSON
Direct Answer: In Microsoft Excel, navigate to File → Save As and choose CSV UTF-8 (Comma delimited) (*.csv). Then, upload or paste the file here. The converter auto-detects delimiter format and strips any Excel Byte Order Mark (BOM) cleanly.
When working with Excel exports, keep these three key considerations in mind:
- Select CSV UTF-8: Standard Windows CSV (ANSI) will corrupt non-English symbols, Indian currencies (
₹), and European accents. Always select CSV UTF-8. - European Excel Delimiters: If your Excel installation uses comma as decimal separator, Excel will export CSV with semicolons (
;). Our ⚡ Auto-Detect Delimiter handles this automatically. - Date Columns: Excel exports dates as formatted strings (e.g.
2026-10-05or10/05/2026), which are preserved as clean JSON strings.
CSV Delimiter Support: Comma, Semicolon, Tab (TSV), and Pipe
Direct Answer: The converter supports all standard tabular separators: standard comma (,), European semicolon (;), Tab-Separated Values (\t / TSV), and pipe (|). Auto-detection inspects the file header and automatically applies the correct delimiter.
- Comma (
,): Standard for US, India, UK, and cloud database exports. - Semicolon (
;): Standard in Germany, France, Italy, and European Excel where comma is the decimal mark. - Tab (
\t- TSV): Standard for bioinformatics, raw database logs, and direct clipboard pastes from Excel or Google Sheets. - Pipe (
|): Common in mainframe data dumps, healthcare EDI systems, and Unix ETL pipelines.
RFC 4180 Compliance: Commas, Escaped Quotes & Multiline Fields
Direct Answer: Our parser strictly conforms to the RFC 4180 specification. Cells with embedded commas or line breaks are wrapped in double quotes, and internal quotes are escaped by doubling them ("").
- Embedded Commas:
101,"Bengaluru, Karnataka",India→ Safely parsed into single field"Bengaluru, Karnataka". - Escaped Double Quotes:
102,"55"" 4K Display",Electronics→ Accurately parsed into string"55\" 4K Display". - Multiline Cells: Text containing line breaks within quotes is preserved without splitting the row into multiple broken records.
CSV UTF-8, Unicode, and Byte Order Mark (BOM) Support
Direct Answer: The converter fully supports UTF-8 and Unicode characters, including Devanagari (आरव शर्मा), Chinese (中文), accented characters (é, ö, ñ), and currency symbols (₹, €, $). UTF-8 BOM headers (\xEF\xBB\xBF) are detected and stripped before parsing.
Excel often prepends a 3-byte Byte Order Mark (BOM) to CSV files. Many legacy parsers mistakenly attach the BOM to the first column header (e.g. id instead of id). Our converter strips the BOM cleanly, ensuring your JSON property names remain pristine.
Preserving Leading Zeros, ZIP Codes, and Phone Numbers
Direct Answer: Numeric type casting converts values like "00501" into integer 501. If your dataset contains postal codes, phone numbers (0987654321), or product SKUs with leading zeros, simply uncheck Parse Numbers to keep all values as preserved strings.
In data pipelines, numeric identifiers with leading zeros (e.g. US ZIP codes 02134, Indian IFSC codes, or ISO codes) must retain their string representation. Disabling numeric parsing ensures identifiers are never mathematically truncated.
Converting CSV Files Without Header Rows
Direct Answer: If your CSV file does not contain column names in the first row, uncheck the First Row Headers toggle. The tool will treat line 1 as data and auto-generate clean keys: field_1, field_2, field_3.
How Does the Converter Handle Uneven or Ragged CSV Rows?
Direct Answer: When an individual CSV row has fewer columns than the header definition, missing fields are safely populated with null. If a row contains extra trailing columns, they are preserved or omitted gracefully without throwing syntax errors.
How Do You Convert Flat Dot-Notated Columns into Nested JSON Objects?
Direct Answer: With the "Unflatten Dot Keys" option enabled, headers containing periods (e.g. user.address.geo.lat) are split by dot. The converter dynamically generates nested parent objects down the key path, resulting in rich object trees.
Relational databases and CSV files cannot natively represent 3D hierarchies. As a result, data exports flatten nested keys into dot notation (such as billing.card.last4). Our tool detects these paths and reconstructs the original nested JSON tree automatically without manual data mapping.
How Does Smart Type Detection Infer Numbers, Booleans, and Nulls?
Direct Answer: Smart type detection analyzes each cell string. Numeric values ("42", "-10.5") become native JavaScript numbers, "true"/"false" become native booleans, and empty cells or "null" strings become native null values.
How Are Arrays and Serialized JSON Strings Handled in CSV Cells?
Direct Answer: If a CSV cell contains a bracketed array (e.g. ["PHP", "Laravel"]) or serialized JSON object, checking "Parse JSON Cells" evaluates and embeds it directly as a native JSON structure rather than an escaped string.
CSV to JSON Array of Objects vs. JSONLines (NDJSON) vs. Keyed Dictionary
Direct Answer: Use Array of Objects for web APIs; use JSONLines (NDJSON) for large stream ingestion into BigQuery or Elasticsearch; use Keyed Dictionary when fast lookups by Primary ID are required.
| Output Mode | Structure Format | Streaming Friendly | Best Use Case |
|---|---|---|---|
| Array of Objects (Standard) | [ { "id": 1 }, { "id": 2 } ] | No (requires closing bracket) | REST APIs, JavaScript web apps, MongoDB insertMany |
| JSONLines / NDJSON | { "id": 1 } | Yes (line by line) | Google BigQuery, Elasticsearch, AWS CloudWatch, AI datasets |
| Keyed Object (Hash) | { "101": { ... }, "102": { ... } } | No | Direct $O(1)$ key lookup dictionaries in frontend state |
| Columnar Lists | { "id": [1, 2], "name": ["A", "B"] } | No | Data science charting (Chart.js, D3.js) and matrix math |
How to Convert Large CSV Files Exceeding 20MB to JSON
Direct Answer: Files up to 20MB (approx. 100,000–250,000 rows) are converted directly in your browser. For massive multi-gigabyte files (500MB to 5GB+), use streaming Python scripts with Pandas chunksize or command-line csvkit / jq to avoid browser tab memory exhaustion.
Browsers enforce strict memory quotas per tab (typically ~1GB heap). When parsing multi-gigabyte CSV database dumps, stream-based command-line tools read and output records line by line without loading the entire dataset into RAM.
How to Convert CSV to JSON Programmatically (Python, JavaScript/Node.js, PHP, jq)
Direct Answer: You can convert CSV to JSON programmatically using Python (pandas.read_csv().to_json()), Node.js (with streaming RFC-compliant parsers), PHP (fgetcsv() + json_encode()), or command-line jq.
1. Python (Pandas)
2. JavaScript / Node.js (RFC 4180 Streaming)
3. PHP
4. Command Line CLI (csvkit / jq)
Troubleshooting Common CSV Parsing and Conversion Issues
Direct Answer: Most conversion errors occur due to unescaped quotes inside cells, European semicolon delimiters being misidentified as commas, or missing header definitions in the first line.
- All Data Put into Single Column: If your CSV was created in Europe, values are separated by semicolons (
;). Select ; Semicolon or ⚡ Auto-Detect Delimiter. - Quotes Appearing Inside Values: Ensure RFC 4180 quotes are doubled (
""). For example,"55"" TV"correctly parses as55" TV. - Missing Headers / First Row as Data: If your CSV does not have column names in row 1, uncheck First Row Headers. The tool will auto-generate keys (
field_1,field_2). - Mojibake / Broken Accents (é): Save your original spreadsheet as CSV UTF-8 (Comma delimited) (.csv) in Excel to retain non-Latin characters.
Data Security & In-Browser Privacy Architecture
Direct Answer: Local CSV files and pasted data are processed 100% directly in your browser. When using the optional URL import feature, the target file is securely fetched via our server with SSRF filtering and passed directly to your browser for parsing.
- Local CSV files and pasted data are parsed client-side using in-browser JavaScript.
- Zero local CSV rows or proprietary customer records are stored, logged, or sent to external databases.
- When fetching remote files via URL, requests are processed with strict TLS/HTTPS encryption and private IP SSRF safeguards.
Frequently Asked Questions About Converting CSV to JSON
How does the converter auto-detect delimiters?
Our engine scans the first 10 rows of your file and checks consistency across commas (,), semicolons (;), tabs (\t), and pipes (|). It automatically selects the delimiter that produces consistent column counts.
Can I convert column names with dots into nested JSON objects?
Yes. With the "Unflatten Dot Keys" option checked, headers like user.contact.email and user.contact.city are automatically transformed into nested objects like {"user": {"contact": {"email": "...", "city": "..."}}}.
Does this tool convert numbers and booleans to native JSON types?
Yes. Smart type casting parses numeric text into integers/floats (e.g. 101, 99.95) and booleans into true or false literals instead of leaving them wrapped as strings.
What is JSONLines / NDJSON format and why should I use it?
JSONLines (Newline Delimited JSON) outputs each record as an individual JSON object on a separate line without surrounding array brackets. It is the preferred ingestion format for Google BigQuery, Elasticsearch, and LLM training datasets.
Why does my European CSV appear as a single row or column?
In European countries, Excel uses semicolons (;) as the column separator because the comma is used as a decimal mark. Choose ; Semicolon or ⚡ Auto-Detect Delimiter to parse it cleanly.
How does the converter handle commas inside quoted cell values?
Our parser follows RFC 4180 standards. Commas enclosed within double quotes (such as "Mumbai, Maharashtra") are treated as literal cell content and will not trigger a column break.
Can I convert Tab-Separated Values (TSV) files to JSON?
Yes. Select \t Tab (TSV) or upload a .tsv or .tab file. You can also paste directly from Excel or Google Sheets, which pastes as tab-delimited text.
Can I convert a CSV without headers in the first row?
Yes. Uncheck the First Row Headers toggle. The converter will automatically create sequential property keys (field_1, field_2, etc.) for each column.
How can I convert CSV cells containing JSON arrays?
Enable Parse JSON Cells. If a cell contains a valid JSON string (like ["PHP", "Laravel"] or {"zip": 560001}), it will be deserialized into native arrays/objects rather than remaining an escaped string.
Is there a file size limit for CSV conversions?
Our in-browser parser comfortably processes files up to 20MB (over 200,000 rows). For gigabyte-scale datasets, streaming Python or CLI tools (csvkit, jq) are recommended.
Is my data stored or saved on your servers?
No. Local files and pasted data are processed directly in your browser. URL fetch requests retrieve the target file into your browser for conversion without logging.
Can I convert the generated JSON back into CSV?
Yes. Use our companion JSON to CSV Converter to transform JSON arrays and nested structures back into Excel-compatible CSV files.
What is the difference between Array of Objects and Keyed Dictionary?
Array of Objects ([{}, {}]) is ideal for iteration and APIs. A Keyed Dictionary ({"101": {...}}) indexes each row by its primary key (e.g. ID column) for direct lookup.
How do I format or minify the output JSON?
Use the Minify button above the output window to compress JSON into a single compact line, or click Raw JSON for clean 2-space indentation.
Why do non-English characters look broken when exported from Excel?
When exporting from Excel, make sure to choose CSV UTF-8 (.csv) rather than standard CSV (ANSI) so international characters (Hindi, Devanagari, European accents) are preserved.