Change one bit of a file and its SHA-256 hash changes completely, in a way that looks unrelated to the change you made. That property, and two others, is why the same 64-character string appears in download pages, git commits, TLS certificates and blockchains.
Three Properties, One Purpose
A cryptographic hash takes input of any size and produces a fixed-size output, 256 bits for SHA-256, written as 64 hexadecimal characters. The function is deterministic: the same input always produces the same output.
What makes it cryptographic rather than merely a checksum are three properties.
Preimage resistance: given a hash, you cannot work backwards to find an input that produces it. Hashing is one-way, so the output reveals nothing about the input's content or length.
Second preimage resistance: given one input, you cannot find a different input with the same hash. This is what lets a hash stand in for a file.
Collision resistance: you cannot find any two inputs that hash to the same value. This is the strongest requirement and the first to fall when a hash function is broken.
SHA-256 currently holds all three. No collision has ever been produced, and the best known attacks do not meaningfully reduce the work required.
The Avalanche Effect
Hash `hello` and you get `2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824`. Hash `hellp`, one letter different, and you get `9e0d3a8...`, a value with no visible relationship to the first.
This is the avalanche effect: flipping a single input bit should flip roughly half the output bits, unpredictably. It is what makes hashes useful for detecting tampering, because there is no way to make a small, controlled change to the output by making a small change to the input.
It also means a hash cannot tell you *how much* two inputs differ. Two files differing by one byte and two entirely unrelated files both produce completely different hashes. If you need similarity rather than identity, you need a different tool, such as a fuzzy hash or a diff.
The SHA Family in 2026
SHA-1 remains widely deployed in legacy systems despite being broken for collision resistance since 2017.
| Algorithm | Output | Status | Use it for |
|---|---|---|---|
| MD5 | 128 bits | Broken since 2004 | Non-adversarial checksums only |
| SHA-1 | 160 bits | Collisions demonstrated 2017 | Legacy compatibility only |
| SHA-256 | 256 bits | Secure | General purpose; the default choice |
| SHA-384 | 384 bits | Secure | Higher margin; common in TLS suites |
| SHA-512 | 512 bits | Secure | Faster than SHA-256 on 64-bit hardware |
| SHA-3 / Keccak | 224-512 bits | Secure | Different internal design; a hedge against SHA-2 breaks |
| bcrypt / Argon2 | Variable | Secure | Passwords, and only passwords |
Do not store passwords with SHA-256
SHA-256 is designed to be fast, and speed is exactly what you do not want when hashing passwords. Commodity hardware computes billions of SHA-256 hashes per second, so a leaked table of hashed passwords falls quickly to a dictionary attack. Password hashing needs a deliberately slow, memory-hard function: Argon2id, scrypt or bcrypt.
Where SHA-256 Earns Its Place
Each of these relies on a different one of the three properties, which is worth noticing when you evaluate whether a hash is the right tool.
Verifying downloads
A published hash lets you confirm a file arrived intact and unmodified. This only helps if you get the hash over a channel the attacker does not control, which is why hashes on the same page as the download add less than people think.
Content addressing
Git names every object by the hash of its contents, so identical content is stored once and any corruption is detectable. Docker layers and IPFS use the same idea.
HMAC and webhook signatures
Combining a hash with a secret key produces a signature that proves both integrity and origin. This is how Stripe, GitHub and most webhook providers let you verify a request really came from them.
Deduplication
Backup systems hash blocks to identify duplicates without comparing contents byte by byte. Collision resistance is what makes it safe to treat matching hashes as matching data.
Proof of work
Bitcoin mining searches for an input whose SHA-256 hash starts with a run of zeros. Preimage resistance is what makes the search expensive and the verification instant.
Generate a SHA-256 hash
Computed in your browser with the Web Crypto API. Your input is never transmitted.
What a Hash Cannot Do for You
A hash proves that data has not changed since the hash was computed. It proves nothing about who computed it.
If an attacker can modify the file, they can usually modify the published hash alongside it. This is the flaw in listing a checksum on the same page as the download: anyone who can alter one can alter the other. Checksums are genuinely useful against transmission errors, mirror corruption and a compromised CDN, and genuinely useless against a compromised website. For origin, you need a signature, which is a hash combined with a private key.
The second limit concerns short inputs. Hashing is one-way in the sense that the function cannot be inverted, but if the input space is small, an attacker simply hashes every candidate. Every possible six-digit PIN can be hashed in under a second, so the hash of a PIN, a phone number or an email address provides no meaningful privacy. Adding a secret salt is what makes hashed identifiers resistant to that, and it is why hashed email addresses in advertising datasets are far weaker anonymisation than they appear.
Frequently Asked Questions
Related Tools
Keep Reading
MD5 in 2026: Broken for Security, Still Useful for Checksums
Collisions have been practical since 2004 and forged a Microsoft certificate in 2012. Which of MD5's remaining uses that break actually affects.
Password Strength: Why Length Beats Complexity Rules
NIST withdrew the advice about symbols and 90-day expiry, and the arithmetic explains why. One extra character is worth more than every symbol on the keyboard.
Base64 Is Not Encryption: What It Does and Why It Exists
Three bytes become four characters, which is where the 33 percent size increase and the trailing equals signs come from. And why it hides nothing.
JSON Errors Explained: Trailing Commas, NaN and Other Rejections
Why valid-looking JSON fails to parse, how to read a parser's error position, and the number precision bug that silently corrupts large IDs.