Hash generator: MD5, SHA-1, SHA-256 and SHA-512 for text and files
A hash function turns any input into a fixed-length hexadecimal digest: MD5 gives 32 hex characters, SHA-1 gives 40, SHA-256 gives 64 and SHA-512 gives 128. The same input always produces the same digest and a one-character change produces a completely different one, which is why hashes are used to verify downloads and detect tampering. MD5 and SHA-1 are broken for security purposes but still common for checksums. This tool hashes text and files locally in your browser and can compare the result against an expected checksum.
Your files never leave your device. Processing happens in your browser. How that works.
How it works
- Paste text or drop a file.
- Read all digests at once, or pick the ones you need.
- Paste an expected checksum to verify it matches.
Runs as JavaScript inside this tab. Turn off your connection after the page loads and it still works.
Hash algorithms reference
| Algorithm | Output | Hex length | Year | Status |
|---|---|---|---|---|
| MD5 | 128 bits | 32 | 1992 | Broken. Collisions can be made in seconds. Use only to match legacy checksums. |
| SHA-1 | 160 bits | 40 | 1995 | Broken for collisions (SHAttered, 2017). Being phased out of git and TLS. |
| SHA-256 | 256 bits | 64 | 2001 | Secure. The default for checksums, signatures, blockchains. |
| SHA-384 | 384 bits | 96 | 2001 | Secure. Truncated SHA-512, immune to length-extension attacks. |
| SHA-512 | 512 bits | 128 | 2001 | Secure. Faster than SHA-256 on 64-bit hardware. |
Not offered here: SHA-3 / Keccak, BLAKE2/3 (not in Web Crypto yet), and CRC32 (an error-detecting code, not a hash).
Properties of a cryptographic hash
- Deterministic: same input, same digest, on any machine.
- Fixed length: a 1-byte file and a 10 GB file both give 64 hex characters with SHA-256.
- Avalanche: changing one bit changes about half the output bits.
- One-way: there is no practical way to recover the input from the digest.
- Collision-resistant: it should be infeasible to find two inputs with the same digest. MD5 and SHA-1 fail this.
What hashes are for
| Task | Use |
|---|---|
| Verify a download | Compare the published SHA-256 with the digest of your file. |
| Detect changes | Store a digest; recompute later. |
| Deduplicate | Files with equal SHA-256 are identical. |
| Content addressing | git (SHA-1 → SHA-256), IPFS, Docker image digests. |
| Message authentication | HMAC with a secret key (below). |
What hashes are not for: passwords
A plain SHA-256 of a password can be brute-forced at billions of guesses per second. Passwords must be hashed with a slow, salted, memory-hard algorithm: Argon2id (preferred), scrypt or bcrypt. Never store or compare raw SHA digests of passwords.
HMAC
HMAC(key, message) mixes a secret key into the hash so only holders of the key can produce or verify the digest. It is how webhooks (Stripe, GitHub, Slack) sign payloads and how JWTs with HS256 are signed. Enter a key above to compute HMAC-SHA-256 and friends. HMAC-MD5 is omitted.
Checking downloads on the command line
sha256sum file.iso # Linux
shasum -a 256 file.iso # macOS
Get-FileHash file.iso # PowerShell (SHA-256 by default)
certutil -hashfile file.iso SHA256 # Windows cmd
Worked digests
| Input | MD5 | SHA-256 |
|---|---|---|
| (empty) | d41d8cd98f00b204e9800998ecf8427e |
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
abc |
900150983cd24fb0d6963f7d28e17f72 |
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
hello |
5d41402abc4b2a76b9719d911017c592 |
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
Worked examples
“hello”
| Algorithm | Digest |
|---|---|
| MD5 | 5d41402abc4b2a76b9719d911017c592 |
| SHA-1 | aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
| SHA-256 | 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
“Hello” (capital H) → SHA-256 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969. One bit of input changed; the digest shares nothing with the one above.
Verifying a download
A project publishes SHA256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 for its installer. Click Hash a file…, choose the installer, paste the published value into Verify a checksum. A green ✓ means the file is byte-for-byte what was published; a red ✗ means it was altered or corrupted in transit.
HMAC for a webhook
Key whsec_test and body {"id":"evt_1"} produce an HMAC-SHA-256 you can compare with the signature header your webhook received. Both sides must hash the exact raw body bytes, so avoid re-serialising the JSON first.
Large files
A 2 GB file hashes in your browser in a few seconds using the Web Crypto API; nothing is uploaded and memory use stays flat because the file is read once into the hasher.
Frequently asked questions
Which hash should I use?
SHA-256 for anything security-related. MD5 or SHA-1 only when matching a checksum that was published in that format.
Can a hash be reversed?
No. Hashing is one-way. Short or common inputs can be guessed by trying candidates, which is why passwords must be hashed with a slow, salted algorithm rather than plain SHA-256.
Why is MD5 considered insecure?
Researchers can create two different files with the same MD5 digest (a collision), so it cannot prove a file is untampered. It remains fine for detecting accidental corruption.
Does hashing a large file upload it?
No. The file is read in chunks and hashed in your browser with the Web Crypto API.
Hash generator · last updated · changelog · part of Canned Tuna