Hash Calculator & SHA-256 Generator
Calculate MD5, SHA-1, SHA-256, SHA-384, SHA-512 and HMAC all at once. Verify file checksums by drag-drop. Compare any two hashes. 100% in your browser — nothing uploaded.
Text Hashing
File Hash & Checksum Verifier
Compare Hashes
Copy as Code
Get a code snippet to reproduce the same hash in your stack. Uses the text from the Text Hashing input above.
How to use
- Text Hashing: type or paste any text. All five hash algorithms update live. Toggle between hex and base64 output. Add an HMAC key to compute message authentication codes.
- File Hash: drag any file onto the drop zone (or click to browse). The tool reads the file locally and computes checksums — nothing is uploaded. Compare the output to the checksum published by the software vendor.
- Compare: paste two hashes into the comparison boxes to check equality. The comparison is case-insensitive and ignores leading/trailing whitespace.
- Copy as Code: select an algorithm and language to get a ready-to-paste code snippet for computing the same hash in your own codebase.
Frequently asked questions
Why doesn't Web Crypto support MD5?
The Web Cryptography API intentionally omits MD5 because it is cryptographically broken — collisions (two inputs with the same hash) can be generated in under a second. MD5 should not be used for security: passwords, signatures, or validating untrusted files. This tool includes a self-contained MD5 implementation for the only remaining valid use case: verifying legacy checksums published alongside downloads from trusted sources (and labeled broken throughout the UI).
What's the difference between a hash and an HMAC?
A hash (SHA-256, etc.) produces a deterministic digest of input bytes. Anyone can compute it — including an attacker substituting a different input with the same hash. An HMAC mixes a secret key into the computation, so only parties with the key can produce or verify the correct value. Use HMAC for API authentication (GitHub webhooks, AWS request signing), JWT HS256 tokens, and anywhere you need to prove a message came from a trusted party and wasn't altered.
Is SHA-256 the same as SHA-2?
SHA-256 is one member of the SHA-2 family. SHA-2 encompasses SHA-224, SHA-256, SHA-384, and SHA-512 — all using the same Merkle-Damgård construction with different output sizes. SHA-256 (32-byte output) is the most widely deployed: Bitcoin proof-of-work, TLS certificate fingerprinting, code-signing, and package verification all use it as a default. SHA-512 has a 64-byte output and is faster on 64-bit CPUs for long inputs.
Are my hashes computed in the browser or sent to a server?
100% in your browser. Open DevTools → Network and use any feature — you will see zero tool-generated outbound requests. SHA-1/256/384/512 use the browser's built-in crypto.subtle.digest() API. HMAC uses crypto.subtle.sign(). MD5 runs via an inline JavaScript implementation in this page. Files are read with the FileReader API — not uploaded. The source is on GitHub if you want to verify.
What's the safest hash function in 2026?
For general data integrity: SHA-256 is the safe default. SHA-512 is equally secure, slightly faster on 64-bit hardware for large inputs. For new architectures: SHA-3 (Keccak) uses a sponge construction that is immune to length-extension attacks without needing HMAC. Avoid MD5 (broken) and SHA-1 (SHAttered collision, 2019). For passwords: never use any plain hash — use Argon2id, bcrypt, or scrypt, which are designed to be slow and include mandatory salts.
How do I verify a downloaded file's checksum?
Drag the file into the File Hash section and compare the SHA-256 output to the checksum the software vendor published on their releases page. They must match character-for-character. You can also use the Compare section: paste the vendor's hash into box A and copy the tool's output into box B — it checks equality case-insensitively. On the command line: Linux: sha256sum file.tar.gz | macOS: shasum -a 256 file.dmg | Windows PowerShell: Get-FileHash file.zip -Algorithm SHA256.
What's the difference between hex and base64 output?
Both encode the same raw bytes. Hex uses 2 characters per byte (0–9, a–f), so SHA-256 output is 64 hex characters. Base64 uses 4 characters per 3 bytes, so SHA-256 output is 44 base64 characters. Hex is standard for checksums, git hashes, and TLS fingerprints. Base64 is common in HTTP headers and JWTs. JWTs specifically use base64url, a variant that replaces + with - and / with _ to be URL-safe.
Why does a 1-byte change produce a totally different hash? (avalanche effect)
This is the avalanche effect, a formal security requirement: each input bit should influence roughly half the output bits. SHA-256's compression function chains bitwise rotations, XOR operations, and modular additions so that a single flipped bit propagates through all 256 output bits within a few rounds. The result looks completely uncorrelated to the original hash. This property means you cannot learn anything about how similar two inputs are by comparing their SHA-256 digests.
Can two different inputs produce the same hash? (collisions)
In theory yes — this is called a collision, unavoidable because infinitely many inputs map to a finite digest. The question is how hard it is to find one deliberately. MD5 collisions: under 1 second. SHA-1: a chosen-prefix collision (SHA-mbles) was published in 2019. SHA-256: no collision has ever been found. A birthday attack would require roughly 2128 operations — more than all energy the sun will ever produce.
What's HMAC and when should I use it instead of plain hashing?
Use HMAC when you need to authenticate a message — prove it came from a party with the shared key and was not tampered with. Plain hashing provides no authentication: anyone can compute SHA-256(anything). HMAC also prevents length-extension attacks: an attacker who sees H(key||msg) cannot compute H(key||msg||extra) without the key, unlike raw SHA-2. Typical uses: GitHub webhook X-Hub-Signature-256, AWS Signature V4, JWT HS256.
Examples
Verify a Linux ISO download
The distro publishes: SHA256SUMS alongside the ISO. Drag the ISO into File Hash, select SHA-256, and compare to the published value. A single character mismatch = corrupted or tampered download.
Expected (from vendor site): 3b5f3c7d... Computed (plato·hash, File Hash tab): 3b5f3c7d... ← must match exactly
Verify a GitHub webhook (HMAC-SHA-256)
GitHub signs every webhook payload with HMAC-SHA-256 using your secret. Paste the raw payload body and your webhook secret to reproduce the signature.
// Node.js server-side equivalent
const sig = crypto.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
// Must match X-Hub-Signature-256: sha256=<sig>
Detect file changes (content-addressed cache)
Hash a config file with SHA-256. Store the digest. Re-hash later and compare — if the digest changes, the file changed. This is how git tracks objects internally.
# Git uses SHA-1 historically (transitioning to SHA-256) git cat-file -p HEAD # shows tree hash # Each blob hash is SHA-1 of "blob <size>\0<content>"
About hash functions and HMAC
A cryptographic hash function takes an arbitrary-length input and produces a fixed-length digest. Three properties define a secure hash: pre-image resistance (you cannot recover the input from the hash), second pre-image resistance (given an input, you cannot find a different one with the same hash), and collision resistance (you cannot find any two inputs with the same hash). These properties make hashes the foundation of code signing, file integrity, and digital certificates.
MD5 (128-bit) was designed in 1991 and is now cryptographically broken — collisions are found in milliseconds. SHA-1 (160-bit) was broken in 2017 when researchers published SHAttered, a practical chosen-prefix collision using two different PDF files. SHA-1 is deprecated in all modern TLS implementations. SHA-256 and SHA-512 (from the SHA-2 family, standardized by NIST in 2001) are the current standards. No SHA-2 collision has ever been found. SHA-256 is the default for TLS certificates, package signing, Docker content trust, and Bitcoin proof-of-work. SHA-512 has the same security margin with a larger output and slightly faster throughput on 64-bit hardware for long inputs.
HMAC (Hash-based Message Authentication Code) adds a shared secret key to a hash computation: HMAC(K, m) = H((K XOR opad) || H((K XOR ipad) || m)). The double-hashing construction is immune to length-extension attacks — a vulnerability in raw SHA-2 where an attacker who knows H(key || msg) can extend the hash without knowing the key. HMAC is used in GitHub webhook signature verification (X-Hub-Signature-256), AWS Signature Version 4, and JWT HS256 tokens. Use HMAC-SHA-256 as your default; it is fast, well-understood, and supported natively in every language runtime.
File checksum verification is the most common practical use: download software, compare its SHA-256 to the publisher's signed checksum. A single character difference means the file is corrupted or was tampered with in transit. This tool computes file hashes entirely in-browser using the FileReader API — the file bytes never leave your machine. You can verify this claim by opening DevTools → Network while dropping a large file: you will see zero outbound requests generated by the tool. The SHA algorithms use crypto.subtle, the browser's built-in cryptographic API, and MD5 uses a self-contained JavaScript implementation of RFC 1321.