Bloom Filter Playground illustration

Bloom Filter Playground

An interactive Bloom filter: pick the bit array size m and the number of hash functions k with sliders, add items one by one or in bulk, and watch exactly which k bits each item sets. Query anything — the probed cells light up, and the filter answers "definitely not present" or "possibly present". The tool tracks the inserted count n and compares the theoretical false positive rate (1−e^(−kn/m))^k against an empirical rate measured by querying thousands of random strings that were never added. A solver does the sizing math for you: give it an expected item count and a target false positive rate, and it recommends the optimal m and k.

Runs 100% in your browser — nothing you paste leaves your device.

Notes

  • A Bloom filter can say "definitely not" with certainty but only "probably yes" — false positives are the price for using ~10 bits per item instead of storing the items.
  • Optimal sizing: m = −n·ln p/(ln 2)² bits and k = (m/n)·ln 2 hash functions. For 1% error that is about 9.6 bits and 7 hashes per item.
  • Deleting is impossible: clearing a bit might erase evidence of other items. Counting Bloom filters trade more memory for deletability.
  • Hashing uses FNV-1a with double hashing (h1 + i·h2 mod m) — the standard trick to derive k hash functions from two.
  • Runs 100% in your browser — nothing you paste leaves your device.