MD5, SHA-1, SHA-256: pick the right tool, not the strongest one
There are three honest reasons to hash something: (1) compare two large files quickly for accidental corruption, (2) build a fingerprint for caching, deduplication or content addressing, (3) cryptographic security. Each reason has a different right answer. “Always use the strongest available” is wrong advice — it conflates these use cases and uses general-purpose hashes for passwords, where they are catastrophically inappropriate.
MD5 — broken for security, fine for the rest
Collision attacks against MD5 have been practical since 2004 (Wang et al.). Two PDFs with the same MD5 but different content can be produced in minutes on a laptop. For anything where an adversary could substitute one file for another, MD5 is dead. For accidental corruption detection, deduplication, cache keys, or fingerprinting in non-adversarial contexts, MD5 is perfectly fine and faster than any of the SHA family.
SHA-1 — broken for security in 2017, still in Git
The SHAttered attack (2017) produced the first practical SHA-1 collision (two distinct PDFs with identical SHA-1). NIST deprecated SHA-1 in 2011 and it is removed from TLS certificates since 2017. Git still uses SHA-1 internally for object addressing because the threat model is accidental collision, not adversarial collision (and Git is migrating to SHA-256 anyway). Outside of that specific tolerance, treat SHA-1 like MD5: not for security.
SHA-256 — the 2026 baseline
Part of the SHA-2 family (NIST FIPS 180-4). No known practical attack. Used for code signing, TLS certificate signatures, Bitcoin proof-of-work, content-addressed storage (Git’s new format, IPFS, OCI container images). The default choice when you actually need cryptographic security.
SHA-512 — counterintuitively faster on 64-bit CPUs
Same security family as SHA-256, no security advantage in practice. On 64-bit hardware, SHA-512 is often faster than SHA-256 because the inner operations are natively 64-bit. Truncated SHA-512/256 (SHA-512 result truncated to 256 bits) is a standard variant with the speed of SHA-512 and the digest size of SHA-256.
Length-extension — why HMAC exists
Plain SHA-256 is vulnerable to length-extension attacks: if you sign a message as secret || message and publish the hash, an attacker who does not know secret can still compute valid hashes for secret || message || suffix for any chosen suffix. Use HMAC-SHA256 (which the HMAC Generator on this site builds) for any signature use case. SHA-3 (Keccak) is not vulnerable to length-extension and is a clean alternative.
Password hashing — none of these
MD5, SHA-1, SHA-256, SHA-512 are all designed to be fast. For password storage you want the opposite: deliberately slow, with a tunable cost factor, salted, and ideally memory-hard. That is bcrypt, scrypt or Argon2 — not anything in the general-purpose hash family. OWASP password-storage guidance recommends Argon2id as of 2026.
Takeaway: Choose the hash by threat model, not by perceived strength. Accidental corruption → MD5 (fast, free, fine). Cache key, dedup, file fingerprint → MD5 or SHA-1 (fast, collisions by accident only). Cryptographic integrity, code signing, content addressing → SHA-256+. Signing where an adversary controls part of the input → HMAC. Password storage → Argon2/bcrypt/scrypt, never anything on this page. The generator above gives you all five in parallel because the right one depends on what you are doing with the output.
Sources: NIST hash functions (FIPS 180-4) · RFC 6151 (MD5 deprecation for security) · SHAttered — first practical SHA-1 collision · OWASP password storage cheatsheet.