CSV to JSON Converter
CSV looks simple, and that is the trap
A CSV file looks like the simplest format in computing: rows, commas, done. The simplicity is real only until the data contains a comma of its own — a name like "Ana, A.", an address, a product description — at which point the format's one rulebook, RFC 4180, does the heavy lifting: fields containing commas, double quotes or line breaks are wrapped in double quotes, and a quote inside a quoted field is written twice. A converter that splits lines on commas, as quick scripts often do, will cheerfully tear "Ana, A." into two fields, shift every value after it one column left, and hand you JSON that parses perfectly and is completely wrong. This page runs a proper character-by-character parser instead, so quoted fields may contain commas, doubled quotes and even full newlines, and the values come out the other side intact.
The shape of the output is the other decision worth understanding. JSON's natural mirror of a table is an array of objects, one per row, with the header row supplying the keys — that is what APIs, configuration files and JavaScript code actually consume, and it is what this converter produces. Values are kept as strings by default, because CSV itself has no types: the text 30 in a file is just two characters until someone decides it means a number. The numbers toggle exists for the columns where that decision is obvious (quantities, prices), and the FAQ below explains why identifiers with leading zeros should never be converted. The trim toggle handles the other everyday reality, files exported with a space after every comma, and the delimiter option handles the European one: where the comma is a decimal mark, exports use semicolons, and the auto-detect setting tests comma, semicolon and tab against your first lines and picks the separator that yields a consistent field count.
Everything runs in your browser. The upload button reads the file locally — it is not sent to a server — and the copy and download buttons work on the converted text on your machine. Row and column counts are shown after every conversion, because the first symptom of a malformed file is a count that surprises you, and silent success on bad data is the one failure mode a converter must never have.
Worked example
Input (the sample above): headers name,age,city, then the row "Ana, A.",30,Lisbon and a plain row Bruno,41,Porto.
Output: [{"name": "Ana, A.", "age": "30", "city": "Lisbon"}, {"name": "Bruno", "age": "41", "city": "Porto"}] — shown pretty-printed in the result box. Three things to notice: the comma inside the quotes stays inside the value, so the object has exactly the three header keys; the ages are strings ("30", not 30) because the numbers toggle is off; and flipping that toggle on would emit 30 and 41 as real JSON numbers while leaving the names and cities untouched.
Reading the counts, and other notes
| What you see | What it usually means |
|---|---|
| Rows = your data rows, columns = header count | A clean conversion; spot-check one quoted field and ship it |
| A row with fewer keys than the header | That row was short — a missing trailing value, or a line break inside an unquoted field |
| Everything in one giant column | Wrong delimiter: try setting semicolon or tab manually |
| Values like "007" became 7 | The numbers toggle converted an identifier; turn it off for ID columns |
| One field swallows several rows | An opening quote with no closing quote — the parser reached the end of file inside a quoted field |
Two habits make conversions boring in the best way. First, always eyeball the first converted object against the first data row before using the output — ten seconds that catch delimiter and quoting problems while they are still free. Second, keep the original CSV: JSON converted from it can be regenerated in seconds, while CSV reconstructed from edited JSON inherits every decision you made along the way. Boring is the goal; data plumbing should never be interesting.
Frequently asked questions
How does the converter decide the keys of each object?
The first row is treated as the header row, and its values become the keys, in order. Every following row becomes one object in the output array, with its fields matched to those keys by position. That is why a header row is not optional for this tool: without names for the columns, the honest JSON shape would be an array of arrays, which almost no API or script actually wants. If your CSV has no header, add one as the first line before converting.
What happens to a field that contains a comma?
It survives, provided the CSV quotes it — which proper CSV always does. Under RFC 4180, a field containing a comma, a quote or a newline is wrapped in double quotes, and quotes inside it are doubled. So the row "Ana, A.",30,Lisbon under the headers name,age,city produces {"name": "Ana, A.", "age": "30", "city": "Lisbon"}: the comma inside the quotes is part of the value, not a separator. If your file was exported without quoting, no converter can reliably guess where fields end, and fixing the export is the real solution.
Should numbers stay as strings or become real numbers?
It depends on what the values mean, which is why it is a toggle here rather than a default imposed on you. Quantities, prices and measurements usually want to be JSON numbers so code can add them without parsing. Identifiers that merely look numeric — phone numbers, account codes, anything with a leading zero like 007 or 030 — must stay strings, because converting them destroys information (007 becomes 7). A safe habit: convert numbers only when you intend to do arithmetic on the column.
Why does my file use semicolons, and will it still work?
Because in much of Europe the comma is the decimal separator, so Excel in those locales exports CSV with semicolons as the field separator to avoid ambiguity. The delimiter is set to auto-detect here, which tests comma, semicolon and tab against your first lines and picks the one that produces a consistent number of fields. If detection ever guesses wrong — very small or irregular files can fool it — set the delimiter manually in the options and the conversion follows immediately.
What happens when a row has more or fewer fields than the header?
The converter reports the row and column counts so a mismatch is visible rather than silent. Extra fields beyond the header count have no key to live under and are ignored with the counts telling you it happened; missing fields produce objects where those keys are simply absent, mirroring the data as it is. A ragged file is usually a sign of an unquoted comma somewhere above — the row counts are your first clue about which line to inspect.
Related tools
Parsing rules and worked example last verified: 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.