CSV has no concept of data types — every cell is just text, whether it looks like a number, a date, or a boolean. Converting to JSON well means making a judgment call on each column: is "042" the number 42, or a zip code that would break if you stripped the leading zero? Is "true" a boolean, or a literal string a form field happened to contain? A naive converter treats everything as a string and hands you a JSON file that's technically correct but useless for anything downstream that expects real types. For the broader question of when CSV, JSON, or XML is the right format to begin with, see CSV vs JSON vs XML.
How type inference actually works here
The parser looks at each column's values and applies conservative rules: a value converts to a number only if the entire column parses cleanly as numeric (no mixed text), and to a boolean only for exact true/false matches — everything else stays a string rather than risk silently mangling data like phone numbers or IDs that merely look numeric. This is a deliberate trade-off: a few numbers that should've converted but didn't is a minor inconvenience; a zip code silently losing its leading zero is a real data bug.
Delimiters and headers
Real-world CSV exports aren't always comma-delimited — European spreadsheet software commonly exports with semicolons (since commas are the decimal separator in many locales), and some database exports use tabs or pipes. The parser auto-detects the delimiter from the file's first few rows, though you can override it manually if detection guesses wrong on an unusual export. If your file has no header row, columns get generic keys (column1, column2, ...) — for JSON that's actually usable elsewhere, a real header row with descriptive names is worth adding before converting.
Common uses
- Turning a CRM export into a JSON payload for a REST or GraphQL API
- Converting tabular data into props for React, Vue, or Angular components
- Prepping spreadsheet data for import into a document database like MongoDB or Firebase
- Feeding flat CSV reports into charting libraries (D3.js, Chart.js) that expect JSON
FAQ
Does this preserve data types, or does everything become a string?
Numbers and booleans are detected per-column and cast to real JSON types where the entire column matches cleanly; anything ambiguous is kept as a string rather than risk corrupting data that only looks numeric (phone numbers, zip codes with leading zeros, ID strings).
What delimiters are supported?
Commas, semicolons, tabs, and pipes are auto-detected from the file itself; you can also set the delimiter manually if your export uses something unusual.
Can it handle large CSVs?
Yes — since processing is entirely local, the practical limit is your browser's available memory rather than a server-side timeout. Files with tens of thousands of rows convert without issue.
What happens with a CSV that has no header row?
Columns are named generically (column1, column2, ...). The output is still valid JSON, but a real header row produces far more usable keys — worth adding to the source file if you control it.