HTML autocorrect Attribute

The HTML autocorrect attribute controls whether a browser or input method is permitted to automatically correct spelling and punctuation errors while a user enters editable text. It can be used with text-entry form controls, forms, and editable content.

Syntax

The autocorrect attribute is an enumerated attribute that accepts the values on and off.

<input type="text" autocorrect="on">

<input type="text" autocorrect="off">

When autocorrection is enabled, the browser or input method may automatically correct spelling or punctuation while the user types. The exact corrections depend on the browser, operating system, input method, and user preferences.

Attribute Values

The autocorrect attribute has two defined keyword values.

Value Description
on Allows the browser or input method to automatically correct spelling or punctuation while the user types.
off Prevents the browser or input method from automatically correcting text while the user types.

The missing, empty, and invalid value defaults are the on state. Whether corrections actually occur when autocorrection is enabled still depends on the browser, device, input method, and user settings.

Elements That Use the autocorrect Attribute

The autocorrect attribute is a global attribute, but its autocorrection behavior is relevant to editable content. It can be used directly on text-entry controls and editing hosts, while a <form> can provide the default autocorrection state for associated controls that inherit it.

Element Description
<form> Provides the default autocorrection state for associated form controls that inherit autocorrection behavior.
<input> Controls autocorrection for supported text-entry input types.
<textarea> Controls autocorrection while the user enters multiline text.
Editing host Controls autocorrection for an editable region, such as an element made editable with contenteditable.

Using the autocorrect Attribute

Autocorrection can be useful for ordinary prose, but there are situations where automatic corrections may change information that should remain exactly as entered.

<label for="message">Message:</label>
<textarea id="message" name="message" autocorrect="on"></textarea>

<label for="username">Username:</label>
<input type="text" id="username" name="username" autocorrect="off">

In this example, autocorrection is permitted for the message because it contains ordinary written text. It is disabled for the username because changing the spelling of a username could produce an incorrect value.

The autocorrect attribute can also control autocorrection in an editable region.

<div contenteditable="true" autocorrect="off">
  Edit this text without automatic correction.
</div>

Form Inheritance

A <form> element can establish the default autocorrection state for associated form controls that inherit autocorrection behavior. A control can override that inherited state by specifying its own autocorrect value.

<form autocorrect="off">
  <label for="search">Search:</label>
  <input type="search" id="search" name="search">

  <label for="comments">Comments:</label>
  <textarea id="comments" name="comments" autocorrect="on"></textarea>
</form>

The search field inherits autocorrect="off" from the form. The textarea explicitly uses autocorrect="on", so its own value overrides the form's setting.

Input Types That Do Not Use Autocorrection

The autocorrect attribute does not enable autocorrection for <input> elements whose type is email, password, or url. These controls use the off state regardless of an inherited or specified autocorrect="on" value.

Input Type Autocorrection
type="email" Off
type="password" Off
type="url" Off
<input type="email" autocorrect="on">
<input type="password" autocorrect="on">
<input type="url" autocorrect="on">

Although autocorrect="on" appears in these examples, autocorrection is not enabled for these input types.

Common Mistakes

Do not assume that autocorrect="on" guarantees that text will be corrected. It permits autocorrection, but the browser, device, input method, or user's preferences determine whether corrections actually occur.

Do not use autocorrect="on" when the exact spelling entered by the user is important, such as usernames, product codes, reference numbers, or other values that should not be automatically changed.

Do not confuse autocorrect with spellcheck. The spellcheck attribute controls whether text may be checked for spelling and grammar errors, while autocorrect controls whether the browser or input method is permitted to automatically change the entered text.

Browser Support

Baseline: Newly available indicates that a feature is supported in the latest stable version of each of the core browsers. Most users can use these features reliably, but they may not work in older browser versions.

The autocorrect global attribute became Baseline Newly available in September 2026. Support was introduced at different times across browsers, so older browser versions may not recognize or apply the attribute.

Checking Browser Support

For current browser compatibility information, visit Can I Use? . Search for the HTML element or attribute you want to check. You can also narrow your search by entering an element name and attribute name separated by a colon. Search results can include related HTML features, element attributes, input types, APIs, and other technologies, so select the result that most closely matches the feature you are checking.

Try the autocorrect Attribute

The example provides two text fields, one with autocorrection enabled and one with autocorrection disabled. Type misspelled words into each field to compare the behavior supported by your browser and device.

Play in Editor

Summary

The HTML autocorrect attribute controls whether automatic spelling and punctuation correction is permitted for editable text. The on value allows autocorrection and off disables it. Form controls can inherit the setting from their form, while a control's own autocorrect value overrides the inherited state. Autocorrection remains disabled for email, password, and URL input types.