autocapitalize

The HTML autocapitalize attribute controls whether a mobile keyboard automatically capitalizes the first letter of sentences, words, or characters.

What you will learn

What does autocapitalize do?

autocapitalize is an input hint for virtual keyboards. It does not change the value by itself after submission; it asks the user agent to make typing more convenient.

<label>
  Display name
  <input type="text" name="display_name" autocapitalize="words">
</label>

Values

none
Do not automatically capitalize text. A good choice for email addresses, usernames, and code-like values.
sentences
Capitalize the first letter of each sentence. This is often useful for prose.
words
Capitalize the first letter of each word, such as a person’s name or title.
characters
Suggest uppercase input for every character, such as a code that is conventionally uppercase.

Choose based on the data, not the screen

Use the value that matches what the user is entering. For an email field, combine an appropriate type="email" with autocapitalize="none". For a normal message, sentences may reduce extra taps.

<input type="email" name="email" autocapitalize="none" autocomplete="email">
<textarea name="message" autocapitalize="sentences"></textarea>

Common mistakes

Related pages