CSV to JSON Converter
Runs locallyTurn CSV or TSV into JSON records, with types detected and dotted headers nested.
CSV
JSON
2 records · comma-separated
[{"id": 1001,"customer": {"name": "Ada Lovelace","city": "London"},"zip": "02134","total": 113.5,"paid": true},{"id": 1002,"customer": {"name": "Pauling, Linus","city": "Portland"},"zip": null,"total": 249,"paid": false}]Every CSV cell is text until you decide otherwise
CSV has no types: 42, true and 2024-01-15 are all just characters between delimiters. A converter has to decide what to turn into numbers and booleans, and a wrong guess silently changes data. This one converts a cell to a number only when it is written as a plain JSON number without a leading zero, so 02134 (a ZIP code) and 007 (an ID) stay strings, and so does 12345678901234567890, which a JavaScript number cannot hold exactly. true, false and null become their JSON values, and an empty cell becomes null. Turn off type detection and every value stays a string.
The delimiter is detected from the first rows by finding the character — comma, semicolon, tab or pipe — that splits them into the same number of columns, while ignoring separators inside quoted fields. Quoted fields may contain the delimiter, doubled quotes ("") and line breaks, as RFC 4180 allows. An opening quote that never closes swallows the rest of the file, so the error points at the line and column where it opened rather than at the end.
Headers written in dot notation — customer.name, customer.city — are rebuilt into nested objects, which is how the JSON to CSV converter writes them, so a round trip returns the original shape. Headers with [0] indexes rebuild arrays the same way. Once the records look right, infer a JSON Schema from them to document the import.
Semicolon-separated CSV
sku;price;zip;in_stock A-1;9.90;01234;true B-2;12;;false
JSON (types detected)
[
{ "sku": "A-1", "price": 9.9, "zip": "01234", "in_stock": true },
{ "sku": "B-2", "price": 12, "zip": null, "in_stock": false }
]The semicolon is detected, 01234 keeps its leading zero as a string, and the empty zip cell becomes null.
Where people get caught
An unclosed quote
One stray " makes the parser read every following line as part of that field. The error names the line and column where the quote opened — look there, not at the end of the file.
Excel exports with a byte-order mark
Files saved as "CSV UTF-8" start with an invisible U+FEFF that some converters glue onto the first header name. It is stripped here; strip it in your own import code too.
Rows with a different number of fields
A missing or extra delimiter shifts every value after it. Rows that do not match the header length are listed as warnings so you can fix them before importing.
Dates stay strings
JSON has no date type, so 2024-01-15 is kept as a string. Parse it in the consuming code, where the time zone is known.
About CSV to JSON conversion
How it works in 4 steps · 4 common use cases · 4 questions answered
About CSV to JSON conversion
How it works in 4 steps · 4 common use cases · 4 questions answered
How it works
- 1.Paste CSV or TSV, or drop the file — the delimiter is detected.
- 2.Choose objects or arrays, and whether values are typed and headers nested.
- 3.Warnings list rows with the wrong field count and duplicate headers.
- 4.Copy the JSON or download it as a .json file.
Common use cases
- •Turning a spreadsheet export into API fixtures
- •Seeding a database or a mock server from a CSV
- •Checking a CSV import file before it hits production
- •Converting a TSV copied from a SQL client
FAQ
How does it detect the delimiter?
It tries comma, semicolon, tab and pipe on the first rows and picks the one that gives the same number of columns on every row, ignoring separators inside quotes. You can also choose it yourself.
Why is my ZIP code or ID still a string?
Numbers with a leading zero, and integers too large for a JavaScript number, are kept as strings so no digits are lost. Turn off type detection to keep every value a string.
Can it create nested JSON?
Yes. Headers such as address.city or tags[0] are rebuilt into nested objects and arrays. Turn off Nest dotted headers to keep the header names as flat keys.
What if my CSV has no header row?
Untick First row is a header and each row becomes an array of values instead of an object.