Learn what MD5 hashing is, how to generate MD5 checksums for file verification, and why MD5 should never be used for passwords.
A cryptographic hash function takes an input of arbitrary length and produces a fixed-size output called a hash, digest, or checksum. Hash functions are the workhorses of computer security and data integrity verification.
Four key properties define a good hash function:
MD5 (Message Digest Algorithm 5) was designed by Ronald Rivest in 1991 as a replacement for MD4. It produces a 128-bit (16-byte) hash, typically displayed as a 32-character hexadecimal string.
Input: "Hello, World!"
MD5: 65a8e27d8879283831b664bd8b7f0ad4
Change one character:
Input: "Hello, world!" (lowercase w)
MD5: 6cd3556deb0da54bca060b4c39479839
The hashes are completely different — this is the avalanche effect in action.
MD5 was the dominant hash function throughout the 1990s and 2000s and remains widely recognized today, even though its security properties have been broken.
The most legitimate and common use of MD5 today is verifying that a downloaded file was not corrupted during transfer. Operating system ISO images, software packages, and archive files are often distributed alongside an MD5 checksum.
After downloading, you compute the MD5 of the file locally and compare it to the published checksum. If they match, the file arrived intact.
# On macOS
md5 ubuntu-24.04-desktop-amd64.iso
# On Linux
md5sum ubuntu-24.04-desktop-amd64.iso
Important: MD5 checksums protect against accidental corruption, not against a malicious attacker who has compromised the download server. For tamper-proof verification, use a cryptographic signature (GPG) instead.
MD5 is fast and produces a short, fixed-size fingerprint of any data. This makes it useful for:
In these non-security contexts, MD5's broken collision resistance is usually acceptable because you are not defending against an attacker.
Older databases, APIs, and software systems may still use MD5 for checksums, session IDs, or ETags. You will encounter MD5 when maintaining or integrating with these systems even if you would choose something else for a greenfield project.
This is the most important section of this article. MD5 is completely unsuitable for password storage. Here is why:
In 2004, researchers demonstrated practical MD5 collision attacks — the ability to craft two different inputs that produce the same MD5 hash. This breaks the collision-resistance property entirely.
A modern GPU can compute billions of MD5 hashes per second. If an attacker steals your database and sees MD5-hashed passwords, they can run a brute-force dictionary attack at enormous speed. Common passwords fall in milliseconds.
Pre-computed tables of MD5 hashes for billions of common strings (rainbow tables) are freely available online. A simple SELECT * FROM rainbow_table WHERE hash = '5f4dcc3b5aa765d61d8327deb882cf99' reveals that the password was "password" — instantly, no computation required.
Adding a salt (random string appended to the password before hashing) defeats rainbow tables but does not solve the speed problem. An attacker with a GPU farm can still brute-force salted MD5 hashes at scale.
Use a password hashing algorithm specifically designed to be slow and memory-intensive:
| Algorithm | Notes |
|---|---|
| bcrypt | Industry standard since 1999, configurable work factor, widely supported |
| scrypt | Memory-hard, good for servers with constrained parallelism |
| Argon2id | Winner of the Password Hashing Competition (2015), recommended for new projects |
| PBKDF2 | NIST-recommended, used in many standards (FIPS, PKCS#5) |
All of these algorithms are intentionally slow and memory-hungry, making large-scale brute-force attacks economically infeasible.
For uses where cryptographic security matters (digital signatures, TLS certificates, HMAC):
| Property | MD5 | SHA-256 | bcrypt (passwords) |
|---|---|---|---|
| Output size | 128 bits | 256 bits | 60-char string |
| Speed (GPU) | ~10 billion/s | ~2 billion/s | ~10,000/s |
| Collision attacks | Yes (broken) | None known | N/A |
| Good for files | Yes | Better | No |
| Good for passwords | Never | Never | Yes |
Generate MD5 checksums for text or verify data integrity with the devtools.apz.me MD5 Hash Generator — runs entirely in your browser with no data sent to any server.
Free, browser-based tools - no sign-up required, and tool inputs stay in your browser.