This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.
How does autocorrect work?
Quick answer
Autocorrect compares each typed word against a dictionary and a statistical model of language, then replaces or suggests the most likely intended word. It uses the keys you pressed, common typos, and surrounding context to guess your meaning, and it adapts over time to your personal vocabulary.
Autocorrect works by comparing what you type against a dictionary and a model of likely words, then fixing or suggesting corrections. It uses the keys you hit, common typos, and the surrounding words to guess what you most likely meant.
Step by step
- As you type, the system captures the exact sequence of keys you pressed, including any near-miss touches on the keyboard.
- It checks whether that string appears in its dictionary of known words, including common names and slang.
- If the word is missing, it generates candidate corrections by swapping, inserting, deleting, or replacing letters, and by considering keys adjacent to the ones you hit.
- A language model scores each candidate based on how often it appears in general text and how well it fits the words around it.
- The highest-scoring candidate is automatically substituted, or offered as a suggestion if the system is less confident.
- The system records your accepted or rejected corrections, gradually adjusting its personal dictionary and predictions.
Key things to understand
- It checks your typed word against a built-in dictionary of known words.
- If it's not found, it finds the closest valid words by spelling and by nearby keys.
- It weighs which correction is most likely given the surrounding words.
- Modern versions learn from your habits and use language models for context.
- The same technology powers predictive text, suggesting the next word before you type it.
Labelled diagram
- Typed input
The raw sequence of keys you pressed, including errors and near-misses.
- Dictionary lookup
Checks if the string matches a known word, name, or common abbreviation.
- Candidate generation
Creates possible corrections by editing letters and considering nearby keys.
- Context scoring
A language model ranks candidates by how well they fit the surrounding words.
- Output
The top candidate is applied automatically or shown as a suggestion.
Real-world examples
- On an iPhone, typing 'teh' quickly becomes 'the' because the transposition is a common typo and 'the' is highly frequent.
- In Google Docs, typing 'definately' underlines it in red and suggests 'definitely' after comparing against its dictionary and context.
- On many phone keyboards, typing ‘im’ becomes ‘I’m’, because the apostrophe version is far more common in real messages.
- Microsoft Word's autocorrect changes '(c)' to '©' by default, a symbol substitution that relies on a fixed pattern rather than context.
Common mistake
✗ Myth: Autocorrect always knows the correct spelling and will never change a word that is already correct.
✓ Fact: Autocorrect can alter valid words when its language model judges another word more likely in context, especially for names, technical terms, or slang. It is a probabilistic guess, not a perfect proofreader.
People also ask
Why does autocorrect change correct words?
How does autocorrect learn new words?
What is the difference between autocorrect and spell check?
Why does autocorrect make mistakes?
How does autocorrect know what I meant?
Can I make autocorrect smarter?
Part of the guide: How AI Works →

