autocorrect

Controls automatic text correction on mobile devices. Disable it for usernames, product codes, and technical content where correction would alter intended input.

Overview

The autocorrect attribute controls whether the browser or operating system automatically corrects text as the user types. When enabled, the system silently replaces what it believes are typos with dictionary words — helpful for prose, but destructive for technical content, codes, or identifiers.

Applies to: <input> (text types), <textarea>, and any element with contenteditable

Values

ValueBehavior
onAutomatic text correction is enabled (the default)
offAutomatic text correction is disabled

When to Disable Autocorrect

Autocorrect is designed for natural language. It actively harms input accuracy when the field expects non-dictionary content:

  • Usernames and handles: xKoder99 gets corrected to Coder
  • Product codes and SKUs: WX-4829 gets broken by insertion of spaces or corrections
  • Technical terms: Programming keywords, CSS selectors, shell commands
  • URLs and paths: File paths and API endpoints contain non-word segments
  • Abbreviations: Domain-specific abbreviations are not in the system dictionary
  • Invite codes and tokens: Random alphanumeric strings that must be entered exactly

Complete Text Input Control

For full control over mobile text input behavior, combine autocorrect with autocapitalize and spellcheck. Each controls a different aspect of the text assistance pipeline:

AttributeControlsVisual Indicator
autocorrectSilent replacement of "typos" with dictionary wordsNone (corrections happen automatically)
autocapitalizeAutomatic uppercase on the first letter of sentences, words, or all charactersKeyboard Shift state
spellcheckRed underlines on words not in the dictionaryWavy underlines

Accessibility

  • Autocorrect helps with typos. For prose fields, leaving autocorrect enabled helps users — including those with motor impairments or dyslexia — produce accurate text with less effort.
  • Unwanted corrections create frustration. When autocorrect changes a deliberately entered value, the user must notice the change and undo it. This is especially burdensome for users who cannot easily see the correction happening.
  • No impact on screen readers. The attribute does not change how assistive technology announces the field.

Limitations

  • Browser support is limited: Safari (iOS and macOS) is the primary browser that implements autocorrect. Chrome and Firefox on Android rely on OS-level autocorrect settings and largely ignore this attribute.
  • OS-level correction may override: Even with autocorrect="off", some mobile operating systems apply their own correction at the input method level, which the browser cannot control.
  • No granular control: You cannot selectively correct some words while leaving others alone. It is all or nothing per field.
  • Not in the HTML spec (historically): The autocorrect attribute was a non-standard Safari extension for years. It has since been proposed for standardization, but browser support remains uneven.
  • No desktop effect: Desktop browsers do not perform autocorrection, so the attribute has no visible impact on desktop.

See Also

  • autocapitalize — control automatic capitalization on mobile keyboards
  • spellcheck — enable or disable browser spell-checking
  • inputmode — control which virtual keyboard layout appears
  • autocomplete — browser autofill hints