← All tools

Bloom Filter Calculator

A Bloom filter is a space-efficient probabilistic data structure that tests set membership: it can say an element is definitely not in the set, or possibly in it — never a false negative, but with a tunable false-positive rate. Size a filter (optimal number of hash functions k = (m∕n)·ln 2, expected false-positive rate p ≈ (1 − e−kn∕m)k, and optimal bit count m = −n·ln p ∕ (ln 2)²), then drive a live filter: insert elements, query membership, and watch the bit-fill ratio and observed versus theoretical false-positive rate. Hashing uses the Kirsch-Mitzenmacher double-hashing scheme over two FNV-1a hashes. Everything runs locally in your browser.

Sizing

Bits m
Hash functions k
Elements n

Find optimal m for a target false-positive rate

Target FPR (0–1)

Live filter

Filter bits m
Hash functions k
Insert (one per line)
Query

Filter state

Bloom filters. An m-bit array plus k hash functions represent a set. To insert, set the k bits h1(x)…hk(x). To query, check those bits: if any is 0 the element is definitely not in the set; if all are 1 it is possibly in (a false positive is possible because other elements may have set those same bits). There are no false negatives. The expected false-positive rate after n insertions is p ≈ (1 − e−kn∕m)k; it is minimized, for fixed m and n, by k = (m∕n) ln 2. Given a target p and n, the minimum bits needed is m = −n·ln p ∕ (ln 2)² (about 9.6 bits per element for p = 1%). This tool's k hashes are derived by double hashing (Kirsch & Mitzenmacher): hi(x) = (h1(x) + i·h2(x)) mod m, from two FNV-1a 32-bit hashes — a practical approximation to k independent hashes. Bloom filters back database joins, browser safe-browsing, and cache membership; the sizing math is the same as the birthday-problem collision bound. Everything runs locally — nothing leaves your browser.