How to use CSV to JSON Converter
What it does & when you need it
You exported a spreadsheet or pulled a report from some internal dashboard, and now you need it as JSON to seed a database, feed a test fixture, or POST it to an API. This converter reads CSV and emits pretty-printed JSON — an array of objects when the first row holds column names, or an array of string arrays when it doesn't. It parses the file the way the format actually works (quoted fields, embedded commas and newlines, escaped quotes), not with a naive comma split, and it does all of it in your browser, so a spreadsheet full of customer emails or salaries never leaves your machine.
How to use
- Paste your CSV into the input.csv buffer, press Sample to load an
example, or Upload a
.csv/.tsvfile. - Pick the Delimiter that matches your data (comma, semicolon, tab, or pipe) and tick First row is header if row one contains column names.
- Read the JSON in the output.json buffer — it updates as you type. The status bar shows how many records were produced, or points out a parse problem such as an unclosed quote.
- Press Copy JSON or
Ctrl/Cmd+Enterto copy the result. Need it indented differently or re-validated afterwards? Send it to the JSON Formatter.
Things worth knowing
There is a spec, and this tool follows it. CSV was informally standardized
late as RFC 4180. The rules that matter: any field containing the delimiter, a
double quote, or a line break must be wrapped in double quotes, and a literal
double quote inside such a field is written as two quotes (""). That is why
"Doe, John" stays one field and "He said ""hi""" decodes to He said "hi".
Never parse CSV with String.split(','). It is the classic bug: it looks
fine on toy data and then corrupts the first row that contains a quoted comma
("Amsterdam, NL") or a newline inside a quoted cell. Once a field can contain
the delimiter, you need a real state machine that tracks whether you are inside
quotes — which is exactly what this parser does.
The delimiter is not always a comma. Many European locales export with a
semicolon because the comma is their decimal separator (3,50 means three euros
fifty). Files from those systems will look like a single giant column until you
switch the delimiter to ;. Tab-separated (TSV) and pipe-delimited exports are
common too, so the delimiter selector covers all four.
Watch for an invisible byte-order mark. Excel and some Windows tools prepend
a UTF-8 BOM (U+FEFF) to the file. Left in place it becomes stray characters
glued to your first header — you get a key like id instead of id, which
then breaks every downstream lookup. This tool strips a leading BOM before
parsing so the first column name is clean.
Values stay as strings. CSV has no type system, so 36 and true come
through as the strings "36" and "true" rather than a number or boolean —
coercing them would guess wrong on ZIP codes, phone numbers, and leading zeros.
Cast the fields you actually need on the consuming side. If your target format
is different, the YAML to JSON converter follows the same
in-browser approach for config files.