Hash Avalanche Demonstrator
A good hash function has the avalanche property: change one bit of the input and about half the output bits should flip. It is easy to state and easy to assume, so this measures it instead. Every single-bit change to your text is applied in turn, each result hashed, and the number of output bits that moved is counted and averaged. The ideal for a 32-bit hash is sixteen; the measured figure is what gets reported.
What this generator does
Hashes your text, then flips one bit of each character in turn, hashes each variant, and counts how many of the 32 output bits differ from the original. It reports every row and the average, and confirms that no single-bit change left the hash untouched.
How to use this tool
- Enter some text and run it.
- Read the base hash, then the table of one-bit changes.
- Check the average against the ideal of sixteen out of thirty-two.
- Try text of different lengths and see how stable the average is.
Understanding the controls
- Your text
- Between 4 and 200 characters. Two bits per character are flipped, up to the first twelve characters, which keeps the table readable.
Common use cases
- Demonstrating the avalanche criterion with a real measurement
- Teaching why a hash of similar inputs looks completely unrelated
- Sanity-checking intuitions about hash behaviour
- Showing why hashes cannot be used to compare similarity
- Producing worked examples for a data-structures course
How this generator works
The hash is FNV-1a, chosen because it is short enough to explain in a sentence — exclusive-or each byte into the accumulator, then multiply by a fixed prime — while still having respectable avalanche behaviour. Bits changed are counted as the population count of the exclusive-or between the two hashes. A single-bit input change leaving the hash unchanged would be a genuine collision, so the checker fails on that rather than displaying it.
Randomness and fairness
No randomness at all. Both the hash and the bit flips are fully determined by the text you enter.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- FNV-1a is a non-cryptographic hash. It is used here because it is legible, and is not a recommendation for anything security-related.
- 32 bits only, so the ideal figure is sixteen; real cryptographic hashes are much wider.
- Only the first twelve characters are perturbed, and two bits of each, to keep the table readable.
- This measures avalanche on single-bit changes, which is one property among several a hash is judged on.
Privacy and your data
Your text is hashed in your browser and never transmitted. Analytics records only that the tool ran and how many characters were involved — never the text or any hash of it.
Related generators
- Consistent Hashing Ring GeneratorDistributes keys around a hash ring and measures exactly how many move when a node joins, with every move checked to go to the new node.
- Hash Table Scenario GeneratorKeys distributed into buckets by modulo hashing, with collisions, chain lengths and empty buckets all recounted from the table.
- Burrows-Wheeler Transform ToolThe Burrows-Wheeler transform of your text with every sorted rotation shown, checked by decoding it back to the original exactly.
- Checksum Test Number GeneratorA fictional, mod-10-checksum-valid test number, for testing validation code.