HTML autocapitalize Attribute

Beginner
6 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The autocapitalize global attribute is an enumerated attribute that controls whether inputted text is automatically capitalized — and in what manner. It mainly affects <input>, <textarea>, and any element with contenteditable.

It does not change typing on a physical keyboard. Virtual keyboards (phones, tablets) and voice input use it as a capitalization hint so users type names, sentences, and codes with less shifting.

Limited availability · Not Baseline.

Not deprecated and not experimental. Supported well on modern mobile browsers; missing or weak on some desktop browsers (notably Safari). Prefer progressive enhancement.

Hint only — not validation.

Users can still type any case. Never rely on autocapitalize to enforce uppercase or title case in stored data.

HTML Syntax

syntax.html
<element autocapitalize=" keyword">

You can also set it on a <form>; that value applies to contained text fields and overrides per-field values.

Attribute Values

Enumerated keywords (aliases shown where the HTML living standard allows them):

ValueDescriptionTry it
none / offDo not automatically capitalize any textTry it
sentences / onCapitalize the first character of each sentenceTry it
wordsCapitalize the first character of each wordTry it
charactersCapitalize every characterTry it
On a <form>Sets the mode for contained inputs/textareas (overrides children)Try it

If omitted, defaults vary: Chrome and Safari often behave like sentences; Firefox often like none.

Live Preview

Change the value, then type in the field. On a desktop physical keyboard you may see little change — test on a phone for the real effect.

A real text input. Apply a value, then type — best verified on a virtual keyboard.

Text input

autocapitalize="sentences"

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Name, Bio, and Access Code

Match each field to the text you expect: words, sentences, or characters.

HTML
<label for="name">Name:</label>
<input type="text" id="name" name="name" autocapitalize="words">

<label for="bio">Bio:</label>
<textarea id="bio" name="bio" autocapitalize="sentences"></textarea>

<label for="code">Access code:</label>
<input type="text" id="code" name="code" autocapitalize="characters">
Try It Yourself

How It Works

  1. words on the name field capitalizes each name part as the user types.
  2. sentences on the bio starts each sentence with a capital letter.
  3. characters on the code field pushes every letter toward uppercase.
  4. Labels stay connected with matching for / id for accessibility.

Example 2 — Turn Caps Off with none

Use none (or off) when auto caps would hurt — usernames, handles, and similar text fields.

HTML
<label for="username">Username:</label>
<input
  type="text"
  id="username"
  name="username"
  autocapitalize="none"
  autocomplete="username">
Try It Yourself

How It Works

  1. Set none so the virtual keyboard does not auto-capitalize.
  2. Prefer type="text" when you need the attribute to matter — email, url, and password never autocapitalize anyway.
  3. off is an alias of none; either keyword is fine.
  4. Still a hint. Users can enable Shift manually.

Example 3 — Set autocapitalize on the Form

One value on <form> can drive every text field inside — and it overrides child values.

HTML
<form autocapitalize="words" action="#" method="get">
  <label for="first">First name:</label>
  <input type="text" id="first" name="first">

  <label for="last">Last name:</label>
  <input type="text" id="last" name="last">

  <button type="submit">Save</button>
</form>
Try It Yourself

How It Works

  1. Put autocapitalize on the form when every text field should share one mode.
  2. Children inherit that mode for capitalization behavior.
  3. Form value wins. Per MDN, a form setting overrides autocapitalize on contained inputs and textareas.
  4. Need a mixed form? Prefer setting values on each field instead of on the form.

Edge Cases & Pitfalls

Most surprises come from testing only on desktop or putting it on the wrong input type.

keyboard

Physical keyboards ignore it

Desktop typing usually looks unchanged. Verify on iOS/Android (or voice input) when you care about the UX.

types

No effect on email, url, password

Those type values never enable autocapitalization. Use none on type="text" fields instead when you need the hint.

form

Form value overrides children

Setting autocapitalize on <form> overrides values on nested inputs and textareas — easy to miss when debugging.

defaults

Omitted attribute ≠ same everywhere

Chrome/Safari often default toward sentences; Firefox toward none. Set an explicit value when consistency matters.

data

Not a substitute for validation

If case matters in your database, normalize or validate on the server. This attribute only hints the keyboard.

Browser Support

autocapitalize is an HTML global attribute for browser text entry. It is not a Node.js, Deno, or Bun API.

✓ Limited availability · Not Baseline

autocapitalize

Strong on modern mobile browsers and Chromium/Firefox. Desktop Safari support is weak or absent; IE has no support. Effects matter most with virtual keyboards.

94% Global support (approx.)
Google Chrome 43+
Full support
Mozilla Firefox 111+
Full support
Apple Safari iOS 10.3+ · Desktop limited
Partial
Microsoft Edge 79+
Full support
Opera 30+
Full support
Samsung Internet 4+
Full support
Internet Explorer No support
Not supported
autocapitalize Limited · mobile-strong

Bottom line: Safe as progressive enhancement for mobile forms. Do not depend on it for desktop Safari or for enforcing case in stored data.

Key Takeaways

  • Role: hint virtual keyboards with none, sentences, words, or characters.
  • Scope: input, textarea, contenteditable, and optionally form.
  • Mobile-first: physical keyboards generally ignore it.
  • Limits: ignored on email / url / password; not Baseline everywhere.

One line: autocapitalize eases mobile typing — it does not change physical keyboards or validate case.

Frequently Asked Questions

It is an enumerated global attribute that hints whether virtual keyboards or voice input should capitalize text automatically, and how: none, sentences, words, or characters.
It applies to input and textarea, any contenteditable element, and can also be set on a form to control contained fields.
No. MDN notes it does not change typing on a physical keyboard. Effects show mainly on mobile virtual keyboards and similar input methods.
For those input types, autocapitalization is never enabled. The attribute is ignored there.
none and off mean the same (no auto caps). sentences and on both capitalize the first letter of each sentence.
No. MDN marks it Limited availability — not Baseline — because support is missing or weak in some widely used browsers (notably desktop Safari). Mobile browsers support it well.

Next: autocomplete

Help browsers autofill forms with the right field hints.

autocomplete tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful