# CSV to JSON Converter

> Converts a CSV export into JSON, in your browser, with the quoting rules a spreadsheet actually uses. Quoted commas, escaped quotes and line breaks inside a cell all survive, and the file is never sent anywhere.

Use it: https://tessalor.com/en/data/csv-to-json

This tool runs entirely in the browser. Nothing entered into it is uploaded.

## How it is done

1. Read the chosen file in this tab and decode it as UTF-8, discarding the byte-order mark Excel writes at the front.
2. Work out the column separator by counting commas, semicolons, tabs and pipes in the first complete record, outside any quotes — or use the one you picked.
3. Walk the text one character at a time, tracking whether the parser is inside a quoted field, so a separator or a line break inside quotes stays part of the cell.
4. Treat two consecutive quotes inside a quoted field as one literal quote, which is how RFC 4180 escapes them.
5. Take the first row as keys when you say there is a header, padding short rows and naming blank or duplicated headers positionally so no column is silently lost.
6. Serialise to JSON with two-space indentation and offer it as a download. Nothing is uploaded at any point.

## Assumptions

- Every value comes out as a string. CSV has no types, and guessing that "007" is the number 7 loses information that cannot be recovered.
- The file is read into memory in one piece, which is why it is capped at 20 MB, 500,000 rows and 5,000 columns. Larger exports belong in a spreadsheet or a database rather than a browser tab.
- The text is decoded as UTF-8. A file saved in a legacy Windows code page will convert, but accented characters may come through as replacement characters.

## Inputs

| Name | Label | Type | Default | Range |
| --- | --- | --- | --- | --- |
| `source` | CSV file | file | chosen on your device | text/csv, text/plain, up to 20 MB |
| `layout` | Shape of the JSON | select | objects |  |
| `header` | The first row is a header | toggle | true |  |
| `delimiter` | Column separator | select | auto |  |

## Outputs

- `rows` — Rows converted (integer), primary
- `columns` — Columns (integer)
- `separator` — Separator used (text)

## Questions

### Is my CSV uploaded anywhere?

No. The file is read in this browser tab and converted by a worker running on your own machine. There is no server to send it to, and the automated test for this page fails if any request leaves this site while a file is loaded.

### Why are all my numbers strings?

Because CSV has no types, and guessing costs more than it saves. A leading zero in a product code, a phone number, a version like 1.10 — every one of those is destroyed by a converter that decides it looks numeric. Convert the columns you know about on the other side, where you know what they mean.

### My file uses semicolons. Will that work?

Yes. Much of Europe exports semicolon-separated files, because the comma is the decimal point there. The separator is detected from the first complete record, and you can override it under "More options" if the guess is ever wrong.

### What happens to a cell that contains a comma or a line break?

It survives. A spreadsheet wraps such a cell in quotes, and the parser tracks whether it is inside a quoted field, so the comma stays part of the value instead of splitting the row. Doubled quotes inside a quoted field become one literal quote, per RFC 4180.

## Sources

- [RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files](https://www.rfc-editor.org/info/rfc4180/) — IETF, applies to 2005. Retrieved 2026-07-30.
- [RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format](https://www.rfc-editor.org/info/rfc8259/) — IETF, applies to 2017. Retrieved 2026-07-30.
- [Encoding Standard, UTF-8 decode](https://encoding.spec.whatwg.org/) — WHATWG, applies to 2026. Retrieved 2026-07-30.

---

Estimate, not advice. See https://tessalor.com/en/disclaimer.
Machine-readable catalogue: https://tessalor.com/api/tools.json
