SHA Hash Generator
Compute SHA-1, SHA-256, SHA-384, and SHA-512 message digests of any text. Uses the Web Crypto API — no upload, no library, no third party.
What is a hash function?
A cryptographic hash function takes an arbitrary-length input and produces a fixed-length output called a digest. Three properties matter: it is deterministic (the same input always produces the same digest), one-way (the input cannot be recovered from the digest), and collision-resistant (it should be infeasible to find two inputs with the same digest).
| Algorithm | Output (bits) | Hex chars | Status |
|---|---|---|---|
| SHA-1 | 160 | 40 | Broken for collisions; do not use for new work. |
| SHA-256 | 256 | 64 | Current default — TLS, Git, Bitcoin, JWT HS256/RS256. |
| SHA-384 | 384 | 96 | SHA-512 truncated; common in higher-security suites. |
| SHA-512 | 512 | 128 | 64-bit variant; faster on 64-bit CPUs. |
Plain hashing is not password storage. If you're hashing passwords, you need a slow, memory-hard function with a salt: bcrypt, scrypt, or Argon2 (preferred). A bare SHA-256 of a password can be cracked at billions of guesses per second on consumer GPUs.
Use cases
- Integrity checks. Verify a downloaded file matches the publisher's posted digest.
- Content addressing. Git, IPFS, and Docker layers identify content by its hash.
- HMAC. Combined with a secret key to authenticate messages (see HMAC Generator).
- Digital signatures. Sign the hash of a document rather than the document itself.
FAQ
Why no MD5?
MD5 is cryptographically broken and the Web Crypto API doesn't expose it for that reason. For non-security checksums (e.g. ETag generation) you'd use a different primitive; for cryptographic uses, pick SHA-256 or later.
Does adding more text always change the hash?
Yes. Even a single-bit change produces a completely different digest — the "avalanche effect" is a designed property of cryptographic hashes.
Why are digests shown in hex?
Convention. Hex is unambiguous, easy to copy, and case-insensitive. Some systems use Base64 instead to save characters.