About this tool
A hash function turns any input, from a word to a 4 GB disk image, into a short fixed-length fingerprint. Change a single bit of the input and the fingerprint changes completely. SHA-256 is the most widely used one: it secures software downloads, Git commits, TLS certificates, Bitcoin and countless APIs. This tool computes SHA-256 together with SHA-1, SHA-384 and SHA-512 for text or files, using your browser’s built-in crypto.subtle.digest(), so nothing is uploaded.
How to use it
- Choose Text and type or paste, or choose File and pick or drop a file. All four hashes update instantly.
- Pick hex (the usual checksum format, optionally uppercase) or base64.
- To check a value, paste it into Compare with expected hash. The matching algorithm lights up, so you don’t even need to know which one was used.
Verify a downloaded file’s checksum
Software sites often publish a SHA-256 checksum next to each download. If your file’s hash matches, the download is complete and hasn’t been tampered with in transit. Choose File, select the download, and paste the published checksum into the compare box. Or use your operating system’s built-in command:
Get-FileHash .\installer.exe -Algorithm SHA256certutil -hashfile installer.exe SHA256shasum -a 256 installer.dmgsha256sum installer.tar.gz
sha256sum -c SHA256SUMS # check every file listed in a checksum fileSHA-1, SHA-256, SHA-384 and SHA-512
| Algorithm | Output | Hex length | Status |
|---|---|---|---|
| SHA-1 | 160 bits | 40 | Broken for security: practical collisions since 2017. Only for legacy checks such as old Git IDs. |
| SHA-256 | 256 bits | 64 | Secure. The default choice for checksums, signatures and content addressing. |
| SHA-384 | 384 bits | 96 | Secure. Common in TLS and Subresource Integrity. |
| SHA-512 | 512 bits | 128 | Secure, and often faster than SHA-256 on 64-bit CPUs. |
MD5 isn’t offered because it’s badly broken and browsers don’t provide it.
Why doesn’t my hash match?
- A hidden newline.
echo hello | sha256sumhasheshelloplus a line break and gives5891b5b5…, while the hash ofhellois2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Useprintforecho -n. - Line endings. A file saved with Windows line endings (CRLF) has different bytes from the same file with Unix line endings (LF).
- Text encoding. This tool hashes text as UTF-8, like almost every modern system. UTF-16 or Latin-1 text gives different bytes and a different hash.
- Hex vs. Base64. The same hash looks completely different in the two encodings. The compare box accepts either.
What SHA-256 is (and isn’t) for
- Good for: file integrity checks, detecting duplicate files, cache keys, content-addressed storage, digital signatures, and hashing high-entropy secrets like API keys before storing them.
- Subresource Integrity (SRI): to pin a script from a CDN, choose File, select the script, switch the output to base64, and use
integrity="sha384-…"with the SHA-384 value. - Not for passwords. SHA-256 is designed to be fast, so attackers can test billions of guesses per second. Store passwords with bcrypt or Argon2id.
- Not for message authentication on its own. To prove who sent a message, combine the hash with a secret key using HMAC.
Generate SHA-256 hashes in code
async function sha256(text) {
const bytes = new TextEncoder().encode(text);
const digest = await crypto.subtle.digest('SHA-256', bytes);
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('');
}
await sha256('hello'); // "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"const crypto = require('node:crypto');
const fs = require('node:fs');
crypto.createHash('sha256').update('hello').digest('hex');
// Large files: stream instead of reading everything into memory
const hash = crypto.createHash('sha256');
fs.createReadStream('big.iso')
.on('data', (chunk) => hash.update(chunk))
.on('end', () => console.log(hash.digest('hex')));import hashlib
hashlib.sha256(b"hello").hexdigest()
# Large files (Python 3.11+): reads in chunks
with open("big.iso", "rb") as f:
print(hashlib.file_digest(f, "sha256").hexdigest())FAQ
How do I get the SHA-256 hash of a file?
Choose File above and pick or drop the file; it is hashed in your browser without uploading. From a terminal, use Get-FileHash on Windows, shasum -a 256 on macOS, or sha256sum on Linux.
Can a SHA-256 hash be reversed or decrypted?
No. Hashing is one-way. Short or common inputs can sometimes be found by guessing and comparing (which is why it must not be used for passwords), but the hash itself cannot be turned back into the input.
What is the SHA-256 hash of an empty string?
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. If you see this value, you probably hashed empty input by mistake.
Is SHA-1 still safe to use?
Not for security. Researchers produced two different files with the same SHA-1 hash in 2017, and attacks have only become cheaper. Use SHA-256 or stronger.
Can I use SHA-256 to store passwords?
No. SHA-256 is designed to be fast, which makes brute-forcing cheap. Use bcrypt, scrypt or Argon2 for passwords.
Why is MD5 not included?
MD5 is broken for security purposes and is not available in the Web Crypto API. Use SHA-256 for integrity checks.
Is there a file size limit?
Files up to 1 GB can be hashed. They are read into memory, so large files may be slow on low-memory devices; typical downloads hash in a second or two. For bigger files, use the command-line tools shown above.