What Is MD5?

Understand how MD5 hashing works, what a 32-character digest means, why MD5 is broken for security, and what it's still safe for.

5 min read Updated Jun 2026

Quick Answer

MD5 (Message Digest 5) is a hash function that converts any input into a fixed 32-character hexadecimal string. It's fast, deterministic, and widely supported, but cryptographically broken. MD5 is unsafe for passwords: brute-force attacks can crack a leaked MD5 hash in minutes. Use it for checksums and cache keys, not for anything security-sensitive.

To generate an MD5 hash from text, paste the input into the MD5 generator and copy the 32-character result.

If you need an MD5 hash right now, use the tool directly.

Try the MD5 Hash Generator →

What Is MD5?

MD5 stands for Message Digest Algorithm 5. It was designed by Ronald Rivest in 1991 as an improvement on MD4 and formalized in RFC 1321 in 1992. The algorithm takes any input (a word, a paragraph, a binary file) and produces a 128-bit digest, displayed as 32 lowercase hexadecimal characters.

Two properties define it. First, it's deterministic: the same input always produces the same hash. Second, it has the avalanche effect: change a single bit of the input and roughly half the output bits change. The string "hello" produces 5d41402abc4b2a76b9719d911017c592. Capitalizing the H to "Hello" produces 8b1a9953c4611296a827abf8c47804d7: completely different.

MD5 was designed as a one-way function: you can compute the hash from the input, but not reconstruct the input from the hash. In practice, short or common inputs can be found via precomputed lookup tables. That limits its usefulness for anything involving secrets.

How It Works

MD5 processes input in 512-bit blocks. Before processing begins, a padding bit is appended to the message, followed by a 64-bit representation of the original message length. This brings the total length to a multiple of 512 bits.

Each 512-bit block is processed through four rounds of 16 operations. Each operation combines a word from the current block with the current hash state using a mix of bitwise AND, OR, XOR, NOT, modular addition, and bit rotations. After all blocks are processed, the four 32-bit hash state values are concatenated to produce the 128-bit final digest.

The algorithm was designed so small input changes produce large, unpredictable output changes. It was also designed to be fast, which turned out to be a security weakness, since fast hashing makes brute-force attacks cheap.

What MD5 Is Used For

MD5 is still practical in non-security contexts:

  • File integrity checksums, Download pages often list an MD5 checksum next to a file. After downloading, you compute the MD5 and compare it to the listed value. A match means the file arrived without corruption. This detects accidental damage, not deliberate tampering.
  • Cache keys: Hashing a URL, query string, or function arguments to a 32-char key is common in caching layers. Speed matters more than collision resistance here, and MD5 delivers.
  • Deduplication: Storage systems compare MD5 hashes to find duplicate files before deciding whether to store a new copy. A collision is technically possible but rare enough to be acceptable in this context.
  • Database sharding: The numeric value of an MD5 hash distributes records evenly across partitions without requiring sequential IDs.
  • Content-addressable identifiers: Naming a resource by its MD5 hash means identical content always maps to the same identifier, which simplifies diffing and syncing.

Common Mistakes

You May Also Need

Next steps

Alternatives

Continue Learning