Bloom Filter Playground

A bloom filter trades a small, tunable false-positive rate for a huge space saving over storing the actual set. The false-positive rate is not a fixed constant — it's a function of bit-array size, number of hash functions, and how full the filter already is.

Filter configuration

Bit array size (m) 128
Hash functions (k) 3

Changing size or k resets the filter — a bloom filter can't be resized in place.

Add items

Item key

Bit array

unset (0) set (1) just tested — hit

Test membership

Key to test
0.00% false-positive rate

Where this shows up in production

ClickHouse's ngrambf_v1/tokenbf_v1 skip indexes, Parquet's per-column bloom filters, and Cassandra's row/partition bloom filters all use exactly this trick: before reading a whole block, file, or SSTable off disk, check a tiny in-memory bit array first. If the filter says "definitely not present," the block is skipped — guaranteed correct, because a bloom filter never produces false negatives. If it says "possibly present," the engine still has to do the real read, which may turn out to be unnecessary.