MD2 Hash Generator
HG-28Type or paste text to get its MD2 hash: 128 bits, shown as 32 hex characters. Use it to match a value from a legacy system, not for anything new.
Runs in your browser. Nothing is uploaded.
Text (hashed as UTF-8)
MD2 hash
How to use it
- Type or paste your text into the input box. Sample loads the quick brown fox sentence.
- The MD2 hash appears as you type.
- Choose lowercase hex, UPPERCASE hex or Base64 for the output.
- Tick Ignore one trailing line break if your text ends with a newline you do not want hashed.
- Copy the result, or download it as a .txt file.
What MD2 is
MD2 is a 128-bit hash published in RFC 1319 in 1992 by Ron Rivest. It works on 16-byte blocks, adds a checksum block, and mixes the data with a fixed table of byte values derived from the digits of pi. Web Crypto in browsers does not offer it, so this page carries its own implementation and checks it against the RFC's test suite: the empty string gives 8350e5a3e24c153df2275c9f80692773 and "abc" gives da853b0d3f88d99b30283a69e6ded6bb.
When it is the right tool
MD2 is obsolete and slow, and weaknesses in it are published, so it should not protect anything. You meet it when an old certificate, an archive format or a legacy system records an MD2 value and you need to compare against it. For new work pick SHA-256 or SHA-512. The text is hashed as UTF-8 exactly as typed, so a trailing space or line break changes the result, and it hashes text rather than files.
Questions people ask
How do I generate an MD2 hash online?
Type or paste your text into the box and the MD2 hash appears straight away. Choose lowercase hex, uppercase hex or Base64, then copy the result or download it as a .txt file. It is computed in your browser.
How long is an MD2 hash?
An MD2 hash is 128 bits, or 16 bytes. In hex that is 32 characters, and in Base64 it is 24 characters including two padding signs. The length does not depend on the size of the text.
What is the MD2 hash of an empty string?
It is 8350e5a3e24c153df2275c9f80692773 in hex. Leave the box empty and this page returns that value, which is the one given in the RFC 1319 test suite.
Is MD2 secure?
No. It is considered broken for security use, and it is also slow compared with modern hashes. Treat it as a way to compare against legacy values only. For integrity checks or signatures, use SHA-256 or stronger.
Why does my MD2 hash differ from another tool's?
Usually the text differs: a trailing line break, different line endings, or a different encoding. This page hashes the text as UTF-8 exactly as typed. Tick Ignore one trailing line break to match a value made from the text without its final newline.
About this tool
MD2 is the 128-bit hash from RFC 1319, written out in this page's own code because Web Crypto does not offer it, and checked against the RFC's test suite. It is old and weak: it is slow, collisions and preimage shortcuts are known, and it should not be used for anything new. Use it only to match an existing value from a legacy system. The text is hashed exactly as typed, as UTF-8 (a lone surrogate half becomes U+FFFD first), so a trailing line break or a space changes the result; "Ignore one trailing line break" removes one. It hashes text, not files.