| Algorithm | Digest | Copy |
|---|---|---|
| Legacy |
SHA-1 is broken for collision resistance. Use it only to stay compatible with existing systems.
About the Hash Generator
This tool computes SHA-256, SHA-384, SHA-512 and SHA-1 digests of text or a file, all at once. Turn on HMAC and enter a secret key to get keyed HMAC digests for the same four algorithms instead. Output can be hex (optionally uppercase) or Base64.
Hashing runs locally with the browser's Web Crypto API, so text and files are never uploaded. Text is encoded as UTF-8 before hashing. MD5 is not offered, and SHA-1 is marked as legacy because practical collisions exist; use it only for compatibility with existing systems.
How to use it
- Choose Text and type or paste your input, or choose File and pick a file.
- Switch the output between Hex and Base64.
- To sign data, check "HMAC with a secret key" and enter the key.
- Copy the digest you need from the table.
Examples
The text hello (5 bytes, no trailing newline):
SHA-256 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
HMAC-SHA-256 (secret) 88aab3ede8d3adf94d26ab90d3bafd4a2083070c3bcce9c014ee04a443847c0b
Common questions
Is SHA-256 reversible?
No. A hash is a one-way function; you can't recover the input from the digest. Short or common inputs can still be found by guessing.
Should I use SHA-256 to store passwords?
No. Plain SHA-256 is fast, so it is easy to brute-force. Use a password hashing function such as Argon2id, scrypt or bcrypt.
What is the difference between a hash and an HMAC?
Anyone can compute a plain hash. An HMAC (RFC 2104) mixes in a secret key, so only someone with the key can produce or check it. Webhook providers use HMAC-SHA-256 to sign payloads.
Why doesn't my digest match the command line?
echo adds a trailing newline, so echo hello | sha256sum hashes 6 bytes. Use printf 'hello' or echo -n, and check that the text encoding is UTF-8.
Related tools
- Webhook Tester & Inspector: capture a signed webhook to check its HMAC.
- Base64 & URL Encoder / Decoder: convert between Base64 and other encodings.
- Password Generator: create a strong random HMAC secret.