Skip to content
ansezz.

▸ Free tool

SHA Hash Generator.

Paste text or pick a file — get SHA-1, SHA-256, SHA-384, and SHA-512 side by side. It runs on the Web Crypto API in your browser; nothing is uploaded.

▸ No MD5 — on purpose

The Web Crypto API does not implement MD5, because MD5 collisions take seconds to produce. If you need it for a legacy checksum, run md5sum locally.

Output format

Ready

▸ Digests

  • SHA-1 · 160 bits

    Collision-broken. Checksums and dedupe only — never signatures.

  • SHA-256 · 256 bits

    The default. Use this unless you have a specific reason not to.

  • SHA-384 · 384 bits

    SHA-512 truncated — immune to length-extension. Used by SRI and TLS.

  • SHA-512 · 512 bits

    Same design as SHA-256 on 64-bit words. Faster on 64-bit CPUs.

All four digests computed locally · nothing leaves this page

Hashing, encoding, encryption

A hash is a one-way fingerprint. Feed SHA-256 a single byte, a novel, or a 4 GB disk image and you get exactly 256 bits back. Flip one bit of input and roughly half the output bits change. There is no key, and there is no way back — the input is almost always longer than the digest, so the information is simply not in there anymore.

Encoding — base64, hex, URL-escaping — is reversible by design and holds no secret at all; it exists to move bytes through channels that only accept text. Encryption is reversible with a key; it exists to keep bytes private. The three get conflated constantly, usually in the sentence "how do I decrypt this hash".

  Hashing Encoding Encryption
Reversible? No — one-way Yes, trivially Yes, with the key
Needs a key
Output size Fixed (160–512 bits) Grows with input Grows with input
What it buys you Integrity, fingerprinting Safe transport Confidentiality
Examples SHA-256, BLAKE3 Base64, hex, URL-encode AES-GCM, ChaCha20

How this page computes it

Text goes through TextEncoder, which emits UTF-8 bytes — so an emoji or an accented character is hashed as its UTF-8 encoding, exactly the way shasum would treat the same file. A file is read with File.arrayBuffer() and handed to crypto.subtle.digest() untouched: no re-encoding, no line-ending normalisation. Both paths hit the browser's native implementation — the same code that verifies TLS certificates — not a JavaScript reimplementation of the algorithm.

Two consequences worth knowing. digest() returns a promise, so results arrive asynchronously and a stale run is discarded if you keep typing. And crypto.subtle only exists in a secure context — HTTPS or localhost — so on plain HTTP this page tells you instead of quietly producing nothing.

The most common "the checksum doesn't match" bug is not a bug: shasum file.txt hashes the exact bytes on disk, trailing newline included. Paste the same text into a textarea without that newline and you get a different digest. One byte is all it takes.

SHA-1: dead for signatures, fine for checksums

SHA-1 is still on this page because "broken" is not one thing. The 2017 SHAttered result produced two different PDFs with the same SHA-1 digest; by 2020 a chosen-prefix collision was demonstrated for a five-figure cloud bill. Collisions are practical. Preimages — given a digest, find an input that produces it — are not, and are not close.

So the rule is about who controls the input. If an attacker can influence the bytes being hashed and a trust decision hangs on the result, SHA-1 is out: TLS certificates, code signing, document signing, anything wearing a "verified" badge. If you are hashing your own artefacts for a cache key, a dedupe check, or bit-rot detection, SHA-1 is fine and fast. Git is the canonical example — it uses SHA-1, shipped collision detection in 2.13, and has been migrating to SHA-256 ever since.

Never hash a password with plain SHA

Speed is the whole point of SHA and the whole disaster of password storage. One modern GPU tests billions of SHA-256 guesses per second, so a leaked table of SHA-256 password hashes is a wordlist with extra steps.

Salting is necessary but not sufficient. A unique random salt per user kills rainbow tables and stops two people with the same password sharing a digest — but it does not make any individual guess more expensive. What does that is a purpose-built key derivation function with a tunable cost: argon2id (memory-hard, first choice), then scrypt or bcrypt. You raise the cost factor as hardware gets cheaper. Hash::make() in Laravel, password_hash() in PHP, the argon2 or bcrypt packages in Node — all of them already do this correctly. Do not reach past them for a raw SHA call.

Same class of mistake: do not authenticate a message with sha256(secret + message). SHA-1 and SHA-256 are Merkle–Damgård constructions and leak enough internal state for a length-extension attack, letting someone append data and forge a valid tag without ever knowing the secret. Use HMAC-SHA-256 — or SHA-384, which is truncated and therefore not extendable.

Verifying a downloaded file

Drop the file into the box above and read the SHA-256 row, or do it from a terminal and compare — hex comparison is case-insensitive, so only the characters matter:

checksum
# macOS / Linux
shasum -a 256 ubuntu.iso

# Windows (cmd)
certutil -hashfile ubuntu.iso SHA256

# Windows (PowerShell)
Get-FileHash ubuntu.iso -Algorithm SHA256

Know the limit of that check. It proves your copy matches the checksum you were shown. If the mirror and the checksum page were compromised together, they agree with each other and you have learned nothing. That is why distributions publish a signed SHA256SUMS file and ask you to verify it with GPG: the hash proves integrity, the signature proves origin. Two different jobs, two different tools.

Questions, answered.

Is this SHA hash generator safe for sensitive data?

Yes. Your input is never sent anywhere — hashing runs locally through crypto.subtle.digest(), the browser's own Web Crypto implementation. There is no server call, no analytics, and no logging. Open DevTools and watch the network tab stay empty while you type.

Why is there no MD5 option?

Because the Web Crypto API deliberately does not implement MD5. MD5 has been collision-broken since 2004, and today two different files with the same MD5 can be produced in seconds on a laptop, so browsers refuse to offer it at all. Any online MD5 tool is shipping its own JavaScript implementation. If a legacy system forces MD5 on you, use md5sum locally and treat the result as a non-security identifier.

Can a SHA-256 hash be decrypted or reversed?

No. A hash is not encryption: there is no key and no inverse function, and the digest is a fixed 256 bits no matter how big the input was. Sites that advertise SHA-256 decryption are simply looking your digest up in a table of precomputed hashes of common strings. That works for password123 and never for a random 32-byte secret.

Should I use SHA-256 to store passwords?

No. SHA-256 is designed to be fast, and a single commodity GPU tests billions of candidates per second against it. Use a deliberately slow, memory-hard password hash instead — argon2id first, then scrypt or bcrypt — with a unique salt per user and a work factor you raise as hardware improves. That is Hash::make() in Laravel, password_hash() in PHP, and the argon2 or bcrypt packages in Node.

What is the difference between SHA-256 and SHA-512?

They are the same SHA-2 design at different word sizes: SHA-256 operates on 32-bit words and SHA-512 on 64-bit words, which makes SHA-512 noticeably faster on 64-bit CPUs despite the longer digest. SHA-384 is SHA-512 truncated to 384 bits, which also makes it immune to the length-extension trick that affects SHA-1 and SHA-256. For interoperability, SHA-256 remains the safe default.

How do I verify a file checksum with this tool?

Pick the file with the file input, wait for the digest, then compare the SHA-256 row against the checksum the publisher published — hex comparison is case-insensitive, so only the characters matter. The file is read locally with File.arrayBuffer(), so nothing is uploaded. Remember that a matching checksum only proves your copy matches the value you were shown; if the download mirror and the checksum page were both compromised, they agree and you learn nothing, which is why distributions sign their checksum file with GPG.

Keep going

Keep reading