%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Bloom Filter Size & False Positive Calculator

Results update as you type.

Your numbers

Understanding the Bloom filter calculator — concept and principle

A Bloom filter is a compact bit array that answers "have I seen this item?" with either "definitely not" or "probably yes". It never gives false negatives, but it can give false positives. This calculator sizes a filter: from the number of items you expect and the false positive rate you can accept, it returns the number of bits, the memory, the optimal number of hash functions and the bits per item.

How a Bloom filter stores and checks an itemSeven hash functions set seven bits per item; a million items at 1% need 9,585,059 bits, about 1.14 MiB.One item sets k = 7 bits0100100100010010010001007 hash functionsbit array mall 7 bits are 1→ probably inany bit is 0→ surely not in1,000,000 items at 1% false positivesm = −n ln p ÷ (ln 2)² = 9,585,059 bits≈ 1.14 MiB · 9.59 bits per item · k = 7
A lookup that finds all seven bits set says “maybe”; a single 0 means “definitely not”.

How it is calculated

Here n is the expected item count and p the target false positive rate as a fraction (1% = 0.01).

The principle

Inserting an item sets k bits chosen by k hash functions. A query checks the same k bits; if any is 0 the item was never added. After n insertions, the chance that a given bit is still 0 is about e^(−kn/m), so the false positive rate is p ≈ (1 − e^(−kn/m))ᵏ. This is minimized when about half the bits are set, which happens at k = (m/n) ln 2; substituting gives p = (1/2)ᵏ and the sizing formula above. Each tenfold reduction in p costs about 4.8 extra bits per item.

Worked example

  1. Inputs: n = 1,000,000 items, p = 1% = 0.01.
  2. m = −1,000,000 × ln 0.01 ÷ (ln 2)² = 1,000,000 × 4.6052 ÷ 0.48045 ≈ 9,585,058.4, rounded up to 9,585,059 bits.
  3. Memory: 9,585,059 ÷ 8 ÷ 1,048,576 ≈ 1.142628074 MiB.
  4. k = 9.585059 × 0.6931 ≈ 6.64, rounded to 7 hash functions.
  5. Bits per item: 9.585059.
How Bits needed m changes with Expected items nHow Bits needed m changes with Expected…05e+061e+071.5e+072e+07250,000500,000750,0001e+061.25e+061.5e+062e+06Example: 9,585,059Expected items n
Each point is the calculator re-run with only “Expected items n” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Expected items nBits needed m
250,0002,396,265
500,0004,792,530
750,0007,188,794
1e+069,585,059
1.25e+0611,981,323
1.5e+0614,377,588
2e+0619,170,117

How to read the result

About 9.6 bits per item gives 1%, 14.4 bits gives 0.1% and 19.2 bits gives 0.01%. If you insert more items than planned, the false positive rate rises quickly, so size for your peak count. Databases and storage engines use Bloom filters to skip disk reads for keys that are certainly absent; at 1%, about one read in a hundred misses is wasted.

Common mistakes

Keep in mind: The formulas assume independent, uniform hash functions and the planned item count. Overfilling the filter or using correlated hashes makes the real false positive rate higher than shown.

Frequently asked questions

Can a Bloom filter say an item is present when it is not?

Yes, that is the false positive. It can never say an item is absent when it was added.

Does item size affect the memory?

No. Only the bits per item matter, so a filter for long URLs is the same size as one for short IDs.

Why round k to a whole number?

You cannot use a fraction of a hash function, and the error rate is flat near the optimum, so rounding costs very little.

Sources: B. H. Bloom, "Space/time trade-offs in hash coding with allowable errors", Communications of the ACM 13(7), 1970 · A. Broder, M. Mitzenmacher, "Network applications of Bloom filters: a survey", Internet Mathematics 1(4), 2004 · A. Kirsch, M. Mitzenmacher, "Less hashing, same performance: building a better Bloom filter", ESA 2006

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →