Home Text Data Developer Files Media Utilities

CSV to JSON Converter Privacy: All processing runs locally

Convert CSV, TSV, or delimited text to JSON. Supports custom delimiters, quoted fields, type inference, nested JSON, and multiple output formats.

πŸ“‚ Drop a .csv, .tsv, or .txt file here, or click to select
Examples:
Input (CSV / TSV / Delimited) 0
Output (JSON) 0
Parsing Options β–Ό

How It Works

CSV Parsing and Quoted Fields

CSV (Comma-Separated Values) is a simple text format for tabular data. Each row is a line, and fields are separated by a delimiter character. When a field contains the delimiter, line breaks, or quote characters, it must be enclosed in quotes. Escaped quotes inside quoted fields are represented by doubling the quote character: "she said ""hello""".

Delimiters: Comma, Semicolon, Tab, Pipe, Custom

This tool auto-detects whether your data uses commas, semicolons, tabs, or pipes by analyzing the first few rows. You can also override the delimiter manually. Custom single-character delimiters are supported for formats like tilde-separated or colon-separated data. Auto-detection can fail on very small or irregular samples β€” manual override helps in those cases.

Headers and Generated Column Names

By default, the first row is used as JSON object keys. If your data has no header row, select "No header row" and column names like column1, column2 will be generated automatically. You can also type custom headers. Duplicate or empty headers are detected and can be deduplicated automatically.

Type Inference and When to Keep Strings

In "Safe" mode, obvious numbers (like 42 or 3.14), booleans (true/false), and null are converted to their JSON types. Values with leading zeros (like ZIP codes 08001 or IDs 00123) are preserved as strings to avoid data loss. Large integers beyond JavaScript's safe integer limit are also preserved. Set type inference to "Off" to keep every value as a string.

Nested JSON from Dotted Headers

Enable "Build nested JSON" to transform headers like user.name and user.email into nested objects:

{ "user": { "name": "Alice", "email": "alice@example.com" } }

Bracket notation like user[name] is also supported. If a conflict occurs (e.g., both user and user.name exist), a warning is shown.

JSON Output Formats

Array of Objects is the default β€” each row becomes a JSON object with headers as keys. Array of Arrays includes headers as the first sub-array. Object Keyed by Column uses a selected column's values as object keys. JSON Lines (NDJSON) outputs one JSON object per line β€” useful for log processing, streaming, and database imports. Column Arrays groups all values for each column into an array.

CSV to JSON vs JSON to CSV

This tool converts CSV β†’ JSON. To go the other way (JSON β†’ CSV), use the JSON to CSV converter. The "Swap" button opens the JSON to CSV tool directly.

Privacy and Local Processing

All parsing and conversion runs entirely in your browser using JavaScript. Your CSV data, file contents, headers, and output are never sent to any server. No data is stored in cookies, localStorage, or any remote service. You can verify this by checking the Network tab in your browser's DevTools β€” there are zero requests during conversion.

Frequently Asked Questions

Is my CSV uploaded?
No. All processing happens locally in your browser. Your data never leaves your device. There are no server requests during conversion.
Can I convert TSV to JSON?
Yes. Tab-separated values are auto-detected, or you can select "Tab" as the delimiter manually. TSV files (.tsv) can also be loaded via the file input.
What if my CSV uses semicolons?
Semicolons are auto-detected in most cases. If auto-detection fails, select "Semicolon" from the delimiter dropdown in Parsing Options. This is common with European CSV exports (e.g., from Excel with German locale).
How are quoted commas handled?
Fields containing commas (or any delimiter) should be enclosed in double quotes per RFC 4180. The parser correctly handles "value with , comma" as a single field.
Can I keep all values as strings?
Yes. Set "Type inference" to "Off" in Parsing Options. Every value will remain a JSON string, including numbers, booleans, and null-looking values.
How do I create nested JSON?
Check "Build nested JSON from dotted headers" in Parsing Options. Headers like user.name or address.city will create nested objects. Bracket notation like user[name] also works.
What happens with duplicate headers?
By default, duplicates are renamed: name, name_2, name_3. You can disable deduplication in Parsing Options. In strict mode, duplicate headers cause an error.
What is JSON Lines (NDJSON)?
JSON Lines (also called NDJSON or newline-delimited JSON) outputs one JSON object per line without wrapping them in an array. It's widely used for log files, streaming APIs, MongoDB imports, and data processing pipelines.
Why did my ZIP code lose a leading zero?
In "Safe" type inference mode, values with leading zeros (like 08001) are preserved as strings. If you're using "Aggressive" mode, try switching to "Safe" or "Off". Leading zeros are a strong signal that the value is an identifier, not a number.
Can I convert JSON back to CSV?
Yes, use the JSON to CSV converter. You can click "Swap β†’ JSON to CSV" to navigate there directly.