How to use
- Type or paste text, switch the input to hex bytes, or open a file to hash its exact bytes.
- Leave Text encoding on UTF-8 unless the original hash was made from text in another character set.
- Under Output as, choose lowercase hex, uppercase hex or Base64.
- To check a download, paste the published MD5 into the Compare with field and look for Match.
What is MD5?
MD5 (Message-Digest Algorithm 5) was designed by Ronald Rivest and published in 1992 as RFC 1321. It reads its input in 512-bit blocks and produces a 128-bit digest, usually written as 32 hexadecimal characters or 24 Base64 characters. The same input always gives the same digest, and changing a single bit of the input changes about half of the output bits.
Hashing is one-way: there is no key and no way to "decrypt" an MD5 hash back into the input. Sites that claim to reverse MD5 look the hash up in huge tables of hashed words and leaked passwords, which is why the unsalted MD5 of a short password is often found in seconds.
Is MD5 still secure?
Not against an attacker. Xiaoyun Wang and her colleagues published practical collisions in 2004: two different inputs with the same MD5. Chosen-prefix collisions followed: researchers used one to create a rogue CA certificate in 2008, and in 2012 the Flame malware used one to forge a certificate that made its code appear to be signed by Microsoft. Today an ordinary laptop finds an MD5 collision in seconds, and RFC 6151 states that MD5 is no longer acceptable where collision resistance is required, such as digital signatures.
MD5 is still fine as a checksum against accidental damage, such as an incomplete download or a flipped bit on disk, and for cache keys or deduplicating trusted data. When the file or its checksum could come from an attacker, use SHA-256 instead.
Hex, Base64 and mismatched hashes
MD5 is normally printed as hex, which is what md5sum outputs. Some protocols send the raw 16 bytes in Base64 instead, for example the HTTP Content-MD5 header used by cloud storage APIs such as Amazon S3. Choose Base64 output, or convert an existing value with Hex to Base64.
If your MD5 differs from another tool's, the input bytes differ. The usual causes are a trailing newline, Windows line endings, or another text encoding: "café" is 5 bytes in UTF-8 but 4 bytes in ISO-8859-1, so the two hashes have nothing in common.
$ echo "hello" | md5sum # hashes "hello\n"
b1946ac92492d2347c6235b4d2611184 -
$ printf 'hello' | md5sum # hashes "hello"
5d41402abc4b2a76b9719d911017c592 -
MD5 on the command line and in code
md5sum file.iso # Linux
md5 file.iso # macOS
certutil -hashfile file.iso MD5 # Windows
Get-FileHash file.iso -Algorithm MD5 # PowerShell
# Python
import hashlib
hashlib.md5('hello'.encode('utf-8')).hexdigest()
// Node.js
require('crypto').createHash('md5').update('hello', 'utf8').digest('hex')
The Web Crypto API built into browsers does not include MD5, so this page computes it in JavaScript on your device; nothing is uploaded. The table of all algorithms under the result shows SHA-1, SHA-256, SHA-384, SHA-512, CRC-32 and CRC-32C for the same input.
Examples
| Input (UTF-8) | MD5 |
|---|---|
Hello, World! | 65a8e27d8879283831b664bd8b7f0ad4 |
Base64.is | 2e3c0e8b828164a8db7f62146ca87e14 |
你好 | 7eca689f0d3389d9dea66ae112e5cfd7 |
Frequently asked questions
Can an MD5 hash be decrypted?
Is MD5 good enough to verify a download?
It reliably detects accidental corruption. Because collisions are cheap, though, someone who prepares a file in advance can make a second, different file with the same MD5. For security-relevant downloads, check a SHA-256 hash from a trusted source or a signature.
How long is an MD5 hash?
==. A 32-character hex string could also be MD4 or an NTLM hash; the Hash Identifier lists the candidates.Can I get the MD5 of a large file?
md5sum or certutil.