Most CW is decoded by the operator. At first you write each letter down as you hear it. With practice you stop writing and keep the letters in your head, then hear whole words and short phrases at once, which is called head copy. Experienced operators often copy a letter or two behind what they are hearing, which gives the brain time to recognise a word as a whole. Skill is built on the habits in Learning Morse code.
A trained ear is surprisingly good: it can pick a steady tone from noise, follow a fading signal, and read an operator's own rhythm. That is why a narrow filter and a good ear can often beat a decoder on weak signals.
What a decoder does
Decoding software, built into some radios and available as an app or part of Digital mode software, listens to audio and works in four steps.
A decoder is only as good as its on/off decision. Noise and fading fool step 2; uneven hand sending fools step 4.
Filter the audio around a single pitch, so other tones and noise are ignored.
Decide on or off: is the tone's level above a threshold?
Measure how long each tone and each silence lasts.
Classify them. Dit and dah are told apart by length, since a dah is three dits; gaps are told apart the same way. The program looks the pattern up and prints the letter. It continually adjusts to the sender's speed.
Decoders get their audio from the radio through a computer interface, or from the computer's microphone.
Where decoders work, and where they don't
They do best with clean, steady, machine-sent code at a moderate speed. They struggle with:
Noise and fading, which flip the on/off decision and add or delete elements.
Hand-sent code, whose dits, dahs and gaps are uneven, so the 1:3 ratio rule gives wrong guesses.
Overlapping signals and QRM. A person can pick one signal from several; a decoder usually can't.
Errors are most noticeable on weak signals, where you need decoding most. The Reverse Beacon Network relies on automatic decoding, which is why its spots can contain mistakes; see CW contesting and the Reverse Beacon Network.