Bloom Filter Calculator

Estimate the false positive rate of a Bloom filter.

Technology and NetUpdated 2026-11-202 min read
Bloom Filter Calculator
Number of bits in the filter.
False positive probability
...
Optimal hash functions...
Bits per item...

What it does

A Bloom filter is a compact data structure for testing whether an item belongs to a set. It can say definitely not in the set or probably in the set, trading a small false positive rate for very low memory use.

Georgia Tech algorithm notes derive the false positive probability as one minus the quantity one minus one over m to the power kn, all raised to k. With the standard approximation this becomes one minus e to the power minus kn over m, raised to k.

University of Massachusetts Amherst lecture slides give the same analysis and describe insertion and query using k independent hash functions into an m bit array.

This tool takes the expected number of items, the number of bits and the number of hash functions. It returns the false positive probability, the optimal number of hash functions and the bits allocated per item.

The formula assumes ideal hash functions and that exactly n items are inserted. Real implementations with correlated hashes can perform slightly worse.

How to use

  1. Enter the number of items you expect to insert.
  2. Enter the number of bits in the filter array.
  3. Enter the number of hash functions you plan to use.
  4. Read the false positive probability in the main result.
  5. Check the optimal k for this combination of m and n.
  6. Increase the bit array size and see how the probability falls.

Formula

p = (1 - e^(-kn/m))^k. Optimal k = (m/n) x ln(2).
n
Expected number of inserted items.
m
Number of bits in the filter.
k
Number of independent hash functions.
p
Probability of a false positive on a query.

The engine uses the exponential approximation rather than the exact discrete form, which is accurate for reasonable bit array sizes. The optimal k is rounded to the nearest whole number for display.

Worked example

Example: 1000 items in 10000 bits

Expected items 1000, bit array 10,000 bits, 7 hash functions.

  1. Bits per item is m / n = 10,000 / 1,000 = 10.
  2. Compute kn / m = 7 x 1,000 / 10,000 = 0.7.
  3. One minus e to the power minus 0.7 is about 0.5034.
  4. Raise that to the seventh power to get about 0.00819.
  5. The false positive probability is about 0.819372 percent.
  6. The optimal k is (10,000 / 1,000) x ln 2, about 6.93, rounded to 7.
  7. The tool reports false positive 0.819372 percent, optimal k 7 and bits per item 10.

Reference table

False positive rates for 1000 items
BitsHash functionsBits per itemFalse positive
4,0003414.7 %
10,0007100.819 %
20,00014200.0064 %
40,00028400.0000004 %

Limits

  • The formula assumes ideal independent hash functions.
  • It assumes exactly n items are inserted.
  • Deletions are not supported by a standard Bloom filter.
  • Very small bit arrays make the approximation less accurate.

Common mistakes

  • Entering bits and bytes interchangeably.
  • Using far more hash functions than the optimum, which slows queries without helping much.
  • Expecting false negatives, which a Bloom filter never produces for inserted items.
  • Ignoring the growth in false positives as more items are added than planned.
  • Treating the probability as a guarantee for a single query.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is the false positive rate for n=1000, m=10000, k=7?

About 0.819 percent.

What is the optimal k for 10 bits per item?

About 7, from 10 times ln 2 rounded.

Can a Bloom filter give a false negative?

No. If all k bits are set the item may be a false positive, but an inserted item always gives a positive.

Questions

What is a Bloom filter?

A compact probabilistic set membership structure with no false negatives and a small false positive rate.

What does the false positive probability depend on?

The number of items, the bit array size and the number of hash functions.

What is the optimal k?

Roughly m divided by n times ln 2.

Can items be removed?

Not from a standard Bloom filter. Variants such as counting Bloom filters allow deletions.

Where are Bloom filters used?

In databases, caches, browsers and network systems where a cheap membership test saves work.

Does the tool simulate the filter?

No. It computes the theoretical false positive probability.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.