How to convert CSV to JSON
- Drop a
.csvfile into the box above, or paste the rows straight into the CSV field. Nothing is uploaded either way. - Leave the delimiter on Detect automatically unless the guess is wrong — comma, semicolon, tab and pipe are all recognised.
- Choose the shape: an array of objects, which is what APIs and import tools expect, or an array of arrays if you want the raw grid.
- Press Convert to JSON, then read the report underneath before you copy the result. It is the part that matters.
Why the report is the point
Every CSV to JSON converter handles a tidy file correctly; that part is a solved problem. Real files are not tidy, and the damage they cause is quiet: a column silently shifted by one, a postcode that lost its leading zero, an address split into two records. Nothing errors. You find out weeks later, from the data.
So this tool counts. After every conversion it tells you how many records it read, how many rows had the wrong number of fields, whether a byte order mark was stripped, which duplicate headers were renamed, and how many numeric-looking values it deliberately refused to turn into numbers. If none of that applies to your file, it says so. The point is that you are told either way rather than left to assume.
The four things that quietly break a conversion
| In the file | What usually happens | What happens here |
|---|---|---|
| A line break inside a quoted field | The record is split in two; both halves are wrong and neither is flagged | Kept as one record. The page shows text lines next to record count so you can see the gap |
| A byte order mark at the start | The first key becomes an invisible-prefixed string nothing will match | Removed before parsing, and reported |
| Two columns with the same name | The second overwrites the first in the JSON object; the column disappears | Renamed to name_2, with every rename listed |
| A row with more or fewer fields than the header | Truncated or misaligned, shifting values into the wrong keys | Counted and reported; surplus fields can be kept in _extra |
Newlines inside fields: the one that costs the most
A CSV field can contain a line break. It happens constantly — a shipping address, a comment box, a product description pasted out of a document. The rule in RFC 4180 is that such a field must be wrapped in quotes, and the line break inside it belongs to the value rather than ending the record.
The fast way to write a CSV parser is to split the text on newlines and then split each line on commas. That parser reads a three-record file with one quoted line break as four records, one of which begins mid-sentence. This one walks the file character by character and tracks whether it is inside quotes, which is slower to write and the only way to be right.
Numbers are where data goes missing
Type conversion is convenient and occasionally destructive. Two cases are worth knowing about, because both are common and neither announces itself:
- Leading zeros.
00721is a postcode, not the number 721. Convert it and the zeros are gone for good. - Long whole numbers. JavaScript holds integers exactly only up to
9,007,199,254,740,991. Past that — which covers most 17-digit order, account and
barcode numbers — converting changes the final digits.
9007199254740993becomes9007199254740992.
Both stay as text here, and the page counts how many values were held back for that reason. You can switch conversion off entirely if you would rather every value arrive as a string.
Next steps
Going the other way is JSON to CSV, which flattens nested objects into dotted column names. If the file is too large to work with in one piece, split CSV breaks it up without cutting through a quoted field.