The CSV Column Type Inferrer reads pasted CSV data and works out the most likely data type of each column — integer, float, boolean, ISO date, email, phone or free-text — with a confidence score. It is a quick way to understand an unknown dataset or bootstrap a database schema, all in your browser.
How it works
First the tool parses the CSV using an RFC-4180-style reader that correctly
handles quoted fields containing commas, escaped quotes ("") and embedded
newlines. It then samples up to 1000 data rows and classifies each non-empty
cell with an ordered set of tests:
- boolean — values like
true,false,yes,no,t,f - integer — optional sign followed by digits
- float — a decimal point with digits
- ISO date —
YYYY-MM-DDwith an optional time component that also parses as a real date - email — a local part,
@, and a dotted domain - phone — an optional
+and at least seven digits with common separators - free-text — anything else
A column is assigned a type only when at least 80% of its non-empty cells
match a single type; otherwise it is reported as free-text. If a numeric column
mixes whole numbers and decimals, it is reported as float so every value fits.
Example
A price column containing 19.99, 5 and 12.50 is reported as float
(because of the decimals), while an id column of 1, 2, 3 is reported as
integer. A signup_date column of 2026-01-15-style values is reported as
date.
Practical use: bootstrapping a database schema
The most common use case is arriving at an unknown data export and needing to
create a table to store it. Without type inference, the safe default is to make
every column TEXT and fix it later — but that loses sortability on dates and
numeric ranges on prices.
The inferred types map directly to common SQL types:
| Inferred type | PostgreSQL | MySQL | SQLite |
|---|---|---|---|
| integer | INTEGER | INT | INTEGER |
| float | NUMERIC | DECIMAL | REAL |
| boolean | BOOLEAN | TINYINT(1) | INTEGER |
| date | DATE | DATE | TEXT (ISO format) |
TEXT | VARCHAR(255) | TEXT | |
| phone | TEXT | VARCHAR(30) | TEXT |
| free-text | TEXT | TEXT | TEXT |
Phone and email columns are kept as TEXT even though they have recognisable
patterns, because the appropriate constraints and validation belong at the
application layer, not the column type.
Understanding the confidence score
Confidence is the share of non-empty cells in the sampled rows that match the
chosen type. A price column at 98% float confidence, for example, means that
98% of its cells parsed as floating-point numbers and 2% did not.
The remaining 2% are worth investigating:
- Intentional markers. Values like
N/A,TBD, or—in an otherwise numeric column are often missing-value markers. Consider whether to replace them withNULLbefore import. - Formatting noise. Currency symbols (
$5.99), percentage signs (12%), or thousands separators (1,234.56) prevent numeric parsing. Strip the formatting before importing. - Data entry errors. A typo like
19,99(comma instead of decimal point in a locale-mixed file) will fail numeric parsing and appear in the low-confidence tail.
A 100% score means the column is clean and consistent. Anything below ~95% warrants a closer look at the non-matching rows.
Notes
Confidence is the fraction of non-empty cells matching the chosen type, so it also hints at data quality — a high-but-not-100% score usually points to a few malformed rows worth investigating. All parsing runs locally, so the tool is safe for sensitive datasets.