Limited supportUse with care and provide a fallback when broad support matters.

Overview

The autocapitalize global HTML attribute sets the virtual keyboard capitalization behavior for user input on an element, such as the first letter of sentences or all words. It is most useful when native HTML semantics or browser capabilities can replace custom implementation work.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
43
79
111
43
5
DOM API

The autocapitalize property of the HTMLElement interface represents the element's capitalization behavior for user input. It is available on all HTML elements, though it doesn't affect all of them, including:

66
79
111
66
10.3
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (66)
Implementation note
  • Supported on `HTMLInputElement` and `HTMLTextAreaElement` only.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (66)
Implementation note
  • Supported on `HTMLInputElement` and `HTMLTextAreaElement` only.
Notes 3 item(s)
Limitation
  • This browser only partially implements this feature
Removed
  • This feature was removed in a later browser version (10.3)
Implementation note
  • Supported on `HTMLFormElement`, `HTMLInputElement`, and `HTMLTextAreaElement` only.

Syntax

HTML
<input type="text" autocapitalize="words" placeholder="名前">
<input type="text" autocapitalize="none" placeholder="ユーザーID">
<textarea autocapitalize="sentences"></textarea>

Live demo

Contact form input

Use different autocapitalize modes for names, messages, and reference codes.

PreviewFullscreen

Checkout fields

Choose modes that match given names, city names, and all-caps promo codes.

PreviewFullscreen

Prose versus codes

Turn autocapitalize off for handles or codes while keeping it on for natural language.

PreviewFullscreen

Use cases

  • Use autocapitalize

    Use autocapitalize when standard HTML needs a more specific platform feature, semantic signal, or browser capability.

  • Handle edge cases

    Apply autocapitalize to solve a focused requirement without redesigning the whole page architecture.

Cautions

  • Test autocapitalize in your target browsers and input environments before depending on it as a primary behavior.
  • Provide a fallback path or acceptable degradation strategy when support is still limited.

Accessibility

  • Make sure autocapitalize supports the intended task without making the page harder to perceive, understand, or operate.

Powered by web-features