HTML Input Types Reference

Every HTML input type value with accepted attributes and mobile keyboard hints.

Searchable reference for all HTML input type values — text, email, number, date, range and more — with the validation attributes each accepts and the mobile keyboard each triggers. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Why use specific input types instead of type=text?

Specific types give free native validation, semantic meaning for assistive tech, and the correct on-screen keyboard on mobile. type=email shows an @ key, type=tel a numeric pad, and the browser validates the format before submit without any JavaScript.

Pick the right input type

The type attribute on <input> controls the control rendered, the validation applied, and — crucially on mobile — which on-screen keyboard appears. This reference lists every standard input type with the attributes it accepts and the keyboard it triggers, so you can choose the most specific type for each field.

Why type matters beyond just validation

Choosing type="email" over type="text" is not just about the @ on the mobile keyboard. It tells assistive technology what kind of value is expected, makes browser autofill more accurate (browsers look at type to decide whether to offer saved emails, addresses, or credit cards), and provides native validation that fires before any JavaScript runs. Every specific type you skip is a UX, accessibility, and autofill opportunity lost.

The input types at a glance

TypeKeyboard (mobile)Key validation / behaviour
textStandardNone — use pattern/minlength to constrain
emailAdds @ and .Validates basic email format
urlAdds / and .comMust start with a valid scheme
telNumeric padNo format validation — use pattern
numberNumeric with decimalsmin, max, step; spinner control
rangeN/AReturns a number within minmax; renders a slider
dateDate pickerValue always ISO YYYY-MM-DD
datetime-localDate + time pickerValue is YYYY-MM-DDTHH:MM
monthMonth pickerValue is YYYY-MM
weekWeek pickerValue is YYYY-WNN
timeTime pickerValue is HH:MM or HH:MM:SS
colorColour pickerValue is a hex string like #rrggbb
checkboxN/Achecked property, not value, carries state
radioN/AGrouped by name; only one selected per group
fileN/Aaccept, multiple; no text value submitted
passwordHides inputNo format validation by default
searchAdds search action keyBrowser adds a clear button
hiddenNever rendersSubmits a fixed value without user interaction
submit / reset / buttonN/AForm control buttons

type vs inputmode — the key distinction

type controls both validation and the keyboard hint. inputmode controls only the keyboard hint, with no validation effect. Use inputmode when you need a specific keyboard but not the type’s built-in validation:

<!-- Card number: digits-only keyboard, but spaces allowed, no number spinner -->
<input type="text" inputmode="numeric" pattern="[0-9 ]{13,19}" autocomplete="cc-number">

<!-- PIN: digits-only keyboard, password masking, no number spinner -->
<input type="password" inputmode="numeric" minlength="4" maxlength="8">

How it works

Each type maps to a value space and a default control. The browser validates the value against the type before form submission and exposes the result through the Constraint Validation API:

<input type="email" required>
<input type="number" min="0" max="100" step="5">
<input type="tel" inputmode="numeric" pattern="[0-9]{10}">

Unsupported types degrade gracefully to text, so always supply sensible fallback attributes and a server-side validation equivalent.

Key gotchas

  • type="number" strips leading zeros and rejects non-numeric characters before submit — do not use it for phone numbers, postcodes, or credit card numbers.
  • For date and time types, the value submitted to the server is always ISO format (YYYY-MM-DD) regardless of how the picker displays it to the user.
  • type="range" always has a value; it cannot be “empty” the way text can. Its default value is the midpoint of minmax.
  • type="checkbox" does not submit anything when unchecked — to detect unchecked state server-side, add a <input type="hidden" name="agree" value="0"> before the checkbox.
  • type="password" masks input but provides no encryption and no format validation — add pattern and minlength to enforce strength rules.