Not all -er words are masculine. But when a noun is built from a verb to name the person doing the action, it is always der, no exceptions: take a verb, add -er, and you get a masculine noun. This kind of word, a noun built from a verb to name the doer, is called an agent noun.
The rule
In German, you form an agent noun by taking the verb stem and adding -er. The result names whoever performs the action. Every one of these nouns is masculine. The article is always der.
It works exactly like the English -er → a teacher teaches, a driver drives, a runner runs. German does the same thing, and assigns der every time.
Eight examples, all following the same pattern:
| Noun | Meaning | Verb |
|---|---|---|
| derLehrer | teacher | lehren, to teach |
| derFahrer | driver | fahren, to drive |
| derSprecher | speaker | sprechen, to speak |
| derLäufer | runner | laufen, to run |
| derBäcker | baker | backen, to bake |
| derArbeiter | worker | arbeiten, to work |
| derSchreiber | writer / scribe | schreiben, to write |
| derHörer | listener | hören, to listen |
Not every -er word is an agent noun
The rule is specific. It applies when -er is added to a verb to create the doer. It does not cover every word that happens to end in those two letters.
das Wasser (water), das Zimmer (room), das Messer (knife): all neuter → all das. The -er in these words is part of the root, not a suffix added to a verb. Feminine family terms follow their own pattern → die Mutter (mother), die Schwester (sister), die Tochter (daughter).
The question to ask is simple: was this word built from a verb? Is it naming the person who performs an action? If yes, it's der.
How to spot one in the wild
If you can form the sentence "Who [verb]s?" and the noun answers it, you have an agent noun. Who fährt? → der Fahrer. Who lehrt? → der Lehrer. Who arbeitet? → der Arbeiter. The logic is transparent once you see it, and it never changes.
This pattern is also productive: German keeps making new agent nouns this way → der Streamer, der Blogger, der Nutzer (user, from nutzen). Every new verb-derived -er noun is masculine.
Verb + -er → der, every time. The question isn't whether a word ends in -er, it's whether it names the person doing something. If it does, the article is settled.