CSV to JSON Converter
Bidirectional CSV ↔ JSON. Auto-detect delimiter, header row, type conversion. 100% browser-only.
CSV vs JSON — when each makes sense
CSV (Comma-Separated Values) is the lowest-common-denominator tabular format. Every spreadsheet, database, and analytics tool reads and writes it. It's compact, line-oriented, easy to grep — but lacks types, hierarchy, and nested structure.
JSON (JavaScript Object Notation) is the modern API format. It supports nested objects, arrays, types (string, number, boolean, null), and is the default for REST APIs and JavaScript ecosystems. More verbose than CSV but more expressive.
Convert when you need to bridge: pulling a CSV export from a tool and feeding it into a JSON-based API, or exporting a JSON dataset to import into Excel.
How CSV parsing actually works
A naive CSV parser splits on commas. That breaks the moment any cell contains a comma — which is constant in real data (addresses, decimal numbers in some locales, descriptive text). Real CSV uses quoting:
- Cells containing commas, quotes, or newlines are wrapped in double quotes.
- Quotes inside quoted cells are escaped by doubling:
"She said ""hi""". - Newlines inside quoted cells are part of the cell, not a row separator.
- RFC 4180 codifies these rules; most tools follow it loosely.
Our parser handles all three. If you see weird output, the input probably uses non-standard escaping (single quotes, escaped commas with backslash, etc.) — those need preprocessing.
Common CSV gotchas
- UTF-8 BOM: Excel sometimes adds
at the start. The first column header may look likenamewith an invisible character. Strip it before parsing. - Line endings: Windows uses CRLF (
\r\n), Unix uses LF (\n), old Mac uses CR (\r). Our parser handles all three. - Locale delimiters: European locales often use semicolons because comma is the decimal separator. Auto-detect handles this.
- Empty cells vs null: a missing value in CSV is just empty (
,,). JSON can distinguish empty string from null. With type conversion on, empty cells becomenull. - Leading zeros: phone numbers, ZIP codes, IDs that start with zero get mangled if you convert to number. Toggle type conversion off when these are present.
JSON for tabular data — array of objects
The most common JSON shape for tabular data is an array of flat objects with consistent keys: [{a:1,b:2},{a:3,b:4}]. This maps cleanly to CSV rows. Some APIs use a different shape — {rows:[...], columns:[...]} — which needs a transformation step before this converter can handle it.
When to use programmatic alternatives
For one-off conversions or quick sanity checks, this tool is perfect. For repeated/scripted work or large files:
- jq: command-line JSON processor. Pair with
csvtojsonfor the bridge. - csvkit:
csvjsoncommand does this exact conversion at scale. - pandas (Python):
pd.read_csv().to_json()for full-power data manipulation. - papaparse / d3-dsv (JavaScript): production-quality CSV libraries.
Privacy: your data stays in your browser
All conversion happens client-side. No upload, no logging. Safe for sensitive data — internal customer lists, financial exports, anything you wouldn't paste into a third-party site. Verify by checking your browser's network tab while using the tool.
For other developer utilities: JSON Formatter for pretty-printing/validation, Base64 Encoder/Decoder, and URL Encoder/Decoder.