# \[autocorrect\]

> The `autocorrect` HTML global attribute controls whether automatic spelling correction is applied to editable text.

## What does the autocorrect attribute do in HTML?

The attribute that enables or disables automatic text correction in editable elements such as `<input>`, `<textarea>` or elements with `contenteditable`. Takes 'on' or 'off' values and is useful for fields like usernames, codes or emails where correction is unwanted.

- Topic: Global Attributes
- Type: attribute
- Browser support: Chrome 153+, Chrome Android 153+, Edge 153+, Firefox 136+, Firefox Android 136+, Safari 14.1+, Safari iOS 14.5+

## Example

Wrong:

```html
<label for="user">Username</label>
<input id="user" name="username">
```

Right:

```html
<label for="user">Username</label>
<input id="user" name="username" autocorrect="off" autocapitalize="none" spellcheck="false">
```

The keyboard no longer changes the username the user typed.

## Common mistakes

- Leaving autocorrect on for a username field, so the phone changes what the user typed.

## Key points

- Fields for usernames, emails, codes and names have `autocorrect='off'`.
- Values are 'on' or 'off', not 'true' or 'false'.
- Fields that turn off autocorrect usually also set `autocapitalize='none'` and `spellcheck='false'`.

## Interview questions

### What is the difference between autocorrect and spellcheck?

Spell check only underlines words. Autocorrect replaces words as the user types.

### Does autocorrect work on password fields?

Browsers do not autocorrect password fields, so the attribute is not needed there.

## Related cards

- [\[autocapitalize\]](https://wonderium.dev/html/autocapitalize.md)
- [\[spellcheck\]](https://wonderium.dev/html/spellcheck.md)
- [\[enterkeyhint\]](https://wonderium.dev/html/enterkeyhint.md)
- [`<input>`](https://wonderium.dev/html/input.md)

---

- Level: [HTML](https://wonderium.dev/html.md)
- HTML version: https://wonderium.dev/html/autocorrect
- Last updated: 2026-11-25
