Developer Tools
Bloom Filter Calculator
Size a Bloom filter from expected items and target false-positive rate, find optimal hash functions, analyze an existing filter, or solve for max capacity.
Common deployments
Drop in a textbook-sized filter and tune from there.
Mode
Design a new filter
How many distinct elements you plan to insert. Supports 1e6, 1_000_000, or 1,000,000.
Accepts 0.01, 1%, or 1 in 1000. Lower is stricter (and more memory).
False-positive rate as the filter fills
Sweep n from 0 to 1.5x the operating point. The vertical mark is the operating point.
| Items vs operating | FPR | As a ratio | Visual |
|---|---|---|---|
0% load | 0 | n/a | |
13% load | 3.848e-8 | 1 in 25,990,346 | |
25% load | 3.604e-6 | 1 in 277,458 | |
38% load | 4.529e-5 | 1 in 22,082 | |
50% load | 0.0251% | 1 in 3,989 | |
63% load | 0.0888% | 1 in 1,127 | |
75% load | 0.2373% | 1 in 421 | |
88% load | 0.5234% | 1 in 191 | |
100% loadoperating | 1.004% | 1 in 100 | |
113% load | 1.733% | 1 in 58 | |
125% load | 2.755% | 1 in 36 | |
138% load | 4.102% | 1 in 24 | |
150% load | 5.788% | 1 in 17 |
Tip: Bloom filters degrade quickly past the design point. Cross the operating mark and the FPR climbs faster than the load does.
Formulas
Size from n and p
m = -(n * ln(p)) / (ln(2)^2)
Bits required. Divide by 8 for bytes. ~9.585 bits per item at 1% FPR is a useful rule of thumb.
Optimal hash count
k = (m / n) * ln(2)
Maximizes information per bit and minimizes false positives. Round to the nearest whole number.
False-positive rate
p = (1 - exp(-k * n / m))^k
Assumes independent uniform hashes. Standard variant. Counting Bloom filters and Cuckoo filters use different math.
How to use
- Pick a preset to drop in a textbook-sized filter, or stay on the defaults and tune the inputs.
- Choose a Mode. Design sizes a new filter from n and p; Analyze evaluates an existing filter from m, n, and k; Capacity finds the largest n that keeps the filter under a target FPR.
- Enter the inputs. Expected items accepts 1000000, 1e6, 1_000_000, or 1,000,000. Target false-positive rate accepts 0.01, 1%, or 1 in 1000.
- Read the headline pill (required bytes, actual FPR, or maximum items) and the per-row breakdown for bits, bytes, bits per item, optimal versus rounded k, fill ratio, and FPR as a ratio.
- Scan the cliff chart to see how the false-positive rate climbs as the filter fills past its operating point. Use the Send these values button on Design to seed Analyze and Capacity with one click.
- Click Copy report to lift a plain-text summary with all numbers and formulas into the clipboard, ready for a design doc, code review, or runbook.
About this tool
Bloom Filter Calculator sizes a Bloom filter and quantifies the trade-off between memory, hash functions, and the false-positive rate. Bloom filters are the standard probabilistic membership data structure used by RocksDB and LevelDB to skip disk reads, by web crawlers and URL shorteners to avoid revisiting pages, by Bitcoin SPV clients via BIP 37, by log pipelines and stream processors for dedup, by query optimizers for join planning, and by password-leak checkers for fast offline lookups. The tool runs three modes that match how engineers actually reach for the math. Design takes n (the expected number of items) and p (the target false-positive rate, accepting 0.01, 1%, or 1 in 1000 shorthand), then returns the bit array size m from the canonical formula m = -(n * ln(p)) / (ln(2)^2), the optimal hash count k = (m / n) * ln(2), the integer k that should actually be used in code, and the realized FPR at that rounded k. Analyze takes m, n, and k from an existing filter and returns the actual false-positive rate p = (1 - exp(-k * n / m))^k, the fill ratio (the fraction of bits flipped to 1), the optimal k for the current load so you can spot a misconfigured filter, and the bits per item ratio. Capacity inverts the equation to solve for the largest n that keeps the filter below a target p, which is how SREs decide when to rotate or rebuild a filter that is approaching saturation. Eight presets drop in textbook-sized filters: cache dedup at 1M items and 1% FPR, URL shortener at 10M and 0.1%, web crawler frontier at 100M and 0.1%, spell checker at 50k and 0.1% (the 1970 original use case), compromised password set at 10M and 0.01%, BIP 37 wallet filter at 1k and 0.1%, log dedup at 1B and 0.01%, and LSM tree per-SSTable filter at 10M and 1%. The result panel shows the headline number (required bytes for Design, actual FPR for Analyze, maximum items for Capacity) plus a row-by-row breakdown of size in bits and bytes, bits per item, optimal versus rounded k, fill ratio, and the FPR as both a percent and a 1 in N ratio. A cliff chart sweeps the load from 0 to 1.5x the operating point so you can see how steeply the false-positive rate climbs as the filter fills past its design capacity. Useful for database engineers tuning RocksDB, search engineers sizing inverted-index filters, security engineers building offline password-leak checkers, data engineers running dedup at scale, networking engineers sizing per-flow filters, and any backend or systems engineer who has had to estimate the memory budget for a probabilistic set. All math runs in your browser; nothing is uploaded.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Subnet Calculator
IPv4 CIDR network, broadcast, host range, mask, and binary view.
Open tool
DeveloperSLA Uptime Calculator
Allowed downtime for any SLA percentage from 90% to six nines, across all periods.
Open tool
DeveloperExponential Backoff Calculator
Plan retry delays with exponential backoff and jitter, with totals and a schedule.
Open tool
DeveloperGzip Compression Size Estimator
Gzip, deflate, and raw deflate size measurement with HTTP transfer budget comparisons.
Open tool
CalculatorPercentile Calculator
Nth percentile and percentile rank with five quantile methods and a common percentiles table.
Open tool
CalculatorStandard Deviation Calculator
Sample and population SD, variance, quartiles, outliers, and step by step working.
Open tool