Hash Generator
Hash text or files with SHA and HMAC, locally.
- Local by default
- No signup
- AI is opt-in
Encoding is UTF-8. Line endings are hashed exactly as entered.
Algorithms
SHA-1 is included for legacy checksums only. It is not collision-resistant.
Digest
Compute SHA-1, SHA-256, SHA-384 or SHA-512 digests for text or files without sending anything anywhere. Add a secret to switch to HMAC, and paste an expected digest to check integrity in the same view.
A hash is a one-way fingerprint
A cryptographic hash maps any input to a fixed-length output. The same input always produces the same digest, a tiny change produces a completely different digest, and there is no practical way to go back from the digest to the input. That last property is why hashing is not encryption: there is no key and no decryption step.
Digests are used for integrity, not secrecy. Publishing a SHA-256 checksum of a download lets anyone verify that the bytes arrived intact, because an attacker who changes the file cannot produce the same digest without a collision.
Which SHA should you use
- SHA-256 is the sensible default: widely supported, fast enough, and no known practical collision.
- SHA-384 and SHA-512 are from the same family and produce longer digests. Use them when a protocol or vendor specifies them, not because longer sounds safer.
- SHA-1 is included only to check legacy values. Practical collisions were demonstrated in 2017, and certificate authorities stopped accepting it years ago. Do not use it for signatures or new designs.
- MD5 is deliberately absent. It is broken for collision resistance and should not appear in new code, even for checksums.
None of these algorithms is suitable for storing passwords. A fast hash lets an attacker test billions of guesses per second. Password storage needs a deliberately slow, salted algorithm such as Argon2id, scrypt or bcrypt.
HMAC is a keyed hash
HMAC combines a secret key with the message before hashing, so a digest can only be produced or verified by someone who knows the key. It is the standard way to sign webhook payloads and API requests: the sender computes an HMAC over the body, the receiver recomputes it with the shared secret, and a mismatch means the request was altered or forged.
A plain hash cannot do that job. Anyone can compute SHA-256 of a public payload, so an attacker can change the body and recompute the digest. Without a secret, the checksum proves only that the bytes are intact, not who produced them.
The secret is a real secret. Use a random value with enough entropy, keep it out of client-side code, and compare signatures with a constant-time function in production rather than a simple string equality.
Hashing text versus files
Text is encoded as UTF-8 before hashing, so the bytes hashed are the UTF-8 bytes, not the JavaScript string. That detail matters at boundaries: if a system hashes UTF-16 or Latin-1, the digests will not match even though the visible text is identical.
Line endings matter for the same reason. A file saved with CRLF hashes differently from the same content saved with LF. When comparing checksums, confirm that both sides hashed the same bytes. Some release pipelines normalise line endings before publishing a checksum, which makes text files verify consistently across platforms.
File input uses the browser File API and Web Crypto. The file is read into memory and hashed locally; nothing is uploaded. Very large files are limited by tab memory, which is usually fine for installers and archives up to a few hundred megabytes.
Verifying a download safely
- Compare the full digest, not the first few characters. Casing does not matter for verification, but truncation does.
- Get the expected checksum from a separate channel when possible. A checksum served from the same compromised host proves little.
- If the values differ, the file is corrupt or was modified. Download it again before looking for a more complicated explanation.
- Remember that a matching hash proves integrity, not safety. A malicious file can ship with a matching checksum of itself.
Frequently asked questions
Is hashing the same as encryption?
No. Encryption is reversible with a key; hashing is designed to be one-way. A hash cannot be decrypted, and that is the point. If you need to recover the original value, you need encryption, not hashing.
Is SHA-1 still safe?
Not for anything that depends on collision resistance. Practical collisions exist, and SHA-1 signatures are no longer trustworthy. It remains useful only for matching existing legacy checksums, which is why it is offered here with a warning.
Why is there no MD5 option?
MD5 is broken for collision resistance and is not accepted for security purposes. Including it would invite copy-paste use in new code. If you must check a legacy MD5 value, use a dedicated tool that labels the risk.
Is my file or text uploaded?
No. Text is encoded and hashed with the Web Crypto API in your browser. Files are read with the File API and hashed locally. The page makes no upload requests.
Why does the same text give a different hash somewhere else?
The most common causes are encoding, line endings and invisible characters. Confirm that both tools hash UTF-8 bytes, that the line endings match, and that no trailing newline was added by an editor or shell command.
Can I use this to store passwords?
No. SHA-256 is fast, and fast is exactly what an attacker wants. Use a salted password hashing algorithm with a tunable cost, such as Argon2id, scrypt or bcrypt, and let a library handle it.