scalpel@labs: ~/glossary/column-data-type-inference.mdx5 sections

Column Data Type Inference: Guessing What Each Column Holds

Column type inference guesses what a column holds, such as a number, date, currency, percentage, boolean, URL, email or plain text, by matching the shape of its values. It reads form, not meaning, so 03/04/2026 is 'a date' without deciding which day it is.

extension: Scalpel Tablesupdated: 2026-08-14read_time: 2 min
less column-data-type-inference.mdx

Why it matters

A spreadsheet tool needs to know: is this column numbers or text? If it is dates, how should it sort? Is this a URL or just text that looks like one? Guessing wrong changes how the spreadsheet handles the data. A misclassified phone number might lose its leading zero; a date might sort alphabetically instead of chronologically.

Scalpel Tables infers the type by reading the shape of the values. It lets you see what it guessed and gives you the chance to override before export.

How it works

For each column, Scalpel classifies every non-blank cell: is it a plain integer, a decimal, a date (in any common format), currency, email, URL, percentage, boolean, or plain text? It then votes. The type that owns the most non-blank cells wins, and Scalpel reports a confidence percentage.

The header row is excluded from the vote; Scalpel only looks at the data rows. So a column labelled "Age" with values like "25", "32", "29" scores as "number" with high confidence. A column of "2026-01-15", "2026-02-20", "2026-03-10" scores as "date". Mixed text like "–", "N/A", "Unknown" counts as text, lowering the number or date confidence.

What does not matter

Type inference is form-based only. "03/04/2026" is marked as "a date" with no claim about whether it means 3 April or 4 March. That ambiguity is yours to resolve when you open the export. Scalpel also does not rewrite any data; it is a label, not a transformation. A column classified as "URL" stays as text in the exported grid.

Leading-zero codes like "007" are guessed as text, not numbers, because stripping the zeros would corrupt them. Mixed columns (mostly numbers with one text value) score lower confidence but are still classified. None of this rewrites your data.

Code example

Here is a simple table and the inferred types for each column:

<table>
  <tr>
    <th>ID</th>
    <th>Product</th>
    <th>Price</th>
    <th>Launch</th>
  </tr>
  <tr>
    <td>007</td>
    <td>Widget A</td>
    <td>49.99</td>
    <td>2026-01-15</td>
  </tr>
  <tr>
    <td>008</td>
    <td>Gadget B</td>
    <td>129.50</td>
    <td>2026-02-20</td>
  </tr>
  <tr>
    <td>009</td>
    <td>Gizmo C</td>
    <td>99.00</td>
    <td>2026-03-10</td>
  </tr>
</table>

Scalpel infers:

  • ID: Text (95% confidence) because the leading zero on "007" flags it as a code, not a number.
  • Product: Text (100% confidence) all strings.
  • Price: Currency (100% confidence) all values match the money pattern.
  • Launch: Date (100% confidence) all values match the ISO date pattern.

The confidence tells you how sure the guess is. Near 100% is solid; 60% or lower deserves a second look.

How Scalpel shows it

Scalpel Tables displays a type chip below each column in the preview. Hover over the chip to see the confidence percentage and the inferred type. You can click a chip to override the type before exporting, though the override does not change the data itself, only how the spreadsheet tool treats it on import.

Sources