CSV to JSON Converter
Convert CSV to JSON and back — with quoted fields, custom delimiters, and headers.
About CSV to JSON
A CSV to JSON converter turns spreadsheet-style CSV into structured JSON, and converts JSON to CSV back again. Paste CSV to get an array of objects keyed by the header row, or paste a JSON array of objects to get CSV. It correctly handles quoted fields, commas and line breaks inside values, and custom delimiters (comma, tab, semicolon, pipe). Everything runs in your browser — your data is never uploaded.
Why splitting on commas fails
The obvious way to parse CSV — split each line on commas — breaks on real data almost immediately. A field containing a comma is wrapped in quotes, so the address field in a customer export is one value, not two. A quote inside a quoted field is escaped by doubling it. And a quoted field may contain actual line breaks, which means a single record can span several lines and you cannot even split the file into rows by newline first.
A correct parser walks the text character by character, tracking whether it is currently inside a quoted field. That is the difference between a converter that handles an export from a real spreadsheet and one that quietly mangles every row containing a comma in a description.
CSV has no types
Everything in a CSV file is text. JSON has real types, so conversion has to guess, and the guesses are where data gets damaged. A value like 007 is a string in intent and a number to a naive parser, which will hand back 7 and lose the leading zeros — the classic way to destroy a column of postal codes or product IDs.
Long numeric IDs are worse. Anything beyond about 16 digits exceeds what a double can represent exactly, so a 19-digit identifier silently changes its last few digits. If a column is an identifier rather than a quantity, keep it as a string. The test is simple: would you ever do arithmetic on it? If not, it is text.
Delimiters, encodings, and Excel
The C in CSV is optimistic. In locales that use a comma as the decimal separator — much of Europe — Excel writes and expects semicolons instead. Tab-separated files are common in data exports because tabs rarely appear inside values. That is why picking the delimiter matters, and why a file that looks like one enormous column has usually just been read with the wrong one.
Encoding causes the other half of the problems. A file saved as UTF-8 without a byte-order mark will often open in Excel with accented characters mangled, because Excel assumes the local legacy encoding. If names come back as mojibake, the data is fine and the reader guessed wrong — re-import specifying UTF-8 rather than trying to repair the characters.
Going back to CSV
The reverse direction has its own trap: JSON is nested and CSV is flat. An array of objects with only scalar values converts cleanly. An object containing another object has no natural representation, so it must either be flattened into dotted column names or serialised into a single cell — and both choices lose something. Decide deliberately rather than accepting whatever the tool does by default.
Rows with different keys are the other issue. JSON allows each object to have its own shape; CSV needs one header row for everything. Missing fields become empty cells, which is usually fine, but a key that appears in only one of ten thousand records adds a column that is empty everywhere else. Normalise the shape before converting if you want a tidy file.
Frequently asked questions
- How does it handle commas inside a field?
- Fields wrapped in double quotes can contain commas, line breaks, and escaped quotes (""). The parser follows the standard CSV (RFC 4180) rules, so quoted values convert to JSON correctly.
- Can I convert JSON back to CSV?
- Yes. Use the swap button to switch direction. Give it a JSON array of objects and it produces CSV, using the union of all keys as the header row.
- Does the first row become the JSON keys?
- When the header toggle is on, the first CSV row is treated as the header and each following row becomes an object keyed by those column names — the array-of-objects shape most APIs expect. Turn it off for raw rows.
- What delimiters are supported?
- Comma, tab, semicolon, and pipe. Pick the one that matches your data — tab handles TSV files, and semicolon suits European spreadsheets.
- Is my data uploaded anywhere?
- No. The conversion happens entirely in your browser; nothing you paste is sent to a server.

