MD5 Hash Generator

Generate MD5 hash from any text

Input Text

Runs locally · Safe to paste secrets

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.

Instant Hashing
Output updates as you type. No button clicks, no waiting — the MD5 digest appears character by character as you modify the input.
🔒
Privacy-First Processing
All hashing runs locally in your browser using JavaScript. Your input text never leaves your device and is never sent to any server.
📋
One-Click Copy
Copy the hash to clipboard with a single click. Toggle between lowercase and uppercase hex output to match whatever format your system expects.
🔍
No Account Required
No sign-up, no login, no usage limits. Open the page and start hashing immediately. Works on any device with a modern browser.

MD5 Use Cases

Frontend Development
Generate cache-busting hashes for static assets. Append an MD5 digest of the file content to CSS and JavaScript URLs so browsers fetch the updated version when the content changes.
Backend Engineering
Create deterministic cache keys from complex query parameters or request bodies. MD5 hashes produce compact, fixed-length keys that work well with Redis, Memcached, and CDN cache layers.
DevOps & CI/CD
Verify file integrity after transfers by comparing MD5 checksums. Many package registries and artifact repositories publish MD5 digests alongside downloads for quick verification.
QA & Testing
Compare MD5 hashes of API responses, database dumps, or configuration files to detect unexpected changes between test runs without diffing the full content.
Data Engineering
Deduplicate records in ETL pipelines by computing MD5 hashes of row content. Two rows with the same hash are candidates for deduplication, reducing storage and processing costs.
Learning & Education
Experiment with hash functions to understand one-way transformations, the avalanche effect, and why collision resistance matters for security. MD5 is the simplest widely-known hash to study.

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.

AlgorithmDigest SizeHex LengthStandardBest For
MD5128 bits32 hex chars1992 / RFC 1321Checksums, non-security fingerprints
SHA-1160 bits40 hex chars1995 / RFC 3174Legacy git commits (being replaced)
SHA-256256 bits64 hex chars2001 / FIPS 180-4TLS certificates, blockchain, JWTs
SHA-384384 bits96 hex chars2001 / FIPS 180-4Government systems, higher security margin
SHA-512512 bits128 hex chars2001 / FIPS 180-4Digital signatures, HMAC with large keys
SHA-3256 bits64 hex chars2015 / FIPS 202Post-quantum readiness, backup standard
BLAKE3256 bits64 hex chars2020High-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.

Input: "hello world"
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.

JavaScript (Web Crypto — browser & 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"
Python
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())
Go
package main

import (
    "crypto/md5"
    "fmt"
)

func main() {
    data := []byte("hello world")
    hash := md5.Sum(data)
    fmt.Printf("%x\n", hash)
    // → 5eb63bbbe01eeed093cb22bb8f5acdc3
}
CLI (Linux / macOS)
# 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

Frequently Asked Questions

Is MD5 still safe to use?
It is not safe for security-sensitive applications like digital signatures, TLS certificates, or password hashing. Practical collision attacks have been demonstrated since 2004, and chosen-prefix collision attacks are now feasible in seconds on commodity hardware. For non-security uses — checksums, cache keys, content deduplication — the algorithm remains a practical and widely supported choice.
What is the difference between MD5 and SHA-256?
The MD5 algorithm produces a 128-bit (32-hex-character) digest and is vulnerable to collision attacks. SHA-256 produces a 256-bit (64-hex-character) digest and has no known practical attacks. SHA-256 is approximately 30-40% slower than the older algorithm on the same hardware, but the additional security margin makes it the default choice for any application where integrity verification must resist adversarial tampering.
Can you reverse an MD5 hash back to the original input?
No. This hash function is one-way by design — it discards information during hashing. However, for short or common inputs, attackers can use rainbow tables (precomputed hash-to-plaintext mappings) or brute force to find the original input. This is why it should never be used for password storage. Use bcrypt, scrypt, or Argon2 instead.
Why do different tools sometimes produce different MD5 hashes for the same text?
The most common cause is encoding differences. The algorithm operates on bytes, not characters. The string 'hello' produces different hashes when encoded as UTF-8 vs. UTF-16 vs. Latin-1. Another frequent issue is trailing newlines: echo in most shells appends a newline (\n) unless you use echo -n. Always verify the exact bytes being hashed.
How long does it take to compute an MD5 hash?
The algorithm is extremely fast. On modern hardware, it processes data at 3-6 GB/s on a single CPU core. A GPU can compute billions of checksums per second. This speed is an advantage for file verification but a liability for password hashing, where slower algorithms (bcrypt, Argon2) are preferred specifically because they resist brute-force attacks.
What is an MD5 collision and why does it matter?
A collision occurs when two different inputs produce the same hash digest. In 2004, Xiaoyun Wang demonstrated the first practical collision against MD5. By 2012, the Flame malware exploited a collision to forge a Microsoft code-signing certificate. Today, identical-prefix collisions can be computed in under a minute. This makes the algorithm unsuitable for any application that relies on collision resistance, such as digital signatures or certificate pinning.
Should I use MD5 or CRC32 for file checksums?
This checksum is a better choice than CRC32 for file integrity verification. CRC32 is a 32-bit error-detecting code designed to catch accidental corruption in transmission, not intentional tampering. Its small output space means collisions are trivially easy to construct. It provides a 128-bit digest with much stronger accidental-collision resistance. For adversarial scenarios (verifying downloads from untrusted sources), use SHA-256 instead.