Skip to content

MD5 Hash Generator

Updated:

Enter any text and instantly get its 128-bit MD5 hash as a 32-character hexadecimal string. Useful for checksums, file verification, and data integrity checks.

Generate an MD5 Hash

Input Fields
If enabled, the result will update automatically when you change any value.

MD5 Hash Formula

Formula
\[ \text{MD5}(M): \text{pad } M \text{ to a multiple of 512 bits, then run 64 rounds of mixing on each 512-bit block} \\ F(x, y, z) = (x \land y) \lor (\lnot x \land z) \\ G(x, y, z) = (x \land z) \lor (y \land \lnot z) \\ H(x, y, z) = x \oplus y \oplus z \\ I(x, y, z) = y \oplus (x \lor \lnot z) \]

Where:

  • \(M\) — the input message, first converted to UTF-8 bytes
  • \(F, G, H, I\) — the four Boolean auxiliary functions used in the four rounds of MD5
  • \(\land, \lor, \lnot, \oplus\) — bitwise AND, OR, NOT and XOR

The message is padded so its length becomes a multiple of 512 bits, with the original bit length appended. The algorithm then processes each 512-bit block in 64 steps, mixing the block's data into four 32-bit registers initialized to the constants \(A = \texttt{67452301}\), \(B = \texttt{efcdab89}\), \(C = \texttt{98badcfe}\), \(D = \texttt{10325476}\). The final values of the four registers, written in little-endian order, form the 128-bit digest.

MD5 Hash – Calculation Example

Example: the text Hello world! is hashed with MD5.

\[ \text{MD5}(\texttt{Hello world!}) = \texttt{86fb269d190d2c85f6e04e8f79d3d8a5} \]

Result: the 32-character hexadecimal MD5 hash 86fb269d190d2c85f6e04e8f79d3d8a5.

How to Use the MD5 Hash Generator

  1. Type or paste your text into the Text to Hash field. You can enter any characters, including line breaks and non-Latin scripts.
  2. The calculator processes the text in your browser and displays the result in the MD5 Hash box under Hash Result.
  3. Copy the 32-character hexadecimal string and use it wherever you need the hash — a checksum, a lookup key, or a comparison value.
  4. To hash different text, simply replace the input; the hash updates automatically.

What Is an MD5 Hash?

MD5 (Message-Digest Algorithm 5) is a cryptographic hash function designed by Ronald Rivest in 1991 and defined in RFC 1321. It takes an input of any length and produces a fixed 128-bit (16-byte) fingerprint, usually written as 32 hexadecimal characters. The same input always produces the same hash, while even a tiny change in the input — adding a space, changing a letter's case — produces a completely different digest.

The key property of a hash function is that it works in one direction only: computing the hash from the text is fast, but reconstructing the text from the hash is computationally infeasible. This makes MD5 useful for verifying data integrity: if two texts (or files) have the same MD5 hash, they are almost certainly identical, and if the hashes differ, the texts are definitely different.

Common uses include checksums for downloaded files, duplicate detection, cache keys, and non-critical fingerprinting of database records. Because the output is short and fixed-size, MD5 is also convenient as an index or lookup key. If you need to inspect the bytes behind the hash, the digits are simply hexadecimal values — the same format handled by our Hex Converter.

Limitations and Practical Tips

  • Not safe for passwords. MD5 is too fast and too well-studied for password storage. Modern password hashing requires deliberately slow algorithms such as bcrypt, scrypt or Argon2, with salts.
  • Collision attacks exist. Researchers have shown how to construct two different inputs with the same MD5 hash. For security-critical signatures and certificates, use SHA-256 or stronger instead.
  • Fine for checksums and deduplication. For accidental corruption checks, duplicate detection and non-adversarial fingerprinting, MD5 remains perfectly practical and widely supported.
  • Input encoding matters. This calculator hashes the UTF-8 encoding of your text. The same text encoded differently (for example, as Base64 or with URL escaping from the URL Encoder) will produce a different hash.
  • Trailing whitespace counts. A trailing space or newline changes the hash entirely, so be careful when pasting text; the Character Counter can help you verify the exact input length.
  • Everything runs locally. The hashing is performed in your browser; your text is never uploaded to a server.

Frequently Asked Questions

How do I compute an MD5 hash from the command line?

On Linux and macOS run md5sum filename or md5 -s "your text" respectively. On Windows PowerShell, use Get-FileHash -Algorithm MD5 filename. The output is the same 32-character hexadecimal string this calculator produces, so you can cross-check results. Remember that command-line tools hash the raw bytes of a file, so text files with different encodings or line endings (CRLF vs LF) will produce different hashes.

What is the MD5 hash of an empty string?

The empty string is a valid MD5 input, and its hash is the well-known value d41d8cd98f00b204e9800998ecf8427e. This calculator requires non-empty input, but if you ever see this hash in a database or checksum file, it almost always means the input was empty — for example, a zero-byte file. It is not an error code; it is simply MD5 of nothing.

Can an MD5 hash be reversed or decrypted?

No. MD5 is a one-way function: there is no algorithm to run backwards from the 128-bit digest to the original input. What people call "MD5 decryption" websites actually use huge precomputed tables (rainbow tables) of common inputs. Any text not in such a database cannot be recovered. Also, because infinitely many inputs share each hash value, even a matching candidate may not be your original text.

Why does the same text give a different MD5 hash in another tool?

The most common causes are encoding and invisible characters. This calculator hashes UTF-8 bytes; a tool using Latin-1, UTF-16, or Base64 input will produce a different digest. Trailing spaces, newlines, or Windows line endings (CRLF) added during copy-paste also change the result completely. Compare the exact byte length of your input in both tools — if the byte counts differ, the hashes must differ.

Is MD5 still safe to use in 2025?

It depends on the purpose. MD5 is not safe for password storage, digital signatures, TLS certificates, or anything an attacker can deliberately manipulate — collision attacks are practical and fast. It remains acceptable for non-adversarial tasks: checking files for accidental corruption, deduplicating data, and generating cache keys. For any security-sensitive use, choose SHA-256 or SHA-3 instead.

How likely is an accidental MD5 collision?

Accidental collisions are effectively impossible. With 128-bit output, you would need to hash about 264 (roughly 18 quintillion) random inputs before a collision becomes likely — far beyond everyday data volumes. The collisions that make headlines are deliberately crafted pairs exploiting MD5's mathematical weaknesses, not random ones. So for detecting accidental file corruption or duplicates, a matching MD5 hash is a reliable identity signal.

What is the difference between MD5, SHA-1, and SHA-256?

All three are cryptographic hash functions, differing mainly in output size and security. MD5 produces 128 bits, SHA-1 produces 160 bits, and SHA-256 produces 256 bits. Both MD5 and SHA-1 are considered cryptographically broken for adversarial use; SHA-256 is the current standard for security applications. For simple checksums, MD5's shorter 32-character output is more compact and faster to compare, which is why it is still widely used for non-security purposes.

Leave a Reply

Your email address will not be published. Required fields are marked *