Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text.
How to use the Hash Generator
- Type or paste the text to hash.
- Press Generate hashes to get the MD5, SHA-1, SHA-256, SHA-384, and SHA-512 digests at once.
- Tick Uppercase output if you're comparing against a hash printed in capitals, then copy the one you need.
About the Hash Generator
A hash function takes text of any length and produces a fixed-length string of characters — the hash — that acts as a fingerprint of the input. Changing even a single character in the input produces a completely different hash, which makes hashes useful for verifying that data hasn't been altered, comparing values without storing the originals, or generating consistent short identifiers.
This tool computes five common hash algorithms — MD5, SHA-1, SHA-256, SHA-384, and SHA-512 — from any text you enter, all at once, entirely in your browser using the Web Crypto API (and a local MD5 implementation, since MD5 isn't part of that API). Nothing you type is sent anywhere.
Worked example
Example: hashing the text "hello" produces the SHA-256 value 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 — anyone who hashes the exact same text will get that exact same value, which is what makes hashes useful for verification.
What the output lengths tell you
Each algorithm always produces the same length of output, written as hexadecimal digits: MD5 gives 32 characters, SHA-1 gives 40, SHA-256 gives 64, SHA-384 gives 96, and SHA-512 gives 128. That's a quick way to recognize which algorithm produced a hash you've been given. Your text is converted to UTF-8 bytes before hashing, which matches what most programming languages and command-line tools do.
Why your hash doesn't match another tool
A hash changes completely if even one byte differs, and the most common invisible difference is a trailing newline. On the command line, echo "hello" | sha256sum hashes 'hello' followed by a line break, so it won't match the value for 'hello' here. Use echo -n or printf instead. Other usual suspects are a trailing space, different line endings (Windows uses carriage return plus line feed), and smart quotes pasted from a word processor.
Common uses
- Verifying a download: compare the SHA-256 checksum the publisher lists against one computed from the file with a command-line tool such as sha256sum, shasum -a 256, or PowerShell's Get-FileHash. This page hashes text, not files.
- Cache keys and deduplication: hashing content gives a short, consistent key, and MD5 is still fine here because no attacker is involved.
- Comparing values without exposing them: two parties can confirm they hold the same text by comparing hashes.
- Not for passwords: use bcrypt, scrypt, or Argon2, which are deliberately slow and salted.
Frequently asked questions
- Is MD5 or SHA-1 safe to use for passwords?
- No. Both MD5 and SHA-1 are considered cryptographically broken for security purposes — they're fast to compute, which makes them practical to brute-force, and both have known collision vulnerabilities. They're still fine for non-security uses like checksums or cache keys, but passwords should use a slow, purpose-built algorithm like bcrypt or Argon2, not a raw hash from this tool.
- Which algorithm should I use?
- For anything security-related (verifying file integrity from an untrusted source, digital signatures), use SHA-256 or stronger — it's the current industry standard. MD5 and SHA-1 remain common for quick checksums or matching legacy systems, but shouldn't be relied on where collision resistance actually matters.
- Can a hash be reversed back to the original text?
- Not by design — hashing is a one-way function, so there's no mathematical way to recover the input from the hash alone. In practice, short or predictable inputs (like common passwords) can still be found via lookup tables or brute force, which is exactly why raw hashes are unsuitable for password storage.
- Why do different algorithms produce different-length output?
- Each algorithm is designed around a fixed internal state size: MD5 and SHA-1 produce 128-bit and 160-bit hashes respectively, while SHA-256, SHA-384, and SHA-512 produce 256, 384, and 512-bit hashes. Longer hashes generally offer stronger collision resistance.