Cryptography & Security
Advanced

Avalanche Effect Target

A good hash flips about half its output bits when one input bit changes.

Formula

E[Δ]=n2E[\Delta] = \frac{n}{2}

Live Calculator

Members

Variables

E[Δ]Expected bits changed
nOutput size (bits)

Example

256-bit hash: ~128 bits should flip per input change

How it works

This formula gives the ideal avalanche target for a hash function: if you change one input bit, each output bit should have about a 50% chance of flipping. That means the expected number of changed output bits is half the hash length, because the output bits behave like independent coin flips in a well-designed construction. The target comes from the idea that a secure hash should make small input changes produce outputs that are statistically indistinguishable from random with respect to the old output.

When to use it

Use this when evaluating or teaching hash-function diffusion, comparing two candidate hashes, or checking whether a design has enough sensitivity to input changes. It is also useful in cryptographic testing, where you measure whether observed bit-flip counts are close to the ideal half-output-length benchmark.

Worked example, step by step

Suppose a hash produces a 512-bit output. E[Δ] = n/2 E[Δ] = 512/2 E[Δ] = 256 So, on average, changing one input bit should flip about 256 output bits.

Common mistakes to avoid

  • Thinking the formula says exactly half the bits must flip every time, instead of on average
  • Using the number of input bits instead of the output size n
  • Assuming a poor hash is acceptable just because some output bits change

Did You Know?

The avalanche effect is why changing a single comma in a document utterly transforms its SHA-256 fingerprint.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026