Home โบ Hash Generator (MD5, SHA-1, SHA-256, SHA-512)
Hash Generator (MD5, SHA-1, SHA-256, SHA-512)
Hash a file
The file is read into memory in your browser and hashed locally. Files up to a few hundred MB work on most computers.
What a hash function does
A cryptographic hash function turns input of any size into a fixed-size fingerprint. The same input always gives the same output, a one-bit change in the input changes about half of the output bits, and it is infeasible to work backwards from the hash to the input. SHA-256 of abc is always ba7816bfโฆf20015ad; SHA-256 of abd looks completely unrelated.
SHA-1 and the SHA-2 family (SHA-256/384/512) are computed with the browser's Web Crypto API (crypto.subtle.digest). Web Crypto deliberately does not include MD5, so this page ships a small, self-contained MD5 implementation (RFC 1321), checked against the official test vectors.
Which algorithm should I use?
| Algorithm | Output | Use it for |
|---|---|---|
| MD5 | 128 bits / 32 hex | Legacy checksums, ETags, cache keys. Broken for security. |
| SHA-1 | 160 bits / 40 hex | Git object IDs (older repos), legacy systems. Broken for signatures. |
| SHA-256 | 256 bits / 64 hex | The default choice: file checksums, signatures, HMAC-SHA256 API auth, blockchains. |
| SHA-384 / SHA-512 | 384 / 512 bits | Higher security margin; Subresource Integrity (sha384-โฆ); often faster than SHA-256 on 64-bit CPUs. |
HMAC: hashing with a key
HMAC combines a secret key with a hash function so that only someone holding the key can produce a valid tag. Webhooks from Stripe, GitHub and Slack, and request signing schemes like AWS Signature V4, are all based on HMAC-SHA256. Enter a key above to compute HMACs. Compare signatures in your own code with a constant-time comparison (for example crypto.timingSafeEqual in Node.js) to avoid timing attacks.
Gotchas
- Line endings: text copied on Windows may contain
\r\n. The hash of"abc\r\n"differs from"abc\n"and from"abc". - Hex vs Base64: the same digest can be written as hex (
ba78โฆ) or Base64 (ungWv48โฆ). Subresource Integrity and many APIs expect Base64. - Hashing is not encryption: you cannot "decrypt" a hash. Sites that claim to reverse MD5 simply look it up in tables of precomputed common inputs.
Frequently asked questions
How do I verify a downloaded file's SHA-256 checksum?
Select the file under 'Hash a file', copy the SHA-256 value and compare it with the checksum published by the vendor. Paste the published checksum into the 'Compare with' field and the tool tells you whether it matches. On the command line you can use sha256sum file (Linux), shasum -a 256 file (macOS) or Get-FileHash file (PowerShell).
Why is my hash different from another tool's result for the same text?
Almost always the input bytes differ: a trailing newline (echo adds one; use echo -n), Windows CRLF line endings, a different text encoding than UTF-8, or invisible whitespace. This tool hashes exactly the UTF-8 bytes of what is in the text box.
Is MD5 or SHA-1 still safe?
Not for security. Practical collision attacks exist for both, so they must not be used for signatures, certificates or password storage. They remain fine for non-adversarial uses like cache keys or detecting accidental file corruption. Use SHA-256 or better otherwise.
Can I use SHA-256 to hash passwords?
No. Fast hashes like SHA-256 let attackers test billions of guesses per second on a GPU. Store passwords with a slow, salted password hashing function such as Argon2id, scrypt or bcrypt.