How to use the hash generator
- Type or paste text into the left pane. Every hash updates as you type.
- Choose an Algorithm: All shows MD5, SHA-1, SHA-256, SHA-384 and SHA-512 side by side. Picking a single algorithm returns just the digest, which is handy for copying.
- Choose the Output encoding: Hex (the common form) or Base64 (used by Subresource Integrity and many HTTP headers).
- Turn on Uppercase hex if the system you compare against prints capitals.
- Enter an HMAC key to compute HMAC-SHA-1/256/384/512 instead of plain hashes.
Example
For the classic test sentence The quick brown fox jumps over the lazy dog (43 bytes):
MD5 9e107d9d372bb6826bd81d3542a419d6
SHA-1 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
SHA-256 d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
abc with SHA-256 and Base64 output gives ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=.
HMAC for webhooks and API signatures
An HMAC combines a secret key with the message, so only someone who knows the key can produce the same value. Stripe, GitHub, Slack and most payment gateways sign webhook bodies this way. To debug a signature mismatch, paste the exact raw request body, enter the shared secret as HMAC key, pick SHA-256, and compare the result with the signature header. Check whether the provider sends hex or Base64.
With key Jefe and message what do ya want for nothing? (RFC 4231 test case 2), HMAC-SHA-256 is 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843. HMAC-MD5 is not supported: choose a SHA algorithm when a key is set.
Hex, Base64 and case
A digest is just bytes, so the same SHA-256 value can be written as 64 hex characters or 44 Base64 characters. Hex is case-insensitive: ABC123 and abc123 are the same digest, so compare hashes after normalizing case. Base64 is case-sensitive and must be compared exactly.
Algorithm cheat sheet
| Algorithm | Digest size | Use today |
|---|---|---|
| MD5 | 128 bits | Legacy checksums and cache keys only |
| SHA-1 | 160 bits | Legacy (Git object IDs, old APIs); collisions are practical |
| SHA-256 | 256 bits | Default choice for integrity and signatures |
| SHA-384 | 384 bits | TLS suites, Subresource Integrity |
| SHA-512 | 512 bits | Largest digest; can be faster than SHA-256 on 64-bit CPUs without SHA extensions |
Why two hashes don’t match
- Invisible characters. The tool hashes exactly what is in the input box, including a trailing line break.
abcgives SHA-256ba7816bf…, whileabcfollowed by a newline givesedeaaff3…. In a terminal,echoadds a newline andprintf '%s'doesn’t. - Re-serialized JSON. Webhook signatures cover the raw bytes of the body. Pretty-printing the body, even in the JSON Formatter, changes those bytes and therefore the HMAC. Hash the body exactly as received.
- Encoding. One side prints hex and the other Base64, or the other system encoded the text as something other than UTF-8.
Plain SHA-256 is not a password hash: it is fast, which makes guessing cheap. Store passwords with a slow algorithm such as Argon2id or bcrypt. To create random secrets or HMAC keys, use the Password Generator.
Hashing in code
// Browser / Node.js — Web Crypto
const buf = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(text));
const hex = [...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, '0')).join('');
import hashlib, hmac
hashlib.sha256(text.encode("utf-8")).hexdigest()
hmac.new(key.encode(), body, hashlib.sha256).hexdigest()
printf '%s' 'abc' | shasum -a 256
printf '%s' 'abc' | openssl dgst -sha256 -hmac 'secret'
For encoding digests or keys, see Base64. To inspect HMAC-signed tokens, use the JWT Decoder.
Frequently asked questions
Is my text sent to a server to be hashed?
No. SHA hashes and HMACs are computed with the browser's built-in Web Crypto API and MD5 with a local implementation. Nothing is uploaded.
Which algorithm should I use?
Use SHA-256 for checksums, content addressing and signatures, and SHA-512 or SHA-384 if a spec requires them. MD5 and SHA-1 are cryptographically broken: fine for detecting accidental changes or matching legacy systems, but never for security.
Can I use this to hash passwords?
No. Fast hashes like SHA-256 let attackers test billions of guesses per second. Store passwords with a slow, salted algorithm designed for the job, such as Argon2id, scrypt or bcrypt, using your framework's password library.
Why doesn't my hash match the one from my terminal?
Usually because of invisible differences in the input. echo adds a trailing newline (use printf or echo -n), editors may add a final newline or use CRLF line endings, and the tool hashes the text as UTF-8 bytes. Make sure both sides hash exactly the same bytes.
Can it hash files?
It hashes text. Opening or dropping a file loads it as text, which works for text files but alters binary files such as images or archives. For binary files, use shasum -a 256 file or certutil -hashfile file SHA256 instead.
Last updated