Most keys queried against a giant index are not in the set, so storing exact keys in memory just to answer “no” wastes nearly all your RAM. In July 1970, Burton H. Bloom showed in Communications of the ACM that tolerating a small, predictable rate of false positives shrinks a membership filter enough to keep it in fast primary memory instead of spilling onto slow disk.

Interestingly, Bloom never named the structure after himself. He called it Method 2 and derived it against two alternatives: conventional error-free hashing and Method 1 (open-addressed short hash codes). Five decades later, Method 2 guards SSTable reads in RocksDB and Cassandra, blocks compromised passwords, filters URL crawls, and shields origin caches from one-hit-wonder lookups.

  • Built for mostly-negative workloads: Bloom targets problems where most queries miss (such as a 500,000-word hyphenation workload where 450,000 words follow simple rules and 50,000 exceptions live on disk), scoring algorithms by average reject time T.
  • Nearly 7x smaller than exact core hashing: storing 50,000 19-bit exception keys in a conventional hash table at T = 4 took 2,000,000 bits, whereas Method 2 at error rate P = 1/16 took 291,200 bits and cut disk reads by 84.4%.
  • Optimal density sits at 50% ones (T'' = 2): across any target error rate P, Method 2 minimizes memory when expected 0-bits equal 1-bits (phi'' = 1/2), hitting S'' = log2(e) (roughly 1.44 bits per element per -log2 P, printed as 1.47 in Bloom’s 1970 paper).
  • Clear boundaries by design: Method 2 cannot match Method 1’s unboundedly small error rates without unbounded space, cannot delete keys without corrupting neighbors, and assumes constant single-bit access times.
Three hash-coding designs compared in Bloom (1970)
Conventional hashing
Error-free open addressing over h cells of b + 1 bits.
Exact keys, zero false positives
Rejects after expected T = (3/phi) - 2 bit checks; too large for core memory when n * b grows huge.
Method 1 (short codes)
Replace full b-bit keys with c-bit hash codes inside h cells.
Cell boundaries waste space at small T
Gives error P’ = (1/2)^(c-1) / phi’, bounded below by normalized space (T’ + 2) / (T’ - 1).
Method 2 (Bloom filter)
Eliminate cells completely: one flat N”-bit array, d bits per key.
Shared bits win on space and speed
Any 0 bit rejects immediately; rejects in T” = 1/phi” bit tests with error P” = (1 - phi”)^d.

Model and equations from Bloom (1970), pp. 423-425.

Why short-code hashing loses to a flat bit array

Bloom starts with conventional open-addressed hashing of n messages, each b bits long, into h cells of b + 1 bits (1 leading flag bit plus b message bits), where phi = (h - n) / h is the fraction of empty cells. When rejecting a nonmember, hitting an empty cell takes 1 bit check, while hitting an occupied mismatched cell checks E = sum_{x>=1} (x + 1)(1/2)^x = 3 bits on average before probing again, yielding normalized reject time T = (3 / phi) - 2 and space N = n * (b + 1) * (T + 2) / (T - 1).

Method 1 shrinks each cell from b + 1 bits down to c bits storing a non-unique hash code (1 >> P >> 2^(-b)). Because unrelated messages can collide on the same c-bit code before probing reaches an empty cell, the false-positive rate is P' = (1/2)^(c-1) / phi'. To compare architectures fairly across any set size n and allowable error P, Bloom defines the normalized space metric S = N / (-n * log2 P). For Method 1, Equations 23 and 25 show S' can never beat (T' + 2) / (T' - 1). Why? Even with short codes, Method 1 still walls off individual cells (leaving phi' fraction of cells empty) and pays probe penalties (E = 3 bits) on every collision.

Method 2 throws away cell boundaries entirely. The hash area is simply N'' individually addressable bits initialized to 0. Inserting a key hashes it to d distinct bit addresses and sets all d bits to 1; testing a key checks those same d bits and rejects the instant any bit is 0, returning zero false negatives.

After n insertions (d << N''), the expected fraction of remaining 0 bits is phi'' = (1 - d / N'')^n, giving false-positive rate P'' = (1 - phi'')^d. Because a nonmember stops at the first 0 bit (x bits tested with probability phi'' * (1 - phi'')^(x-1)), the expected reject time is simply T'' = 1 / phi''. Substituting into normalized space gives Equation 24: S'' = log2(e) / (log2(1/T'') * log2(1 - 1/T'')). Across every operating point in Figure 1 of the paper, Method 2’s space-time curve sits dramatically below Method 1, especially at fast reject times near T = 2.

The 50% fill rule and Bloom’s hyphenation testbed

Method 2 hides a sharp diminishing-returns trap. Adding more hash probes d initially lowers error P'' = (1 - phi'')^d, but setting more bits per key also fills the array with 1s, shrinking phi'' and raising the chance every probe hits an accidental 1.

Bloom proves in Figure 1 (page 426) that normalized space S'' reaches its exact minimum when 1 / T'' = 1 - 1 / T'', meaning T'' = 2 and phi'' = 0.5. At that 50% fill point, an average miss stops after checking just 2 bits, and the optimal space overhead collapses to S'' = log2(e) (roughly 1.44 bits per element per -log2 P, printed as 1.47 in Bloom’s 1970 text).

