DevTools Logo

CSV Type Inference

CSV Type Inference

Infer column types, null ratios and uniqueness from CSV rows, locally and with the rules stated.

Runs in your browser
Only empty cells are null. Leading zeros stay text. Integers use the int64 range. Dates are ISO 8601.
Try an example

CSV input

Column profiles

Enter a header row and at least one data row to see profiles.

Nothing leaves your browser.

About

CSV Type Inference profiles each column of a CSV file: the dominant type, share of empty cells, unique values, numeric min/max/mean and the most frequent values. Its rules are conservative: only empty cells count as null, leading-zero digit strings stay strings (so zip codes keep their zero), integers outside the signed 64-bit range stay strings, and impossible dates never roll over to the next month. A sample-size control keeps very large files responsive, and the profile can be copied as JSON.

More examples

Mixed table

id,name,score,active
1,Ada,98.5,true
2,Linus,,false

The profile reports integer, string, float and boolean columns, with one null in the score column.

Zip codes

zip
01234
02134
10001

Leading zeros keep the column a string instead of silently turning zip codes into integers.

Bad date

created
2024-02-30
2024-03-10T14:30:00Z

The impossible date is a string while the valid ISO date-time is classified as a date.

    Examples

    Scores table

    Input
    id,name,score,active
    1,Ada,98.5,true
    2,Linus,,false
    Output
    id: integer · name: string · score: float (1 null) · active: boolean

    Each column's dominant type is shown with its null ratio and most frequent values.

    Zip codes

    Input
    zip
    01234
    02134
    10001
    Output
    zip: string (leading zeros preserved)

    Treating zip codes as integers would lose their leading zeros, so they stay text.

    About this tool

    CSV Type Inference examines each column of a CSV file and reports the type it most likely contains, the share of empty cells, unique-value counts, numeric ranges and frequent values. It is a profiling tool, not a schema generator with hidden guesses: the rules it applies are visible in the interface and the result can be copied as JSON.

    The classifier is deliberately conservative. Only empty cells are null; text such as NA or NULL stays a string and is counted separately. Leading-zero digit strings remain strings so zip codes survive, integers outside the signed 64-bit range remain strings, and impossible calendar dates are never rolled over.

    What this tool does not do

    • Inference is statistical: a column with all-empty cells has no evidence for a type.
    • Only ISO-style dates are recognised; locale-specific formats remain strings.
    • Sampling means rare values can be missed; increase the sample size for a more complete profile.
    • The JSON profile is descriptive metadata, not a validation schema for your dataset.

    How to use this tool

    1. Paste CSV

      Paste a table, upload a CSV/TSV file, or load one of the example chips.

    2. Set parsing

      Choose auto-detect or an explicit delimiter, and cap the number of sampled rows.

    3. Read the profile

      Compare the inferred type, null percentage, uniqueness and numeric statistics across columns.

    4. Copy the JSON

      Copy the full profile or download csv-profile.json for further analysis.

    Use cases

    Data ingestion

    Check an export before defining the types of an import job or database table.

    Data quality audit

    Find blank-heavy columns, unexpected null-like text and accidental mixed types.

    Documentation

    Produce a compact JSON profile to attach to a dataset README.

    Inference rules

    ValueType
    42 / -7integer
    3.14 / 1e-3float
    true / false / yes / noboolean
    2024-02-29date
    ada@example.comemail
    01234string
    NA / NULLstring

    A column with several types is reported as mixed with a low confidence.

    Common mistakes

    Mistake:Assuming NA counts as a null.

    Fix:Only empty or whitespace-only cells are null; null-like text is reported separately so you can clean it deliberately.

    Mistake:Trusting a mixed column's dominant type blindly.

    Fix:Check the type distribution and confidence: a column with several types should be split or cleaned before import.

    Mistake:Profiling millions of rows at once.

    Fix:Set a sample size; the tool reports how many rows were analysed and how many exist in total.

    Frequently asked questions

    How does it decide a column's type?

    Every non-empty cell is classified, then the dominant type and its share are reported. A column is confident when at least 90% of typed cells agree; mixed columns are called out rather than being forced into one type.

    Why are zip codes treated as strings?

    A digit string with a leading zero is kept as text because converting it to a number would lose the zero. Integers wider than the signed 64-bit range are also kept as text.

    Does NA count as a null value?

    No. Only empty or whitespace-only cells are null. Text such as NA, NULL, N/A or NaN is classified as a string and counted separately so you can decide how to clean it.

    What does sampling change?

    The sample rows setting limits how many data rows are analysed, which keeps large files responsive. The result always shows how many rows were analysed and the total number of rows found.

    Is my CSV uploaded?

    No. Parsing, classification and the JSON profile are produced entirely in the browser; nothing is sent to a server.

    References & standards