Hash Generator Guide: MD5 vs SHA-256, HMAC & File Checksums Explained
Hashes are the fingerprints of the digital world — they verify your downloads, sign API requests, and address every Git commit. Here is what they are, which algorithm to pick, and why MD5 and SHA-1 had to be retired.
Try it right now — free, no upload:
Generate a hash →What is a hash, really?
A hash function takes data of any size — a word, a novel, a 4 GB video — and squeezes it into a short fixed-length string. SHA-256 always gives you 64 hex characters. Three properties make this useful. First, it is one-way: you cannot reconstruct the input from the hash. Second, it is collision-resistant: nobody can feasibly find two different inputs with the same output. Third, the avalanche effect: flip one bit of input and roughly half the output bits change, so similar files get wildly different hashes.
The second property is the fragile one. When researchers learn to manufacture collisions faster than brute force, the algorithm is living on borrowed time — which is exactly what happened to MD5 and SHA-1.
A short, honest history
MD5 (1991). Designed by Ron Rivest, 128-bit output. First weaknesses surfaced in 1996; practical collisions were demonstrated by Wang and colleagues in 2004, chosen-prefix collisions in 2008, and the Flame malware used MD5 collisions in 2012 to forge Windows Update signatures. Verdict: cryptographically broken — fine for casual checksums, never for security.
SHA-1 (1995). Designed by the NSA, 160-bit output. Theoretical attacks in 2005, then SHAttered in 2017: Google and CWI Amsterdam produced two different PDFs with the identical SHA-1, at a cost of roughly 6,500 CPU-years. A chosen-prefix collision followed in 2020. Verdict: broken — migrate to SHA-256.
SHA-2 (2001). The SHA-256/384/512 family. Twenty-five years on, no practical attacks. SHA-256 is the world’s default for file verification, HMAC signatures, and certificate chains; SHA-384/512 add margin for long-lived signatures. (There is also SHA-3, standardized in 2015 with a different design called Keccak, but SHA-2 remains the workhorse.)
What people actually use hashes for
- Verifying downloads — compare a file’s SHA-256 with the checksum on the download page. Match means intact and untampered.
- Signing API requests — HMAC-SHA-256 plus a shared secret proves a webhook really came from the sender.
- Deduplication — identical files, identical hashes; backup tools use this to skip copies.
- Git — every commit is addressed by its SHA-1 hash (migration to SHA-256 is underway).
And the classic mistake: hashing passwords directly. Fast hashes let attackers try billions of guesses per second on a GPU. Passwords need slow, salted algorithms — bcrypt, scrypt, or Argon2 — like the ones in our htpasswd generator.
Privacy: hash locally
Many hash sites send your input to their server to compute the digest. That is a genuine risk when you are hashing API tokens, secrets, or private documents. Prefer a tool that computes everything in your browser — via the Web Crypto API for the SHA family and local code for MD5. Nothing leaves your device, and you can prove it: open the Network tab in DevTools while hashing and confirm zero requests.
Frequently asked questions
It turns any text or file into a fixed-length fingerprint. SHA-256 always outputs 64 hex characters no matter how big the input is. The fingerprint changes completely if even one byte of the input changes, which is what makes it useful for verifying downloads and detecting tampering.
Researchers found the first practical MD5 collisions in 2004, chosen-prefix collisions followed in 2008, and the Flame malware used MD5 collisions in 2012 to forge Microsoft signatures. Two different files can now share one MD5 hash, so MD5 must never be used where an attacker could benefit. It remains fine for casual, non-security checksums.
SHA-1 was standardized in 1995 and theoretical attacks appeared in 2005. In 2017 Google and CWI Amsterdam demonstrated SHAttered — the first practical collision, two different PDFs with the same SHA-1. A chosen-prefix collision followed in 2020. Anything still on SHA-1 should move to SHA-256.
A hash only proves integrity if you trust the source — anyone can recompute it. HMAC mixes in a secret key, so the output also proves authenticity: only someone with the key could have made it. APIs sign webhooks with HMAC-SHA-256 for exactly this reason.
Hash the downloaded file with SHA-256 and compare the result character-by-character with the checksum on the download page. If they match exactly, the file arrived intact. Our hash generator has a Compare tab that does the check for you.
No — never hash passwords directly with MD5, SHA-1, or SHA-256. These are fast by design, and attackers with GPUs can try billions of guesses per second. Passwords need slow, salted algorithms built for the job: bcrypt, scrypt, or Argon2.
