Hash Generator
Hash typed text or a file you drop in, get SHA-1, SHA-256, SHA-384 and SHA-512 digests at once, and compare the result with a hash someone gave you — entirely inside your browser.
1. Choose the input
Hashed as UTF-8 bytes, exactly as written — no newline is added and trailing spaces count.
The file is read locally with the File API. Nothing is uploaded and the page keeps working with the network switched off.
That file is larger than 10 MB, and the browser reads it into memory in one go, so this may take a moment. Keep the tab open until the digests appear.
2. Digests
Press Compute hashes to fill this table.
| Algorithm | Digest (hexadecimal) | Copy digest |
|---|---|---|
| SHA-1 | — | |
| SHA-256 | — | |
| SHA-384 | — | |
| SHA-512 | — |
Output sizes: SHA-1 is 160 bits (40 hex characters), SHA-256 is 256 bits (64), SHA-384 is 384 bits (96) and SHA-512 is 512 bits (128).
3. Compare with an expected hash
Case is ignored and all spaces, tabs and line breaks are stripped before comparing, so a hash copied out of a download page or an email still matches.
Paste a hash to compare it with the digests above.
How it works
A cryptographic hash function takes an input of any length — a single character, a 4 GB disk image — and returns a fixed-size string of bytes called a digest. The same input always produces the same digest, on every machine and in every implementation, and changing even one bit of the input produces a completely different, unpredictable result. That last property, usually called the avalanche effect, is what makes a digest useful as a fingerprint: nobody can quietly edit a file and keep the hash.
This page hands your input to crypto.subtle.digest(), the Web Crypto implementation that
ships with the browser. Text is converted to bytes with TextEncoder, which always emits
UTF-8 without a byte-order mark; a file is read as an ArrayBuffer through the File API,
so the digest covers the exact bytes on disk, including things an editor hides such as CRLF line
endings. Because digest() is asynchronous, the button reports a
computing… state and stays disabled until all four algorithms have finished. The result is
shown as lowercase hexadecimal — two characters per byte, which is why SHA-256 is always exactly 64
characters and SHA-512 exactly 128.
The four algorithms are members of the same SHA-2 family, standardised in NIST FIPS 180-4, plus the older SHA-1. They differ only in output size and internal word size: SHA-1 produces 160 bits, SHA-256 produces 256, and SHA-384 and SHA-512 are truncated and distinct variants of the 512-bit construction. Larger output means a larger space an attacker has to search, but for ordinary integrity checks SHA-256 already offers a comfortable margin. All four are computed here in a single pass over one input, which is handy when a download page lists several checksums and you are not sure which one you will be asked for.
What hashing does not do
The limits matter more than the mechanics, so here they are plainly. Hashing is not encryption. There is no key and no decryption step; the tool cannot reverse a hash, and no other tool can either for any input that is not trivially guessable. If you need to recover the original data, hash the wrong primitive — use encryption with a key you can manage.
- SHA-1 is no longer collision-safe. Chosen-prefix collisions have been demonstrated publicly, which means two different inputs can be crafted to produce the same SHA-1 digest. It is still adequate for spotting accidental corruption, but it must not be used for signatures, certificates or anything an adversary has an incentive to forge. MD5, the other hash you will still meet in the wild, is broken even more thoroughly and should be treated the same way.
- SHA-2 needs correct usage, not just a correct algorithm. A digest proves that two byte sequences are identical. It does not prove who produced them. If you need to know that a message came from a particular party and was not altered on the way, you need a keyed construction — HMAC, or a digital signature — rather than a bare hash.
- Fast hashes are the wrong tool for passwords. SHA-256 is designed to be quick, which is exactly what a password cracker wants. Password storage needs a salted, deliberately slow function such as Argon2id, scrypt, bcrypt or PBKDF2, with a per-user salt and a tuned work factor.
- A matching hash is not a proof of safety. Comparing a digest tells you the bytes are the same as the ones that produced the expected value. If the expected value itself came from a compromised source, or was published alongside a malicious file, the match means nothing.
- The environment has to cooperate. Web Crypto is only exposed in a secure context,
so the page needs HTTPS or a
localhostorigin. In an insecure context the tool says so instead of failing silently, and very large files are limited mainly by how much memory the browser will allocate.
Never paste a real secret — a password, an API key, a recovery phrase — into any web page you do not control. Even when the tool is honest about staying local, the browser, an extension or the clipboard can leak it later.
How to use this tool
- Pick exactly one input. Type or paste into the text box, or choose a file with the file button or by dragging it onto the dashed box. When a file is selected it takes precedence over the text, and Clear file and hash the text instead switches back.
- Press Compute hashes. All four digests appear together for the same input, so you can compare against whichever checksum a vendor published. The button is disabled while the work is running and the status line reports the size of the input.
- Copy the digest you need. Each row has its own copy button, and the
UPPERCASE toggle reformats every digest on screen and in the clipboard. Hexadecimal case is
purely cosmetic —
a3f1andA3F1are the same bytes. - Compare against a known value. Paste the expected hash into the third section. The comparison ignores spaces, tabs and line breaks and is case-insensitive, then names the algorithm that matched — or tells you that none of the four did.
- Mind the bytes, not the text. If a comparison fails unexpectedly, check the boring things first: an editor that appended a newline, a file saved as UTF-16 or with a BOM, a ZIP extracted with different line endings, or the wrong algorithm entirely.
As a quick check that everything works as advertised, hash the five characters
hello in the text box. SHA-256 gives
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 — the same value any
compatible tool will print, because the standard fixes the padding and the output, not the
implementation.
Frequently asked questions
Is hashing the same thing as encryption?
No. Encryption is a two-way operation: whoever holds the key can turn the ciphertext back into the original message. A cryptographic hash is one-way by design — a fixed-length digest computed from the input, with no key and no undo. That is why hashes are used to check integrity and to store passwords, and why they are the wrong tool when you need to read the data again later.
Which algorithm should I pick — SHA-1, SHA-256 or SHA-512?
SHA-256 is the safe default for checksums, file integrity and any new work: it is fast, widely implemented and has no known practical collision. SHA-512 is an equally good choice and can be slightly faster on 64-bit hardware. SHA-1 still matches legacy digests and old manifests, but deliberate collisions have been produced in public research, so it must not be used where an attacker benefits from forging a match — signatures, certificates or tamper detection.
Can this tool reverse or crack a hash?
No, and neither can anything else in the general case. The page computes digests forward only. What attackers actually do is guess — hashing candidate inputs until one matches, which works when the input is short, common or predictable. That is also why a fast hash such as SHA-256 is a poor way to store passwords: use a deliberately slow, salted function such as Argon2id, scrypt, bcrypt or PBKDF2 instead.
Will the digest match sha256sum, openssl or PowerShell?
It matches exactly when the other program hashes the same bytes with the same algorithm. The usual causes of a mismatch are invisible byte differences: a trailing newline added by an editor, Windows CRLF versus Unix LF line endings, or a UTF-8 file with a byte-order mark. Text here is always encoded as UTF-8 with no BOM and no added newline, and files are hashed as their raw bytes.
Sources & further reading
- MDN Web Docs — SubtleCrypto.digest() — Documents the browser API this page calls, including the asynchronous contract and the SHA-1, SHA-256, SHA-384 and SHA-512 algorithms it accepts.
- NIST — FIPS 180-4, Secure Hash Standard (SHS) — The official publication page for the standard that defines SHA-1, SHA-256, SHA-384 and SHA-512, including the message padding, block sizes and the downloadable PDF.
- OWASP — Password Storage Cheat Sheet — Explains why fast general-purpose hashes are unsuitable for passwords and gives current parameters for Argon2id, scrypt, bcrypt and PBKDF2.