About the Hash Generator
This hash generator produces MD5, SHA-1 and SHA-256 digests of whatever text you type, computing all three at once so you can compare a checksum against whichever algorithm the source used. Output is lowercase hexadecimal by default, with a toggle for uppercase since some tools print digests in capitals. The implementations are plain JavaScript running on your device, so your input is never transmitted — worth knowing before you hash anything sensitive. Read the security note carefully: two of these three algorithms are comprehensively broken for security purposes and are included only for checksums, deduplication and legacy compatibility.
How to use the Hash Generator
- 1
Type or paste your text into the 'Text to hash' box.
- 2
Read all three digests — MD5, SHA-1 and SHA-256 — which recompute on every keystroke.
- 3
Tick 'Uppercase output' if you are comparing against a tool that prints hexadecimal in capitals.
- 4
Copy the digest you need using the button beside it.
- 5
Check the security note before using MD5 or SHA-1 for anything beyond an integrity check.
What people use it for
Verifying a downloaded file's checksum
Projects publish a digest alongside a release so you can confirm the download was not corrupted in transit or truncated by a flaky mirror.
Generating a Gravatar URL
Gravatar keys avatars on the MD5 hash of a lowercased, trimmed email address, one of the few places MD5 is still the required input rather than a legacy choice.
Producing a stable cache key
Hashing a canonical string gives a fixed-length key for a cache entry or a filename, with no risk of illegal characters or path length limits.
Deduplicating records
Hash the concatenated fields of each record and compare digests to find duplicates far faster than comparing the full text of every pair.
Collision resistance, and why MD5 and SHA-1 no longer have it
A cryptographic hash is expected to provide three properties. Preimage resistance means that given a digest you cannot find an input that produces it. Second preimage resistance means that given one input you cannot find a different input with the same digest. Collision resistance means you cannot find any two distinct inputs sharing a digest, and it is the weakest of the three to attack because the birthday bound puts the generic cost at roughly 2^(n/2) rather than 2^n. MD5, with its 128-bit output, fell first: Wang and Yu demonstrated practical collisions in 2004, and chosen-prefix collisions now take seconds on ordinary hardware, which is how the Flame malware forged a Microsoft code-signing certificate in 2012. SHA-1, at 160 bits, was broken in practice by the SHAttered attack in 2017, which produced two different PDF files with the same digest, and a chosen-prefix collision followed in 2020 at a cost of tens of thousands of pounds of cloud compute. Notably neither is broken for preimages, which is why checking an MD5 checksum against accidental corruption remains meaningful even though it offers no protection against a deliberate attacker.
Why none of these algorithms should hash a password
SHA-256 is not broken and remains the sensible default for integrity checks, HMACs and digital signatures. It is still the wrong tool for passwords, for a reason unrelated to its cryptographic strength: it is fast by design. A modern GPU computes billions of SHA-256 hashes per second, so a stolen database of unsalted SHA-256 password digests falls to a dictionary or brute-force attack quickly, and identical passwords produce identical digests, revealing which accounts share one. Password hashing needs a function that is deliberately slow and hard to parallelise, with a per-user random salt stored alongside the digest and a work factor you can raise as hardware improves. Argon2id is the current OWASP recommendation and won the 2015 Password Hashing Competition; bcrypt and scrypt remain acceptable, and PBKDF2 with a high iteration count is the choice where a certified primitive is mandated. Digest lengths, incidentally, are fixed by the algorithm: 32 hexadecimal characters for MD5, 40 for SHA-1 and 64 for SHA-256.
Tips
- Hex digests are case-insensitive as values, so the same digest in capitals and in lowercase represents the identical hash.
- Hashing is exact: one trailing newline or space changes the whole digest, so trim carefully before comparing checksums.
- For message authentication use HMAC-SHA-256 with a secret key rather than hashing the secret and the message concatenated together.