CSV to JSON
Turn a CSV file or pasted rows into JSON, with optional type detection that never mangles identifiers.
Processed on your device — no upload
Type detection is deliberately cautious: 007 and +44 7700 stay strings, because a leading zero or a plus sign means an identifier rather than a number.
How to use it
- Paste your CSV or choose a file.
- Check the detected delimiter and decide how values should be typed.
- Copy the JSON, or download it.
How it works
CSV looks like the simplest format there is and is not. A field can contain the delimiter if it is quoted, a quote if it is doubled, and a newline if it is inside quotes. The parser here follows RFC 4180 properly, which is why "Haddad, Sara" stays one field rather than becoming two.
The delimiter is detected rather than assumed, by counting candidates outside quoted sections. A semicolon-separated European export whose text fields contain commas would otherwise be read as comma-separated and shred every row.
Type detection is deliberately cautious. Turning "007" into 7 destroys an identifier, and "1.2.3" is a version rather than a number. Only values that survive a round trip — parse to a number, print back to exactly the same text — are converted. Everything else stays a string.
A byte-order mark at the start of the file is stripped first. Left in place it becomes an invisible part of the first column name, so id silently stops matching id.
A worked example
You export 4,000 customers from a CRM and need them as JSON for an import script. Press Load a sample CSV to see the shape of the problem in miniature.
The sample contains "Haddad, Sara" — a quoted field with a comma in it. In the output that is one name value. A naive split on commas would have produced a row with one extra field and shifted every subsequent value one column to the left, which is the failure that turns an email address into a city.
Look at the id values: "001" stays a string in the JSON. Switch type detection off and everything becomes a string; switch it on and orders becomes a number and active becomes a boolean, while the zero-padded identifier is left alone. That distinction is the difference between an import that works and one that silently renumbers your records.
The status line reports the detected delimiter. If it says something you did not expect, set it explicitly before trusting the output — that field is the single fastest way to spot a mis-parsed file.
If the CSV is messy to begin with — stray spaces, blank rows, duplicated lines — clean it first. Going the other way, JSON to CSV flattens nested objects back into a table.
Questions
What shape does the output take for an API?
An array of objects by default, one per row, keyed by the header. That is what most API endpoints expect to receive.
Is my data uploaded?
No. Parsing runs in your browser and this site has no backend. That matters here more than for most tools, since a CSV export is usually customers, orders or staff.
How does it handle commas inside a field?
Correctly, provided the field is quoted — which is what any well-formed CSV does. "Haddad, Sara" stays one field rather than splitting into two.
Why did my ID keep its leading zeros?
Because type detection is cautious by design. A leading zero means an identifier, so 007 stays "007". Turning it into 7 would silently corrupt your data.
What if my file uses semicolons?
It is detected automatically, by counting delimiters outside quoted sections. You can also set it explicitly if the detection guesses wrong.
Can it handle newlines inside a field?
Yes. A newline inside a quoted field is part of the value, not the end of the row, and multi-line addresses and notes survive intact.
What happens to rows with the wrong number of columns?
Missing values become empty and extra values are dropped when mapped to object keys. The CSV cleaner will show you which rows are ragged.
Is there a size limit?
No fixed limit. The whole file is held in memory, so tens of megabytes are fine on a laptop and a very large export may struggle on a phone.
Why is my first column name slightly wrong?
Usually a byte-order mark, which this tool strips. If a name still looks odd, check for trailing spaces — the CSV cleaner trims them.
Can I convert a CSV file rather than paste the text?
Either way. Choose a file and CSV file to JSON runs on its contents, or paste the rows straight in — the conversion is identical, since the file is only read into the same box you would have typed into.