MD2 Hash Generator
Generate the MD2 hash of any text instantly in your browser. UTF-8, hex or Base64 input; hex or Base64 output. Free, private, no upload.
Runs entirely in your browser. Your data is never uploaded.
What is MD2 Hash Generator?
MD2 is a 128-bit message digest designed by Ron Rivest in 1989 for 8-bit machines and specified in RFC 1319. This tool computes the 128-bit MD2 digest of text or raw bytes (hex or Base64) as you type and shows it as 32 hex characters or Base64.
How to use MD2 Hash Generator
- Type or paste your input into Text to hash — the digest updates as you type (an empty box shows the hash of empty input).
- Choose the Input encoding: Text (UTF-8) hashes the characters as UTF-8, Hex bytes or Base64 hash the decoded raw bytes.
- Pick the Output format (hex lowercase, hex uppercase or Base64) and click Copy.
Example
abc
da853b0d3f88d99b30283a69e6ded6bb
MD2 of the 3 ASCII bytes "abc" (UTF-8, hex lowercase output), the standard test vector.
When to use MD2 Hash Generator
Use the MD2 text tool to hash strings: reproduce a value from documentation or code, build test vectors, compare an API signature input, or check what a program should output. Do not use it to protect anything against attackers — it is cryptographically broken. Do not use it to check a downloaded file: copying file contents into a text box changes line endings and encoding, so use the MD2 file checksum tool. For anything new use SHA-256 or SHA3-256.
How MD2 Hash Generator works
MD2 pads the message to a multiple of 16 bytes (each padding byte equals the number of padding bytes), appends a 16-byte checksum computed with a substitution table derived from the digits of pi, and then processes every 16-byte block through 18 rounds over a 48-byte state using the same S-box. The first 16 bytes of the state are the 128-bit digest. It is byte-oriented and very slow compared with modern hashes. The text is first converted to bytes (UTF-8 by default), so the same characters always give the same hash.
Common Use Cases
- Check the expected MD2 of a string in a unit test or fixture
- Hash hex bytes copied from a debugger, packet capture or protocol spec
- Compare MD2 output between two programming languages that disagree
- Generate deterministic identifiers or cache keys from text
- Reproduce legacy MD2 values stored by an old system
Security Note
MD2 is obsolete and insecure. Preimage and collision attacks are known (RFC 6149 moved MD2 to Historic status). Use it only to reproduce or check values from legacy systems such as old X.509 certificates; never for signatures, passwords or integrity against an attacker. Plain hashes are also not suitable for storing passwords: use a slow, salted password hash such as Argon2, scrypt or bcrypt. Everything is computed locally in your browser; nothing you type is sent anywhere.
FAQs
Why would anyone still use MD2?
Mainly to verify old data: some legacy X.509 certificates and PKCS#1 signatures from the 1990s used md2WithRSAEncryption. Reproducing those values is the only realistic use today.
Is MD2 the same as MD4 or MD5?
No. They share the 128-bit output size and the designer, but MD2 uses a completely different byte-oriented construction with a pi-based S-box. The same input gives unrelated digests: abc is da853b0d… in MD2 and 900150983c… in MD5.
Why does the hash change completely when I change one character?
That is the avalanche effect every cryptographic hash is designed for: flipping one input bit changes about half of the 128 output bits, so similar inputs give unrelated digests.
Does a trailing space or newline matter?
Yes. The hash covers every byte, so abc and abc followed by a newline give different MD2 values. Make sure the input contains exactly the bytes you intend to hash.