The HTML autocorrect attribute
The HTML autocorrect attribute controls whether the browser automatically corrects spelling and punctuation as the user types in editable fields. Values are on and off. It is a global attribute (originating in Safari and now standardized), so disable it for codes and identifiers.
Overview
The autocorrect attribute turns the browser's automatic text correction on or off for editable fields and contenteditable elements. It is distinct from spellcheck, which only flags possible mistakes rather than rewriting the text.
Disable it (autocorrect="off") for usernames, email addresses, URLs, codes and other content the browser should never silently change.
Values
| Value |
|---|
| on | off |
Example
<input type="text" autocorrect="off" spellcheck="false" placeholder="username (no autocorrect)" style="padding:8px; width:100%;">
Best practices
- Write
offto disable autocorrect;false,noand an empty value are all read as on. - Skip the attribute on email, url and password inputs, where autocorrection stays off even with
autocorrect="on". Use it on text, search and tel fields that hold codes or IDs. - Autocorrection can change punctuation as well as words, and on macOS a browser might apply the user's registered text replacements. In a markup or snippet editor, set
autocorrect="off". - For an input or textarea,
element.autocorrectreturns a boolean that already folds in the form's setting and the input type. Assigningtrueorfalsewrites on or off. - Safari 14.1 and Firefox 136 support it, but Chrome and Edge didn't add it until version 153. Test for
"autocorrect" in HTMLElement.prototypebefore you read the property.
Frequently asked questions
What does the autocorrect attribute do?
Is autocorrect guaranteed to work?
What is the difference between autocorrect and spellcheck?
autocorrect lets the browser rewrite text as the user types; spellcheck only flags possible mistakes and leaves the text alone.






















