CSV to JSON Converter
ConvertersConvert CSV files to JSON arrays or objects with custom delimiters. Free, private — all processing in your browser.
The CSV to JSON Converter transforms CSV (Comma-Separated Values) data into JSON format — arrays of objects keyed by column headers. Supports standard comma delimiters, semicolon (European CSV), tab (TSV), pipe, and custom delimiters. Handles quoted fields with embedded commas, newlines, and escape characters per RFC 4180. Bidirectional: convert CSV → JSON or JSON → CSV with one click. Works with spreadsheet exports (Excel, Google Sheets, Numbers), database dumps, API data exports, and log files. Every conversion is instant and client-side — your data (which may include customer info, product catalogs, sales figures) never leaves your device.
CSV is the lingua franca of tabular data: Excel, Google Sheets, databases, financial systems, and virtually every business application export CSV. JSON is the dominant format for APIs and modern data pipelines. Converting between them is a daily task for data engineers, analysts, and developers. This tool handles tricky edge cases — international CSV (semicolons), multi-line cells, escaped quotes, inconsistent columns — and produces clean JSON ready to POST to an API or store in a database.
CSV to JSON Converter — key features
Bidirectional conversion
CSV → JSON or JSON → CSV. Toggle with one click. Both directions handle edge cases.
Multiple delimiters
Comma (standard), semicolon (European), tab (TSV), pipe, or custom. Auto-detect or specify.
Headers on/off
With headers: output is an array of objects keyed by column names. Without: array of arrays.
Type inference
Optional: convert `"36"` to `36` (number), `"true"` to `true` (boolean), empty to null. Off by default (all strings).
Nested object support
Column names like `user.name` and `user.email` create nested JSON: `{"user": {"name": ..., "email": ...}}`.
Handles quoted fields
Properly parses fields with commas, newlines, and escaped quotes per RFC 4180.
BOM handling
Byte Order Mark from Excel exports is stripped automatically.
Large file support
Multi-megabyte CSV files process without issue. Your browser's memory is the only limit.
How to use the CSV to JSON Converter
- 1
Paste CSV or upload file
Drop a .csv file, paste CSV text, or type directly. Auto-detection figures out the delimiter.
- 2
Verify delimiter
Check the detected delimiter (comma, semicolon, tab). Change if auto-detect got it wrong.
- 3
Configure headers
First row contains headers? Enable (usual default). Off if your CSV has no header row.
- 4
Enable type inference (optional)
Convert "36" to number 36, "true" to boolean true, etc. Off by default for strict string preservation.
- 5
View JSON output
Clean, formatted JSON appears instantly. Indentation is configurable (2 or 4 spaces).
- 6
Copy or download
Copy to clipboard or download as .json file. Ready for API POST, database import, or local analysis.
Common use cases for the CSV to JSON Converter
Data migration
- →Spreadsheet to API: Export Excel/Google Sheets as CSV, convert to JSON, POST to your API. Standard data migration workflow.
- →Database import: MongoDB, DynamoDB, Firebase accept JSON. Convert CSV for bulk imports.
- →Legacy system export: Old systems often only export CSV. Modern systems expect JSON. This bridges the gap.
Analysis and reporting
- →Analyze CSV in JavaScript: Developers convert CSV to JSON for easier manipulation in JavaScript (Array.filter, .map, .reduce).
- →Create dashboards from CSV: Business analysts get CSV reports, convert to JSON for charting libraries (Chart.js, D3, Plotly).
- →Data transformation: CSV → JSON → transform in Node/Python → back to CSV is a common ETL pattern.
Development and testing
- →Test fixtures from CSV: Convert spreadsheet test data to JSON for unit test fixtures.
- →Mock API responses: Create realistic mock data from CSV for frontend development before backend is ready.
- →Configuration management: Convert CSV configuration files (from non-technical stakeholders) to JSON for application use.
Business operations
- →Product catalog import: E-commerce platforms often accept JSON. Export from Excel/ERP, convert to JSON for import.
- →Customer data transfers: CRM imports/exports. CSV from legacy CRM → JSON for modern CRM API.
- →Marketing list conversion: Email list CSV → JSON for bulk email API submissions.
CSV to JSON Converter — examples
Simple CSV to JSON
Standard comma-separated with headers.
name,email,age Jane,jane@example.com,36 Bob,bob@example.com,42
[
{
"name": "Jane",
"email": "jane@example.com",
"age": "36"
},
{
"name": "Bob",
"email": "bob@example.com",
"age": "42"
}
]With type inference
Numbers become numeric values.
name,age,active Jane,36,true Bob,42,false
[
{ "name": "Jane", "age": 36, "active": true },
{ "name": "Bob", "age": 42, "active": false }
]European CSV (semicolon)
Common in European spreadsheet exports.
name;price;currency Widget;9,99;EUR Gadget;19,99;EUR
[
{ "name": "Widget", "price": "9,99", "currency": "EUR" },
{ "name": "Gadget", "price": "19,99", "currency": "EUR" }
]Quoted fields with commas
Names with commas must be quoted in CSV.
name,email "O'Brien, Patrick",patrick@example.com "Doe, Jane",jane@example.com
[
{ "name": "O'Brien, Patrick", "email": "patrick@example.com" },
{ "name": "Doe, Jane", "email": "jane@example.com" }
]Nested objects from dot-notation
Columns like user.name create nested structures.
id,user.name,user.email,order.total 1,Jane,jane@test.com,99.99 2,Bob,bob@test.com,149.99
[
{
"id": "1",
"user": { "name": "Jane", "email": "jane@test.com" },
"order": { "total": "99.99" }
},
{
"id": "2",
"user": { "name": "Bob", "email": "bob@test.com" },
"order": { "total": "149.99" }
}
]JSON to CSV
Reverse direction.
[
{ "name": "Jane", "age": 36 },
{ "name": "Bob", "age": 42 }
]name,age Jane,36 Bob,42
Technical details
CSV is defined by RFC 4180 (2005). A CSV file has:
- Records separated by CRLF (line breaks).
- Fields separated by commas (or another delimiter).
- Fields containing commas, newlines, or double-quotes must be enclosed in double quotes.
- Double quotes within quoted fields escaped as two double quotes ("").
- Optional header row as the first record, defining column names.
Example CSV:
``csv``
name,email,age
Jane Doe,jane@example.com,36
"O'Brien, Patrick",patrick@example.com,42
"Wrote ""Hello""",sample@example.com,28
Converts to JSON:
``json``
[
{"name": "Jane Doe", "email": "jane@example.com", "age": "36"},
{"name": "O'Brien, Patrick", "email": "patrick@example.com", "age": "42"},
{"name": "Wrote \\"Hello\\"", "email": "sample@example.com", "age": "28"}
]
CSV variants:
- Standard CSV (RFC 4180) — comma-separated, CRLF line endings.
- European CSV — semicolon-separated (because comma is the decimal separator in many European locales: 3,14).
- TSV (Tab-Separated Values) — tab delimiter, commonly used for data transfer where quoted fields are avoided.
- Pipe-delimited — rare, used by some legacy systems.
- Space-delimited — some Unix tools; ambiguous and fragile.
Output modes:
- Array of objects (default): [{name: "Jane", age: 36}, ...] — keys from first row (headers).
- Array of arrays: [["Jane", 36], ["Bob", 42]] — no keys, positional data.
- Nested objects: If column names use dot notation (address.street), output nests the structure.
Type inference:
By default, all values are strings ("36" not 36). Optional type inference:
- Numbers: 36 → 36 (int), 3.14 → 3.14 (float)
- Booleans: true, false, TRUE, FALSE
- Null: empty cells → null
- Dates: ISO 8601 strings stay as strings (parsing dates is error-prone)
Edge cases handled:
- Quoted fields with commas: "O'Brien, Patrick" → "O'Brien, Patrick" (comma preserved)
- Embedded quotes: "Wrote ""Hello""" → "Wrote \\"Hello\\""
- Multi-line fields: Fields with newlines must be quoted. Preserved in JSON output.
- Empty fields: a,,b → empty string "" or null depending on settings.
- Inconsistent columns: Some rows have more/fewer fields than headers. Options to truncate, pad with null, or reject.
BOM handling:
Files saved by Excel often have a Byte Order Mark (\\uFEFF) at the start. Most CSV parsers handle this automatically; legacy tools may show weird characters. This tool strips BOM by default.
Common problems and solutions
⚠Wrong delimiter detected
Auto-detection isn't perfect. European CSV (semicolon) sometimes gets detected as comma if values contain semicolons. Manually set delimiter if auto-detect is wrong.
⚠Byte Order Mark (BOM) in output
Excel often adds BOM (\uFEFF) at file start. Some parsers see this as a column name. Strip BOM before parsing (this tool does automatically) or save files without BOM.
⚠Inconsistent column counts
Some rows have more or fewer columns than headers. Options: truncate extra fields, pad missing with null, or reject the row. Check data quality before importing.
⚠Excel changing leading zeros
Excel treats `00123` as the number 123, losing the leading zeros. If your CSV has product codes or IDs with leading zeros, they may be corrupted. Use CSV files that weren't opened in Excel, or prefix with apostrophe to force text.
⚠Date formatting
Excel saves dates in various formats. `5/1/2026` could be May 1 or January 5 depending on locale. Use ISO 8601 (`2026-05-01`) in source data whenever possible.
⚠Quoted fields vs unquoted
RFC 4180 says fields with commas/newlines/quotes must be quoted. Sloppy CSV exporters may not quote consistently. Parse with lenient settings or fix the source CSV.
⚠Encoding issues
CSV with non-ASCII characters (é, ñ, 中文) may show garbled. Save as UTF-8 (not Windows-1252 or Latin-1). Excel's "Save As CSV" often uses system locale, not UTF-8 — use "CSV UTF-8" option.
⚠Type inference surprises
Auto type inference can misclassify: `00123` becomes `123` (losing zeros), `5.0` becomes `5` (losing decimal), `01/02/2026` becomes a date or number. Disable type inference if you need strict strings.
CSV to JSON Converter — comparisons and alternatives
CSV vs JSON: CSV is flat (no nesting), tabular, compact, universally readable in spreadsheets. JSON supports nesting, arrays, mixed types, more expressive but harder to visualize. Use CSV for simple 2D data, JSON for structured/nested data.
CSV vs Excel (.xlsx): CSV is plain text, opens anywhere. Excel is binary format requiring Excel or compatible apps. Excel supports formulas, multiple sheets, formatting. CSV is ONE sheet of values only. Convert Excel to CSV before JSON conversion.
CSV vs TSV: TSV uses tabs instead of commas. Simpler because tabs rarely appear in data (no escaping needed). Common in scientific data, database dumps. CSV is more widely supported.
CSV vs Parquet/Avro: Parquet and Avro are columnar binary formats used in big data (Hadoop, Spark). Smaller and faster for analytics. CSV is readable; Parquet/Avro requires specialized tools. Use CSV for small-medium datasets, Parquet for GB+ datasets.
JSON vs NDJSON (JSONL): NDJSON (Newline-Delimited JSON, .ndjson, .jsonl) stores one JSON object per line — ideal for streaming and log files. Standard JSON stores an array. NDJSON is easier to process line-by-line and append to.
Standard CSV vs European CSV: European countries use comma as decimal separator (3,14), so CSV files use semicolons instead of commas. Excel's default depends on system locale. Check delimiter when importing CSV from different locales.
Frequently asked questions about the CSV to JSON Converter
▶What is the difference between CSV and JSON?
CSV is flat, comma-separated, tabular data — think spreadsheet rows and columns. JSON supports nested objects, arrays, and mixed types. JSON is more expressive; CSV is simpler and universal. CSV: name,age\nJane,36. JSON: [{"name":"Jane","age":36}]. Same data, different format.
▶Is this CSV converter safe for sensitive data?
Yes. Conversion runs entirely in your browser. Customer lists, product catalogs, financial data — all stay on your device. No server interaction, no logging. Open DevTools Network tab to verify zero outbound requests.
▶What delimiter should my CSV use?
Comma (,) is the default (RFC 4180). Semicolon (;) is common in European countries (where comma is decimal separator). Tab (\t) for TSV files. Pipe (|) for data that may contain commas and semicolons. Match what your data source produces.
▶How do I handle commas inside values?
Quote the field: "O'Brien, Patrick" preserves the comma. Or use a different delimiter (semicolon, tab, pipe) that doesn't appear in your data.
▶What if my CSV has inconsistent columns?
Some rows have more/fewer columns than the header row. Options: Pad with null (shorter rows get null for missing fields). Truncate (longer rows get extra values ignored). Reject (error on inconsistent rows). Pick based on data quality.
▶Why does my Excel CSV look wrong?
Common Excel issues: (1) Locale: US Excel uses commas, EU Excel uses semicolons. (2) BOM: Excel adds Byte Order Mark — strip before parsing. (3) Encoding: Save as "CSV UTF-8" not "CSV" to preserve special characters. (4) Dates: Excel may auto-convert date-looking strings. Use ISO 8601 in source.
▶Can I convert nested JSON back to CSV?
Partially. Flat JSON (no nesting) converts cleanly. Nested JSON loses structure when converted to CSV. Workaround: flatten nested objects with dot notation (user.name), then convert. Loses the hierarchy but preserves all data.
▶What about null and empty values?
CSV empty cell (a,,b): may be interpreted as empty string "" or null, depending on settings. JSON null: explicit absent value. The tool lets you choose which to use for empty CSV cells.
▶How do I handle type inference issues?
Auto-inference converts "36" to number 36, "true" to boolean true, etc. This can corrupt product codes (0123 becomes 123), version strings (1.0 becomes 1), and other string-like numbers. Disable type inference to preserve all values as strings.
▶What file sizes can this handle?
Multi-megabyte CSV files process fine. Tens of thousands of rows work smoothly. Very large files (100+ MB) may slow your browser — for huge datasets, use command-line tools (jq, csvkit, pandas) that don't load everything into memory.
Additional resources
- RFC 4180 — CSV Format — IETF specification for CSV format.
- CSV on the Web (W3C) — W3C primer on tabular data and CSV.
- PapaParse — Popular JavaScript CSV parser.
- JSON Specification (RFC 8259) — IETF JSON standard.
- JSON vs CSV — Tooleras blog — Our comparison of data interchange formats.
Related tools
All ConvertersCSV to Markdown Table
Convert CSV or TSV data into clean GitHub-flavored markdown tables, bullet lists, or numbered lists with configurable delimiters, alignment, and pipe escaping.
CSV to SQL
Convert CSV data to SQL INSERT statements with auto type detection, escaping, and configurable table name and SQL dialect.
HTML Table to CSV
Convert HTML tables to CSV format for data analysis. Handles rowspan, colspan, and extracts clean tabular data.
JSON Formatter
Format, validate, and beautify JSON instantly in your browser
JSON to CSV
Flatten nested JSON into CSV rows — ready for Excel, Google Sheets, analysis
JSON to SQL
Generate SQL INSERT statements and CREATE TABLE from JSON arrays
Learn more
Explore more tools
200+ free tools that run in your browser.
Browse all tools →