Every password database leak raises the same question: how were the passwords stored? If the answer is MD5, the follow-up is never good. The common passwords in the file become public quickly, not because anyone reversed the maths, but because MD5 was never built to resist guessing.

This guide explains the two reasons MD5 fails at password storage: it is fast, and it is unsalted. Both are easy to see in the free MD5 Hash Generator on Ovatly, which computes MD5 hashes of text and files in your browser, and which carries the warning itself: MD5 must never be used for passwords. Understanding why changes how you read every breach headline.

Contents

  • Quick answer
  • What a stored password hash has to survive
  • Failure one: MD5 is fast, so guessing is cheap
  • Failure two: no salt, so one table serves every database
  • See both failures yourself, step by step
  • Worked example: one password, the same hash everywhere
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

MD5 is not safe for passwords for two independent reasons. First, it is fast: it was designed to fingerprint files quickly, so an attacker testing guesses pays almost nothing per try. Second, it is deterministic and unsalted: the same password always produces the same hash, so attackers precompute rainbow tables of common passwords once, then simply look up each hash they steal. Password storage belongs to slow, salted hashes such as bcrypt, which are built to make each guess expensive and each value unique.

What a stored password hash has to survive

A stored hash is not really protecting the password from the website that collected it. It is protecting the password on the worst day: the day the database is copied and the attacker takes it home. Offline, there are no login forms, no rate limits and no lockouts. The attacker guesses as fast as their hardware allows and checks each guess against every stolen hash at once.

That threat model demands two properties from a password hash. Each guess should be expensive, so working through a dictionary takes time. And each password should hash differently each time it is stored, so work against one account cannot be reused against another. MD5 offers neither property, and the two failures are independent: fixing one would still leave the other.

Failure one: MD5 is fast, so guessing is cheap

MD5 was designed as a checksum: a quick fingerprint for files. Speed is a virtue there. You want to hash a large download in seconds and compare the result. The MD5 Hash Generator reflects that design: type or pick a file, compute, and the result appears immediately.

For passwords, that same speed is the defect. An attacker with a stolen MD5 database can test guesses at the full speed of the algorithm, which means whole dictionaries and pattern lists get tried exhaustively rather than sampled. Short and common passwords fall first, but the real problem is structural: the algorithm charges almost nothing per guess, so persistence is cheap. A password hash is supposed to invert that economics, making each guess cost enough time that exhaustive guessing stops being practical. That is exactly what slow password hashes such as bcrypt are built to do.

Failure two: no salt, so one table serves every database

MD5 is deterministic. The same input always produces the same output, byte for byte, on any machine, forever. That is essential for a checksum and fatal for a password store, because it lets attackers move the guessing work offline and do it once.

A rainbow table is that advance work: a precomputed mapping from common passwords to their MD5 hashes. Building one takes effort, but after that recovering a password is a lookup, not a computation. And because MD5 has no salt, the table built for one stolen database works on every other MD5 database too. The same password produces the same hash everywhere, so one table serves the whole world.

A salt breaks this by mixing a random value, stored alongside each password, into the hash before it is computed. The same password then yields a different stored hash for every account, and a precomputed table would have to be rebuilt for every single salt, which destroys its value. Slow and salted together is the combination password storage needs, and MD5 does not have it.

See both failures yourself, step by step

  1. Open the MD5 Hash Generator and choose Text. Type abc and press Compute MD5. The result is 900150983cd24fb0d6963f7d28e17f72, one of the published test values for MD5.
  2. Clear the box, type abc again and compute again. The result is identical, character for character. It will be identical on any computer, which is why a rainbow table can be built.
  3. Type abc, press Enter to add a trailing newline, and compute once more. The hash changes completely, because text is hashed as UTF-8 bytes and the newline is part of the input.
  4. Clear the box completely and compute the empty input. The result is d41d8cd98f00b204e9800998ecf8427e, the other published test value, which confirms the tool matches the standard.

Worked example: one password, the same hash everywhere

Suppose someone uses abc as a password, a terrible choice on its own. Its MD5 is 900150983cd24fb0d6963f7d28e17f72 in your browser, in the generator, and in every stolen database where that person reused it. An attacker's table maps that one hash straight back to abc, instantly, for all of those accounts at once.

Now store the same weak password with a slow, salted hash instead. The stored value is different for every account, so the table lookup finds nothing. The attacker is reduced to guessing account by account, and each guess costs real time because the hash is deliberately slow. The password is still weak, but the storage has stopped multiplying the damage across every site at once.

Limitations and honest tradeoffs

MD5 is not useless. Speed and history keep it relevant: it detects accidental damage in downloads and backups well, and many older catalogues publish only MD5 values, so the generator remains genuinely handy. The tool has no size limit of its own, though very large files are read into memory, which can make a huge file slow to hash.

What MD5 cannot do is any job where an opponent is involved. Forged collisions are practical, so a matching MD5 does not prove a file untampered. It says nothing about who made a file. This guide also only points at the alternative: bcrypt is the class of tool built for the job, and proper password storage setup deserves its own treatment.

Common mistakes

  • Calling an MD5 hash "encrypted". A hash is a one-way fingerprint, not encryption, and MD5 in particular must never hold a password.
  • Judging safety by how scrambled the output looks. Every MD5 result looks like random hex. The weakness is the process, fast and unsalted, not the appearance.
  • Adding one fixed secret word to every password before hashing. A constant shared by all accounts is not a salt. A salt is random per password, which is what makes each stored hash unique.
  • Trying to decrypt an MD5 to recover a password. There is nothing to decrypt; short and common inputs are recovered by guessing and table lookup.
  • Promising file integrity with MD5. Because collisions can be forged, MD5 cannot promise a file is untampered. Use SHA-256 for integrity that matters.

FAQs

Can MD5 be reversed to recover a password? Not mathematically. But MD5 is deterministic and unsalted, so attackers precompute rainbow tables of common passwords and their hashes; a short or common password is recovered by lookup, not by reversing the maths.

Why is a fast hash bad for passwords? Password storage needs guessing to be expensive. MD5 was built for speed, so an attacker can test guesses cheaply and work through whole dictionaries. Slow, salted hashes such as bcrypt make every guess cost real time.

What does a salt change? A salt is a random value stored with each password and mixed into its hash. The same password then produces a different hash for every account, so one precomputed table cannot be reused across a whole database.

Is MD5 useless, then? No. It is still fine for detecting accidental damage in downloads and backups, and many older catalogues publish only MD5 values. It fails at security jobs: password storage and proving a file was not tampered with.

Does a matching MD5 prove my download is genuine? No. Forged MD5 collisions are practical, so a match does not prove a file is untampered. Use SHA-256 when integrity matters.

Conclusion

MD5 fails passwords twice, independently: it is fast, so guessing costs an attacker almost nothing, and it is unsalted, so one precomputed table unlocks every copy of the same password in every database. You can watch both flaws happen in the MD5 Hash Generator in under a minute. Used in its honest lane, checking that a download arrived intact, MD5 still earns its place, and How to Check an MD5 Checksum from a Download Page walks through that check step by step. For more guides in this series, see our Security and Privacy guides, which pair each technique with the free tool that performs it.

References