To make the payoff concrete, Bloom sizes an automatic hyphenation program handling 500,000 words: 450,000 words follow simple grammatical rules while 50,000 exceptions require a disk dictionary. Storing 50,000 19-bit keys in a conventional core hash table at T = 4 demands 2,000,000 bits, spilling onto disk. Using Method 2 at T = 2 with allowable error P = 1/16 (6.25%) shrinks the core filter to 291,200 bits (less than 300,000 bits). That filter misses 450,000 * 15/16 regular words immediately and triggers disk lookups only on 50,000 + 450,000/16 = 78,125 (~78,000 words, or 16%), saving 84.4% of disk accesses compared to keeping the conventional hash table on disk.

Three deployment bugs that break Bloom filters in production
Overfilling past 50% ones

Pushing n past design capacity shrinks phi” toward zero, spiking false positives and slow reject times simultaneously.

Deleting by clearing bits

Resetting a 1 bit to 0 when removing one key silently creates false negatives for every other key sharing that bit.

Omitting the exact check

Dropping a record on a positive filter hit without checking an exact store turns harmless I/O noise into silent data loss.

Failure boundaries derived from Bloom (1970), pp. 422-426.

Compare Bloom’s Table I error budgets

Tightening error rate P buys linear bit growth (72,800 bits per factor-of-2 reduction in P across Table I’s first five rows) while disk savings saturate quickly once true positives (50,000 exception words) dominate total reads. Step through the five regimes below to compare Table I’s hyphenation numbers alongside Method 1’s crossover point.

Space, false-positive rate, and disk savings across Bloom's Table I

Select an operating regime (or use Left and Right arrow keys) to inspect Table I's memory budget, wasted disk reads, and where Method 1 differs.

Smallest possible filter: 72,800 bits, 45.0% disk saved

Table I minimum

Setting P = 1/2 uses minimum memory yet still sends half of all 450,000 rule-handled words to the slow disk dictionary.

Why aggressive sizing stalls
450,000 / 2 = 225,000 false disk reads stack atop 50,000 true hits, forcing 275,000 slow lookups across 500,000 words.
Method 2 configuration
72,800 core bits at optimal T'' = 2 (50% fill), cutting disk I/O by 45.0% compared to a disk-resident index.
Space vs. exact hash
27.5x smaller than the 2,000,000-bit conventional hash table, yet wastes most of the potential I/O speedup.
When it fits
Only when primary RAM is severely starved and secondary checks are cheap relative to memory cost.

Source: Bloom (1970), Table I and Figure 1, pp. 425-426.

If you prefer the concise summary without clicking through the tabs, here is what Bloom’s Table I and Figure 1 establish:

  • P = 1/2 (72,800 bits): saves 45.0% of disk accesses, leaving 225,000 wasted reads on 450,000 regular words.
  • P = 1/8 (218,400 bits): saves 78.7% of disk accesses as false-positive I/O drops to 56,250.
  • P = 1/16 (291,200 bits): Bloom’s sweet spot saves 84.4% of disk accesses in under 300k bits (versus 2,000,000 bits for exact core hashing).
  • P = 1/64 (509,800 bits): hits diminishing returns at 88.5% saved because the 50,000 true exceptions cap savings at 90%.
  • Method 1 boundary: short-code cells overtake Method 2 only when P approaches zero error (2^(-b)) or when multibit memory reads and multi-hash CPU costs outweigh single-bit probes.

Footnote 1, deletions, and modern filter variants

Three caveats straight from Bloom’s 1970 text explain why modern storage engines modify Method 2 instead of implementing it verbatim.

First, Bloom explicitly warned that his time metric idealized away CPU caches and hashing cost. Footnotes 1 and 2 on pages 424 and 425 note that his analysis charges 1 equal unit to test any single bit, ignoring both the cost of computing d separate hash addresses and the fact that computers read memory in multi-bit words. On modern CPUs where fetching a 64-byte cache line costs the same as reading 1 bit, scattering d = 7 or 10 probes across a multi-megabyte bit array incurs up to d DRAM cache misses per lookup. Production engines fix this using Kirsch-Mitzenmacher double hashing (deriving d probes from two hash evaluations h1 + i * h2) and cache-line-blocked Bloom filters that confine all d bits to a single 64-byte cache line (trading a slight FPR bump for 1-cache-line lookups).

Second, standard Bloom filters forbid deletion and degrade if overfilled. Clearing a 1 bit back to 0 risks creating a false negative for another inserted key, and exceeding the planned n shifts phi'' below 0.5 irreversibly. Workloads that need deletes use counting Bloom filters (4x memory), Cuckoo filters (which store short fingerprints in two candidate buckets and beat Bloom space below a ~3% false-positive rate), or immutable static structures like Xor and Ribbon filters that pack closer to the information-theoretic log2(1/P) floor.

Third, an approximate filter is only safe when downstream work catches false positives. In Bloom’s dictionary or an LSM-tree SSTable index, a false positive only pays one extra disk seek. By contrast, when teams repurpose filters for deduplication (contrast SimHash near-duplicate detection and training-data deduplication) and discard every item the filter accepts without an exact check, every false positive silently deletes unique data.

For engineers sizing filters today, Bloom’s 1970 math gives a crisp three-step rule: verify that most queries truly miss, pick P just low enough that false positives cost less than true positives, and budget ~1.44 bits per key per bit of -log2 P while respecting cache-line locality on modern hardware.