CSV to JSON Converter
Convert CSV to JSON and back. Handles quoted fields, custom delimiters and type detection.
Convert CSV to JSON or JSON back to CSV in your browser. It handles the details that break naive converters: quoted fields containing commas, embedded line breaks, escaped quotes, semicolon and tab delimiters, and automatic detection of numbers and booleans. Nothing is uploaded, so a customer export or a finance extract stays on your machine.
How CSV to JSON Converter works
CSV looks trivial until you meet real data. The format has no official specification beyond RFC 4180, and a field can legally contain the delimiter itself, a line break, or a double quote — as long as the field is quoted and internal quotes are doubled. A converter written with `split(',')` gets all three wrong, which is why a name like "Hopper, Grace" so often ends up splitting into two columns. This tool implements a proper character-by-character parser that tracks quote state, so those cases come through intact.
Delimiters are the next trap. Comma is standard in English-language locales, but Excel in most of Europe writes semicolons, because comma is the decimal separator there. Tab-separated files are common from databases, and pipe-separated files turn up in older enterprise exports. Rather than making you guess, the tool counts candidate delimiters in the first line and picks the most likely one — with a manual override when the guess is wrong.
Type detection is a genuine judgement call. JSON distinguishes the number 42 from the string "42", CSV does not, and which one you want depends on the column. The rule used here is conservative: clean integers and decimals become numbers, `true`/`false` become booleans, empty cells become null, and anything else stays a string. Crucially, values with leading zeros — `007`, postcodes, phone numbers, account IDs — deliberately stay strings, because converting them to numbers destroys the leading zero and silently corrupts the data. That is the single most common way automated CSV imports go wrong.
Going the other way, nested JSON objects are flattened using dot notation (`address.city`), matching the behaviour of our JSON Converter, and the header row is the union of every key seen across all rows, so records with missing fields still line up under the right columns.
How to use CSV to JSON Converter
Pick a direction
CSV → JSON to turn a spreadsheet export into structured data, or JSON → CSV to get an API response into Excel or Sheets.
Paste or open a file
Paste the rows directly, or open a .csv, .tsv or .json file. The delimiter is detected automatically.
Adjust and export
Toggle whether the first row is a header and whether to convert numbers and booleans, then copy or download the result.