MD5 Hash Calculator
MD5 (Message-Digest Algorithm 5) generates a 128-bit (16-byte) hash value, typically represented as a 32-character hexadecimal string. Hash text, files, Hex, or Base64 input and verify checksums locally in your browser.
Drag and drop a file here or click to select
What is MD5?
MD5 (Message-Digest Algorithm 5) is a cryptographic hash function developed by Ronald Rivest and published in 1992. It converts data of any length into a fixed-size 128-bit hash value, also known as a message digest or checksum.
MD5 was designed to help verify data integrity by detecting changes in digital information. Even a small change to the input typically produces a completely different hash value.
For example, MD5 can be used to compare files or detect accidental data corruption during downloads and transfers.
However, MD5 is no longer considered cryptographically secure because practical collision attacks have been demonstrated. It should not be used for password storage, digital signatures or other security-sensitive applications.
How long is an MD5 hash?
An MD5 hash is always 128 bits (16 bytes) long, regardless of the size of the input data. It is typically represented as a 32-character hexadecimal string.
For example, the MD5 hash of hello is: 5d41402abc4b2a76b9719d911017c592
Whether the input is a single word or a large document, the resulting MD5 hash always has the same length.
MD5 is deterministic, meaning identical input data always produces the same hash value. However, different inputs can sometimes produce identical hashes, a situation known as a collision.
How does MD5 work?
MD5 processes input data through a series of mathematical operations to generate a fixed-length hash value.
The algorithm works in four main stages:
- Prepare the input: The data is converted into bytes and padded to meet the algorithm's requirements.
- Divide into blocks: The prepared data is divided into 512-bit blocks.
- Process the blocks: Each block is processed through four rounds of calculations, totaling 64 operations.
- Generate the hash: The final result is a 128-bit hash value, usually displayed as 32 hexadecimal characters.
MD5 is a one-way hash function, not an encryption algorithm. It does not provide a way to decrypt the hash and recover the original input.
What is MD5 used for?
Despite its cryptographic weaknesses, MD5 remains useful for non-security purposes, particularly for detecting accidental changes in data.
Common MD5 use cases include:
- File integrity checks: Detecting accidental file corruption during downloads, transfers or storage.
- Duplicate file detection: Identifying files that may contain identical data by comparing their hashes.
- Data comparison: Checking whether data has changed without comparing every byte directly.
- Legacy system compatibility: Working with older applications and protocols that still use MD5 checksums.
Is MD5 secure?
No. MD5 is no longer considered secure for cryptographic applications because it is vulnerable to practical collision attacks.
A collision occurs when two different inputs produce the same hash value. Researchers have demonstrated methods for deliberately creating MD5 collisions, making the algorithm unsuitable for applications that depend on collision resistance.
MD5 should not be used for:
- Password storage: MD5 is too fast, allowing attackers to test large numbers of password guesses.
- Digital signatures: Collision attacks can undermine the integrity guarantees required by digital signatures.
- Security-sensitive file verification: An attacker may be able to create different files with identical MD5 hashes.
For modern applications, SHA-256 provides much stronger collision resistance. For password storage, use a dedicated password-hashing algorithm such as Argon2id, scrypt or bcrypt.
MD5 can still be useful for detecting accidental data corruption where protection against malicious tampering is not required.
MD5 vs SHA-256
MD5 and SHA-256 are both cryptographic hash functions, but they differ in hash length and security.
| Feature | MD5 | SHA-256 |
|---|---|---|
| Hash length | 128 bits | 256 bits |
| Hexadecimal characters | 32 | 64 |
| Collision resistance | Broken | No practical collision attacks known |
| Security-sensitive applications | Not recommended | Suitable when used correctly |
| Password storage | Not recommended | Not recommended without a dedicated password-hashing scheme |
| Common use cases | Legacy checksums, accidental corruption detection | Data integrity, digital signatures, modern cryptographic applications |
SHA-256 is the recommended alternative to MD5 when collision resistance is important. Its larger hash output and stronger security properties make it suitable for modern cryptographic applications.
Use our SHA-256 hash calculator to generate SHA-256 hashes online.
Frequently asked questions
Can MD5 be reversed?
No. MD5 is a one-way hash function, not an encryption algorithm. The original input cannot be directly recovered from its hash. However, attackers can guess common inputs and compare their hashes with known MD5 values.
Is MD5 encryption?
No. Encryption allows authorized users to recover the original data using a key. MD5 is a one-way hash function that produces a fixed-length digest without a decryption mechanism.
Does the same text always produce the same MD5 hash?
Yes. MD5 is deterministic, so identical input bytes always produce the same hash. Small differences, such as changes in capitalization or extra spaces, typically produce completely different hash values.
How to generate an MD5 hash online
- Type or paste text into the Input text field. The MD5 hash updates as you type.
- To hash raw bytes instead of text, change Input type to Hex or Base64.
- To hash a file, drag it into the file drop zone or click the zone to choose a file.
- Select Copy MD5 hash to copy the 32-character hexadecimal result. Uppercase output and Base64 output change the format.
- To compare with a published checksum, turn on Verify hash and paste the expected MD5 hash.
Text is encoded as UTF-8 before hashing. Hashes are calculated locally in your browser, and your input is not saved.
Verifying a download
- Drop the downloaded file into the file drop zone.
- Turn on the Verify hash switch below the MD5 hash.
- Paste the MD5 checksum published by the provider into Expected hash. Upper or lower case, spaces, and whole lines from a checksum file such as
<hash> file.isoare accepted. - A green ✅ Hashes match message confirms the file matches the published hash. A red ❌ Hashes do not match means the file differs from the published one, so download it again from the official source.
Security note: Always obtain the expected checksum from a trusted source. A matching hash does not prove that a downloaded file is safe or authentic if the checksum itself has been compromised. MD5 is also vulnerable to collision attacks, so a match rules out accidental corruption but not deliberate tampering. If the provider also publishes a SHA-256 checksum, verify that instead with the SHA-256 hash calculator.
MD5 test example
Use these values to check this calculator or any other MD5 tool. Select Try to load an example into the calculator above.
| Input | Input type | MD5 hash | Try |
|---|---|---|---|
hello | Text | 5d41402abc4b2a76b9719d911017c592 | |
68656c6c6f | Hex | 5d41402abc4b2a76b9719d911017c592 | |
aGVsbG8= | Base64 | 5d41402abc4b2a76b9719d911017c592 | |
Hello | Text | 8b1a9953c4611296a827abf8c47804d7 | |
hello followed by Enter | Text | b1946ac92492d2347c6235b4d2611184 | |
hello 😀 | Text | e32c825fab671c652d9e88fbd289aab8 | |
68656c6c6f20f09f9880 | Hex | e32c825fab671c652d9e88fbd289aab8 |
The first three rows are the same five bytes written as text, Hex, and Base64, so they produce the same hash. A single uppercase letter or a trailing newline produces a completely different hash. The last two rows show the UTF-8 conversion: the 😀 emoji is 4 bytes (f0 9f 98 80).
Calculate MD5 in the command line
MD5 checksums can be calculated using built-in tools on Linux, macOS, and Windows. For text input, hello without a trailing newline produces the MD5 hash 5d41402abc4b2a76b9719d911017c592.
Linux
# Hash a file
md5sum file.iso
# Check files against a published checksum file
md5sum -c MD5SUMS --ignore-missing
# Hash text without a trailing newline
printf 'hello' | md5sum
macOS
# Hash a file
md5 file.iso
# Hash text without a trailing newline
printf 'hello' | md5
Windows
# PowerShell
Get-FileHash file.iso -Algorithm MD5
# Command Prompt
certutil -hashfile file.iso MD5
PowerShell prints the hash in uppercase. Hex hashes are not case-sensitive, so you can paste it into Verify hash as it is.
Python
import hashlib
# Text
print(hashlib.md5('hello'.encode('utf-8')).hexdigest())
# File (Python 3.11+)
with open('file.iso', 'rb') as f:
print(hashlib.file_digest(f, 'md5').hexdigest())
Related tool
- SHA-256 hash calculator — Generate SHA-256 hashes for modern cryptographic applications and secure integrity verification.
Last updated: