MD5 vs SHA-256
MD5 and SHA-256 are both cryptographic hash algorithms: either turns an input of any length into a fixed-size digest. They are not interchangeable; they differ in digest size and, more importantly, in how much trust they still deserve. Both are available in the Hash Generator tool.
| MD5 | SHA-256 | |
|---|---|---|
| Digest size | 128 bits (32 hex characters) | 256 bits (64 hex characters) |
| Family | Designed by Ron Rivest, published 1992 (RFC 1321) | Part of the SHA-2 family, published by NIST in 2001 |
| Collision resistance | Broken. Practical collision attacks are well documented; two different inputs can be made to produce the same MD5 hash | No known practical collision attack as of this writing; still considered cryptographically secure |
| Safe for security use? | No, don't use for password storage, digital signatures, or anywhere collision resistance matters | Yes, widely used in TLS certificates, digital signatures, and password-hashing building blocks |
| Still fine for | Non-adversarial checksums, detecting accidental file corruption or confirming a download matches a known-good hash | Anything MD5 is fine for, plus security-sensitive integrity checks |
| Common real-world use | Legacy checksums, some older cache keys and ETags | Git commit hashes (replacing SHA-1), TLS certificate fingerprints, blockchain proof-of-work (e.g. Bitcoin uses double SHA-256) |
Which one do I want?
If you need a quick checksum to detect accidental corruption, not to defend against a deliberate attacker, MD5 is fast and still "good enough." For anything where an adversary might try to forge or substitute data (signatures, certificates, password hashing, commit integrity), use SHA-256 or a stronger member of the SHA-2 / SHA-3 family. Note that SHA-1, once the common middle ground, is also considered broken for collision resistance and is being phased out in the same places MD5 was.