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.

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.

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}">

On mobile, type selects the keyboard: email adds @, url adds /, tel shows a phone pad, and number/numeric show digits. Unsupported types degrade gracefully to text, so always supply sensible attributes and a fallback.

Tips and notes

  • Use the most specific type available — it is the cheapest accessibility and UX win.
  • Pair type="text" with inputmode when you need a keyboard hint without strict validation (e.g. card numbers that need spaces).
  • type="password" masks input but offers no validation — add pattern/minlength.
  • type="search" adds a clear button on most browsers; type="hidden" is never rendered and submits a fixed value.
  • For date/time types the submitted value uses a fixed ISO format regardless of the locale shown to the user.