2026-08-07

SHA-256 vs MD5: which hash should you use?

MD5 is broken for collision resistance; SHA-256 is the modern default for integrity checks. Compare them and hash locally.

MD5 and SHA-256 both produce digests, but they are not interchangeable for security. For new integrity and fingerprinting work, prefer SHA-256 (or stronger) over MD5 or SHA-1.

Collision resistance

MD5 and SHA-1 are considered broken for collision resistance - attackers can craft different inputs with the same digest in practical scenarios. SHA-256 remains widely recommended for everyday integrity checks and content fingerprints.

Output size and speed

MD5 yields 128 bits (32 hex chars). SHA-256 yields 256 bits (64 hex chars). MD5 is faster, which is one reason it is unsuitable for password storage - and for modern integrity where collisions matter. Speed is not a feature when an attacker can search or collide cheaply.

When you still see MD5

Legacy checksums, older package manifests, and some non-security fingerprints still use MD5. Interoperate when you must, but do not choose MD5 for new security-sensitive designs.

Password hashing reminder

Neither MD5 nor plain SHA-256 is a password hashing scheme. Use argon2, bcrypt, or scrypt (with salt) on the server for storing user credentials.

Prefer SHA-256 for integrity fingerprints - generate digests locally in your browser.
Open the free SHA-256 tool →

Related: What is SHA-256? · How to generate a SHA-256 hash