CSV ↔ JSON Converter

Both directions, with quoted fields and type detection handled.

—

Why CSV is not as simple as splitting on commas

A compliant CSV parser has to handle quoted fields that contain the delimiter itself — the row "Lin, Wei",designer contains a comma inside a name. Splitting that string on commas produces four fields instead of two and silently corrupts every downstream record. Quoted fields may also contain newlines, and a quote inside a quoted field is escaped by doubling it. This converter implements those rules rather than doing a naive split, which is the difference between a tool you can trust on real exports and one that breaks the moment a field contains a comma.

Type detection and its risks

CSV has no type system: everything is text, and it is up to the consumer to decide that 36 is a number and true is a boolean. Automatic detection is convenient but dangerous in specific cases. Zip codes like 01234 become the number 1234 when the leading zero is dropped. Long identifiers lose precision above 2^53 when parsed as JavaScript numbers. Values like NO or 1-2 can be coerced into something unintended. If your data contains identifiers, codes or anything with significant leading zeros, treat the output as a starting point and quote those fields explicitly.

Delimiters and locales

Semicolon-delimited files are standard in much of Europe because comma is the decimal separator there — exporting a spreadsheet with German locale settings produces ; delimited data by default. If a file appears to have only one column, the delimiter is the first thing to check. Tab-delimited files are common in bioinformatics and log exports. This tool lets you pick; if you are unsure, open the file in a text editor and look at what actually separates the fields on the header row.

Encoding and line endings

Two issues cause most "the file looks wrong" reports. Encoding: a UTF-8 file opened as Latin-1 turns accented characters into mojibake, and files exported from older Windows tools may be encoded in a legacy code page entirely. Line endings: Windows uses CRLF, Unix uses LF, and old Mac files used CR — a parser that only handles one will produce a single giant row or spurious empty ones. If conversion produces odd results, check the encoding first. This tool treats both CRLF and LF as row separators.

When JSON is the wrong target

JSON repeats the header keys on every row, so a wide table becomes much larger as JSON than as CSV — for large datasets, CSV or a columnar format like Parquet is far more efficient to store and transfer. JSON also has no native date type, so dates arrive as strings and need an agreed format. For genuinely large files, convert in chunks rather than pasting a hundred megabytes into a browser tab. To clean up rows before converting, run them through the duplicate line remover, and use the regex tester to normalise awkward fields first.