MD5 Hash Generator
Generate MD5 hash from any text
Input Text
MD5 Hash
MD5 hash will appear here…
What Is MD5 Hashing?
MD5 (Message-Digest Algorithm 5) is a cryptographic hash function that produces a fixed 128-bit (16-byte) digest from any input, regardless of its size. Published in 1992 by Ronald Rivest as RFC 1321, MD5 was designed as a faster successor to MD4 and quickly became one of the most widely used hash functions on the internet. The algorithm processes input in 512-bit blocks through four rounds of 16 operations each, using a different nonlinear function per round, to produce a 32-character hexadecimal fingerprint.
A hash function is a one-way transformation: given an input, you can compute the hash instantly, but given only the hash, you cannot recover the original input. Even a single-bit change in the input produces a completely different digest — a property called the avalanche effect. MD5 maps an infinite input space to a fixed 128-bit output space, so collisions (two different inputs producing the same hash) are mathematically guaranteed to exist, but a secure hash function makes finding them computationally infeasible.
Since 2004, researchers have demonstrated practical collision attacks against MD5, meaning it is no longer considered secure for digital signatures, certificates, or any context where collision resistance is required. However, MD5 remains widely used for non-security purposes: verifying file integrity after downloads, generating cache keys, deduplicating content, and creating deterministic identifiers from strings. For these applications, the algorithm's speed and ubiquitous library support make it a practical choice. In 2008, Marc Stevens and colleagues published a chosen-prefix collision attack, meaning an attacker can craft two documents with arbitrary chosen prefixes that share the same digest. This technique was demonstrated at the 2008 Chaos Communication Congress by constructing a rogue Certification Authority certificate. The 2012 Flame malware subsequently exploited chosen-prefix collisions to forge a Microsoft code-signing certificate, allowing malware to masquerade as a legitimate Windows Update package. These real-world exploits confirmed that the algorithm is cryptographically broken for any trust-anchored use and should not be relied upon where an adversary can influence the inputs being hashed.
Why Use This MD5 Generator?
Generate MD5 hashes instantly without installing anything or writing code. Paste your text and get the 32-character hex digest in real time.
MD5 Use Cases
MD5 vs Other Hash Algorithms
MD5 is the fastest and shortest of the common hash algorithms, but it offers the weakest security guarantees. The table below compares digest sizes, standards, and appropriate use cases for each algorithm.
| Algorithm | Digest Size | Hex Length | Standard | Best For |
|---|---|---|---|---|
| MD5 | 128 bits | 32 hex chars | 1992 / RFC 1321 | Checksums, non-security fingerprints |
| SHA-1 | 160 bits | 40 hex chars | 1995 / RFC 3174 | Legacy git commits (being replaced) |
| SHA-256 | 256 bits | 64 hex chars | 2001 / FIPS 180-4 | TLS certificates, blockchain, JWTs |
| SHA-384 | 384 bits | 96 hex chars | 2001 / FIPS 180-4 | Government systems, higher security margin |
| SHA-512 | 512 bits | 128 hex chars | 2001 / FIPS 180-4 | Digital signatures, HMAC with large keys |
| SHA-3 | 256 bits | 64 hex chars | 2015 / FIPS 202 | Post-quantum readiness, backup standard |
| BLAKE3 | 256 bits | 64 hex chars | 2020 | High-performance checksums, Merkle trees |
How MD5 Works
MD5 processes input through a Merkle-Damgard construction: the message is padded to a multiple of 512 bits, split into blocks, and each block is fed through four rounds of 16 bitwise operations that mix the input with precomputed sine-derived constants. The result is a 128-bit state that becomes the final digest.
Each round applies a distinct nonlinear auxiliary function to three of the four 32-bit state words (A, B, C, D). Round 1 uses F(B,C,D) = (B AND C) OR (NOT B AND D) — a bitwise conditional selector. Round 2 uses G(B,C,D) = (B AND D) OR (C AND NOT D) — a complementary selector. Round 3 uses H(B,C,D) = B XOR C XOR D — a parity function. Round 4 uses I(B,C,D) = C XOR (B OR NOT D) — an asymmetric combiner. These four functions ensure every bit of the input influences the output digest, producing the avalanche effect that makes small input changes cause large, unpredictable changes to the resulting hash.
MD5: 5eb63bbbe01eeed093cb22bb8f5acdc3
(128 bits = 16 bytes = 32 hex characters)
The algorithm proceeds in five stages: (1) append a 1-bit, then zeros, until the message length is 448 mod 512; (2) append the original message length as a 64-bit little-endian integer; (3) initialize four 32-bit state variables (A, B, C, D) with fixed constants; (4) process each 512-bit block through 64 operations using four nonlinear functions (F, G, H, I), one per round of 16 operations; (5) add the resulting state to the running total and output the final 128-bit hash in little-endian byte order.
Code Examples
How to generate MD5 hashes in popular languages and environments. Note that MD5 is not available in the browser Web Crypto API — use a library or Node.js.
// MD5 is not available in Web Crypto API (it only supports SHA-*)
// Use a library like 'js-md5' or the Node.js crypto module
// Node.js (built-in crypto)
const crypto = require('crypto')
const hash = crypto.createHash('md5').update('hello world').digest('hex')
console.log(hash) // → "5eb63bbbe01eeed093cb22bb8f5acdc3"
// With Unicode input
crypto.createHash('md5').update('cafe\u0301').digest('hex')
// → "4fad076bae205e95bec9dacea498e2ab"import hashlib
# Basic MD5 hash
result = hashlib.md5(b'hello world').hexdigest()
print(result) # → "5eb63bbbe01eeed093cb22bb8f5acdc3"
# Hash a string (must encode to bytes first)
text = 'hello world'
hashlib.md5(text.encode('utf-8')).hexdigest()
# → "5eb63bbbe01eeed093cb22bb8f5acdc3"
# Hash a file
with open('file.bin', 'rb') as f:
md5 = hashlib.md5()
for chunk in iter(lambda: f.read(8192), b''):
md5.update(chunk)
print(md5.hexdigest())package main
import (
"crypto/md5"
"fmt"
)
func main() {
data := []byte("hello world")
hash := md5.Sum(data)
fmt.Printf("%x\n", hash)
// → 5eb63bbbe01eeed093cb22bb8f5acdc3
}# Using md5sum (Linux) or md5 (macOS) echo -n "hello world" | md5sum # → 5eb63bbbe01eeed093cb22bb8f5acdc3 - # macOS echo -n "hello world" | md5 # → 5eb63bbbe01eeed093cb22bb8f5acdc3 # Hash a file md5sum package.json # → a1b2c3d4e5f6... package.json # Using openssl (cross-platform) echo -n "hello world" | openssl md5 # → MD5(stdin)= 5eb63bbbe01eeed093cb22bb8f5acdc3