MD5: 128 Bit Digests, Broken Collisions, and Remaining Uses
MD5 is a 128 bit hash from RFC 1321 that is comprehensively broken for collision resistance and has been since 2004. It is not broken for preimages, which is why it survives in non-adversarial roles such as cache keys and legacy file manifests.
At a glance
- Digest size
- 128 bits
- Hex characters
- 32
- Block size
- 512 bits (64 bytes)
- Standard
- RFC 1321 (1992), superseded for security use by RFC 6151
- Broken for collisions
- Yes. Practical collisions from 2004, chosen prefix collisions from 2009, seconds on a laptop today
- Safe for password storage
- No. Use a memory-hard password hash such as Argon2id, scrypt or bcrypt
- Available in the generator
- Yes, second in the hash list after CRC32
In detail
MD5 is a Merkle-Damgard hash: the message is padded, split into 512 bit blocks, and each block is mixed into a 128 bit chaining value through four rounds of 16 operations. The final chaining value is the digest, printed as 32 hex characters. It was designed in 1991 and it is very fast, which is exactly the property that later made it unsuitable for the jobs people kept giving it.
The break is specific. In 2004 Wang and Yu produced colliding message pairs; by 2009 chosen prefix collisions let an attacker take two arbitrary, different prefixes and append computed blocks so the two files hash identically. That is how the Flame malware forged a code signing certificate in 2012. What has never been demonstrated is a practical preimage attack: given a digest, nobody can produce an input that hashes to it, other than by guessing.
That distinction decides what MD5 can still do. Anywhere two parties might submit files, MD5 is finished: certificates, signatures, code integrity, deduplication of untrusted uploads, and any 'this file matches the one I approved' check. An attacker who supplies both files controls both sides of the collision, which is precisely the scenario a collision attack needs.
Anywhere the input is yours and nobody is trying to fool you, MD5 is merely old rather than dangerous. ETag generation, cache keys, sharding, detecting whether your own config file changed since the last deploy: these care about accidental collisions, which remain vanishingly unlikely at 128 bits. Even so, SHA-256 is fast enough on modern hardware that new code has no reason to reach for MD5.
MD5 is wrong for password storage, and this is the single most common misuse. It is fast by design, so a consumer GPU tests billions of candidates per second against a leaked MD5 table. Salting slows down precomputed rainbow tables and does nothing about raw throughput. Passwords need a memory-hard function with a tuned cost, such as Argon2id, scrypt or bcrypt. ToolBox does not provide one, and this generator is not a stand-in.
Examples
input: "" -> d41d8cd98f00b204e9800998ecf8427e
input: "abc" -> 900150983cd24fb0d6963f7d28e17f72The digest of the empty string is worth memorising: if a tool hands you d41d8cd9... it hashed nothing, usually because a file read failed silently.
input: "" -> 1B2M2Y8AsgTpgAmY7PhCfg==
input: "abc" -> kAFQmDzST7DWlj99KOF/cg==Content-MD5 headers and some storage APIs want Base64 of the raw 16 bytes, not hex. The generator has a hex or Base64 switch for this.
Things that catch people out
- MD5 is vulnerable to length extension. Given MD5(secret + message) and the length of the secret, an attacker can compute MD5(secret + message + padding + extra) without knowing the secret. Never authenticate a payload by hashing a secret in front of it; use HMAC-SHA-256 instead.
- 'Salted MD5' is still MD5. A salt defeats precomputed tables but does nothing about the fact that an attacker can test billions of guesses a second against the salted hash they stole.
- MD5 sums published next to a download only prove the file matches what the same server said it should be. If the server is compromised, both the file and the checksum change together. Signature verification, not a checksum, is what detects that.
- Some regulated environments ban MD5 outright even for non-security uses, because scanners flag the call site rather than reason about the context. Expect to justify it in an audit even when it is technically fine.
Try it: Hash Generator
Paste text or drop a file and get every digest at once, in hex or Base64, with a verify tab for comparing an expected value against what you actually have.
Hash Generator
LOCAL · Browser-OnlyGenerate MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-512, Keccak-256, CRC32, and HMAC hashes from text or files
MD5 is cryptographically broken and should not be used for security purposes. Use SHA-256 or SHA-512 instead.
Related Hash algorithms
All hash algorithms →SHA-1: Practical Collisions and What Replaced It
SHA-1 gives a 160 bit digest, 40 hex characters. Collisions became practical in 2017 and chosen prefix collisions in 2020. What still uses it and why.
SHA-256: The Default Choice and How It Is Used
SHA-256 gives a 64 character hex digest with no practical collision or preimage attack. Where it belongs, where it does not, and its length extension flaw.
CRC32: What a Checksum Detects and What It Cannot
CRC32 gives an 8 character checksum that catches accidental corruption and nothing else. Why it is trivially forgeable and never a security control.
HMAC-SHA-256: Signing and Verifying Payloads Correctly
HMAC-SHA-256 gives a 64 character authentication tag. Why it replaces hash(secret + body), how webhook signatures use it, and how verification goes wrong.
SHA-384: Truncated SHA-512 and Why the Truncation Helps
SHA-384 is SHA-512 with a different starting state, cut to 384 bits. That truncation removes the length extension weakness. 96 hex characters explained.
SHA-512: 512 Bit Digests and 64 Bit Word Arithmetic
SHA-512 outputs 128 hex characters using 64 bit words and 1024 bit blocks. Why it can beat SHA-256 on 64 bit hardware, and where the extra width is pointless.
Tools for this
- Hash Generator Free online hash generator - generate MD5, SHA-1, SHA-256 hashes from any input text
- Base64 Encoder/Decoder Base64 encode and decode online - convert text to Base64 or decode Base64 strings instantly, free