What is Bayesian spam filtering?
Still have a question, spotted an error, or have a better explanation or a source we should cite?
Imagine a spam filter that gets smarter every time you click "Report spam" or "Not spam." That's basically what Bayesian filtering is. It's a statistical technique that looks at the words in your email, compares them against what it already knows about spam versus legitimate mail, and makes a probability call on which side of the line your message falls.
The name comes from Bayes' theorem, an 18th-century idea about updating probability estimates as you gather new evidence. Applied to email, it works like this. First, the filter gets trained on a batch of known spam and known good mail. It builds a word-frequency table. A word like "FREE!!!" turns up overwhelmingly in spam. A word like "invoice" might appear in both but skew toward legitimate business email. Every word gets a spam probability score based on how often it shows up in each category.
When a new message arrives, the filter combines those individual word probabilities into one overall score. If the message says "Click here to claim your FREE prize NOW," nearly every word pulls the score toward spam. If it says "Here's the invoice we discussed on our call," the score tips the other way. Simple in concept, surprisingly effective in practice.
What made Bayesian filters genuinely clever was the personal adaptation angle. Your filter learned from your specific inbox, not just a shared training set. So if you were a pharmacist who legitimately received emails about medication, your filter wouldn't flag those the way a default filter might. It adjusted to your reality (which is a nice idea until someone realizes they can game it).
And that's exactly what happened. Spammers started stuffing messages with innocent-looking random words to dilute the spam signal. A message pitching fake watches would also contain a paragraph of random dictionary words to confuse the probability math. This technique, sometimes called Bayesian poisoning, pushed filters to evolve beyond word counts alone.
Today, machine learning spam filters handle most of the heavy lifting at major mailbox providers. But Bayesian logic is still baked into tools like SpamAssassin and shows up in hybrid filter stacks. It was also the gateway concept that led to the more sophisticated approaches we rely on now. Understanding how it works helps you understand why certain words and phrases in your emails can still nudge a deliverability score in the wrong direction.
If you're trying to diagnose why your email is hitting spam folders, the Subject Line Tester in our free tools can catch some of the obvious content triggers. Or if you're stuck and want a second opinion, our SOS hotline is free and we actually pick up.
Contributors
Who worked on this answer
Every name links to their profile. Every company links to their site. Real people, real accountability.