Paste a checksum to verify it.
Generate an MD5 hash from text or a file, and compare it against a checksum you already have. MD5 is broken for anything security related. For catching accidental corruption and for cache keys, it still works fine.
Paste a checksum to verify it.
md5("Hello World")
b10a8db164e0754105b7a99be72e3fe5 Check that a download arrived intact against a published checksum. Accidental corruption will not produce a matching hash.
Hash a long URL or query into a fixed-length key. A collision here costs a wrong cache hit, which is rare enough to ignore.
Spot identical files in a batch. When a false match would matter, confirm it by comparing the bytes.
Even salted, MD5 is far too fast: a GPU tries billions of guesses a second. Use bcrypt or Argon2, which are slow on purpose.
Chosen-prefix collisions have been practical since 2008, when researchers used one to forge a CA certificate. An attacker can make two different files share an MD5.
If someone might have changed the file on purpose, a matching MD5 proves nothing. Use SHA-256 for that check.
Check for a trailing newline first. Most editors add one when they save, so hashing a file gives a different result from hashing the text you copied out of it. The other common cause is encoding: the same accented character hashes differently as UTF-8 and as Latin-1, and PHP hashes whichever bytes the string holds.
Uploads are read with FileReader as an ArrayBuffer and hashed as raw bytes, so a file gives you exactly what
md5sum on Linux, md5 on macOS and
Get-FileHash -Algorithm MD5 on Windows report. Typed
text is encoded as UTF-8 first, which is what
md5() in PHP and hashlib.md5(s.encode())
in Python do too.
# A file
md5sum archive.tar.gz # Linux
md5 archive.tar.gz # macOS
Get-FileHash -Algorithm MD5 archive.tar.gz # PowerShell
# A string, without the trailing newline echo adds
printf '%s' 'Hello World' | md5sum
# Verify a published checksum file
md5sum -c CHECKSUMS.md5
# echo adds \n and gives a different hash. This trips people up
# constantly when comparing against a value from an application. <?php
echo md5('Hello World'), PHP_EOL;
// b10a8db164e0754105b7a99be72e3fe5
// A file, streamed rather than loaded into memory
echo md5_file('archive.tar.gz'), PHP_EOL;
// Raw binary output, when you need the 16 bytes rather than 32 hex chars
$raw = md5('Hello World', true);
// For anything security related, use one of these instead:
echo hash('sha256', 'Hello World'), PHP_EOL;
echo password_hash('secret', PASSWORD_BCRYPT), PHP_EOL; import hashlib
print(hashlib.md5(b"Hello World").hexdigest())
# b10a8db164e0754105b7a99be72e3fe5
# Text has to be encoded first, and the encoding changes the result
print(hashlib.md5("Café".encode("utf-8")).hexdigest())
# A large file, in chunks
h = hashlib.md5()
with open("archive.tar.gz", "rb") as f:
for chunk in iter(lambda: f.read(8192), b""):
h.update(chunk)
print(h.hexdigest())
# On a FIPS-enabled system md5() raises unless you pass
# usedforsecurity=False, which is a useful reminder of its status. const crypto = require("node:crypto");
const fs = require("node:fs");
console.log(crypto.createHash("md5").update("Hello World").digest("hex"));
// A file, streamed
const hash = crypto.createHash("md5");
fs.createReadStream("archive.tar.gz")
.on("data", (chunk) => hash.update(chunk))
.on("end", () => console.log(hash.digest("hex")));
// Browsers deliberately have no MD5 in the Web Crypto API.
// crypto.subtle.digest supports SHA-1, SHA-256, SHA-384 and SHA-512 only. The Web Crypto API leaves MD5 out on purpose because it is broken, so this page ships its own implementation.
MD5 was designed in 1991 and produces 128 bits. The first collisions were published in 2004; by 2008 researchers had used a chosen-prefix collision to forge a working CA certificate. Today a collision costs seconds on a laptop. None of that affects using it as a checksum against accidental corruption, which is why md5sum is still on every Linux box.
Keep one distinction in mind: MD5 tells you whether two things are probably the same. It does not tell you whether someone changed one of them on purpose. Accidental corruption will not produce a matching hash; a motivated attacker can.
This tool follows the specifications below. Read them when you need the exact normative wording, for example to settle an edge case between two implementations.
Not for anything security related. Collisions have been practical since 2004 and a laptop produces one in seconds, so do not use MD5 for signatures, certificates or password storage. It still works as a non-security checksum: cache keys, deduplication, or a quick check that a file transferred intact.
SHA-256 for integrity and signatures, bcrypt or Argon2 for passwords. Both have tools on this site.
No, a hash cannot be computed backwards. However, rainbow tables look the hash up in a precomputed list, which is why an unsalted MD5 of a common password is effectively plaintext.
Yes. Upload File reads it as raw bytes, so the result matches md5sum on Linux or Get-FileHash -Algorithm MD5 on Windows.
Nearly always a trailing newline or a different text encoding. A file ending in \n hashes differently from the same text without it, and UTF-8 differs from UTF-16 for anything outside ASCII.
For anything that has to resist tampering, use the SHA generator. For passwords, use bcrypt, and for signed webhooks the HMAC generator gives you the keyed version.