HTML autocorrect Global Attribute
The autocorrect attribute sets whether the browser or device may automatically correct spelling mistakes as the user types: on or off.
Description
The autocorrect attribute is a global HTML attribute used to control whether the browser or device should automatically correct text input in certain elements, typically <input> or <textarea>. It is primarily intended for touch-based devices, like smartphones and tablets, where software keyboards often offer automatic spelling correction. It was first introduced by Safari and is now part of the HTML standard; it is supported in Safari, Firefox 136 and Chrome 153. Like autocapitalize, it has no effect on password, email and URL fields, where autocorrection is always off.
Purpose
The attribute allows web developers to enable or disable automatic text corrections, giving users the freedom to either rely on the device’s spelling suggestions or type freely without interference. This can be useful for fields like usernames, passwords, code snippets, or specialized terminology where autocorrection could be disruptive.
Usage
The autocorrect attribute can be added to any HTML element that accepts user input, including:
<input type="text"><input type="search"><textarea>
Example
<form>
<!-- Autocorrect enabled (default behavior on some devices) -->
<label for="note">Notes:</label>
<textarea id="note" name="note" autocorrect="on"></textarea>
<!-- Autocorrect disabled -->
<label for="username">Username:</label>
<input type="text" id="username" name="username" autocorrect="off">
</form>
In this example:
- The
textareafornoteallows the device to suggest and automatically correct spelling errors. - The
inputforusernamedisables autocorrection, which is important for usernames that may contain unusual characters or capitalization.
Notes
- The attribute is case-insensitive, meaning
"on"and"ON"behave the same. - It is often used alongside other text input attributes like
spellcheck="true"orautocompleteto create a more controlled input experience. - Not all devices respect the
autocorrectsetting, so behavior may vary slightly between browsers and platforms.
Syntax
<element autocorrect="value">
Values
- onThe browser or device may automatically correct spelling mistakes. An empty string has the same meaning, and it is the default.
- offDisables autocorrection, allowing the user to type exactly what they input without automatic modifications.
Example
Browser Support
The following information will show you the current browser support for the HTML autocorrect global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.
Desktop





Tablets & Mobile





