Hash Generator
A hash function takes any input — a word, a document, a disk image — and produces a fixed-length fingerprint. Change one byte of the input and the fingerprint changes completely. This free hash generator computes MD5, SHA-1, SHA-256, and SHA-512 for text or files, lets you compare a hash against an expected value, and detects a hash's algorithm from its length. Everything runs 100% in your browser: SHA-2 uses the WebCrypto API, and nothing is ever uploaded.
Compare
100% client-side — your data never leaves this browser.
What a hash is
Hash functions have four defining properties:
| Property | Meaning |
|---|---|
| Deterministic | The same input always produces the same hash |
| Fixed size | MD5 is always 128 bits (32 hex chars); SHA-256 is always 256 bits (64 hex chars), no matter the input size |
| Avalanche effect | Flipping one input bit changes roughly half the output bits — similar inputs give unrelated hashes |
| One-way | You can't reconstruct the input from the hash (except by guessing) |
That combination is what makes hashes useful as fingerprints: tiny to store and compare, yet sensitive to the slightest change in the original data.
Common use cases
- Download verification — compare a file's SHA-256 against the checksum published by the vendor.
- Deduplication — identical hashes mean (practically) identical content; store one copy.
- Git internals — every commit, tree, and blob is addressed by its hash.
- Cache busting — filenames containing a content hash change automatically when the content changes.
- Digital signatures — sign the hash of a document rather than the whole document.
How to use it
- Tick the algorithms you want (all four by default).
- Type or paste text — digests compute live — or pick a file to hash it locally.
- Copy any digest with its copy button.
- To verify integrity, paste the expected hash into Compare: you'll get a match/mismatch verdict, plus a guess at the hash's algorithm from its length.
MD5 vs SHA-1 vs SHA-256 vs SHA-512
| Algorithm | Digest size | Status |
|---|---|---|
| MD5 | 128 bits (32 hex) | Broken — practical collisions since 2004 |
| SHA-1 | 160 bits (40 hex) | Broken — SHAttered collision in 2017 |
| SHA-256 | 256 bits (64 hex) | Secure — the current default choice |
| SHA-512 | 512 bits (128 hex) | Secure — larger digest, slightly faster on 64-bit CPUs |
For new work the answer is simple: SHA-256 unless you have a specific reason to want SHA-512's bigger digest. MD5 and SHA-1 remain in this tool because you'll still meet them in the wild — legacy checksum files, old Git repositories, etags — and you need to compute them to interoperate.
Why MD5 and SHA-1 are broken
"Broken" here has a precise meaning: attackers can construct collisions — two different inputs with the same hash. That kills the core promise of a fingerprint. The MD5 break started with theoretical weaknesses in 2004 and ended with a forged certificate authority certificate in 2008; SHA-1 fell to Google's SHAttered attack in 2017, which produced two different PDFs with identical SHA-1 hashes. Neither break lets attackers reverse a hash, but both let them substitute one file for another undetected. And one more warning that never gets old: fast hashes are not password storage — use bcrypt, scrypt, or Argon2, which are deliberately slow and salted per password.
Frequently asked questions
- What is a hash used for?
- Verifying file integrity (did this download arrive intact?), deduplicating data, checksumming releases, and fingerprinting content — Git, for example, addresses every object by its SHA-1 hash. Hashes are also the building block inside digital signatures and password storage, though both need more machinery than a bare hash.
- MD5 vs SHA-256 — which should I use?
- SHA-256 for anything new. MD5 survives only for non-security checksums — verifying a file against a legacy checksum list, for instance — where collisions don't matter. For integrity guarantees, signatures, or anything adversarial, MD5 is disqualified.
- Is MD5 secure?
- No. Researchers demonstrated practical MD5 collisions in 2004, and by 2008 forged a rogue CA certificate with them. A collision attack lets an attacker craft two different inputs with the same MD5, destroying any integrity guarantee. SHA-1 fell the same way in 2017 (the SHAttered attack).
- Can a hash be reversed?
- Not mathematically — hashing is one-way. But weak inputs can be guessed: attackers precompute hashes of common passwords (rainbow tables) or just brute-force short inputs. That's why hashing a password with plain SHA-256 is unsafe, and why password storage needs slow, salted algorithms instead.
- Can I hash a password with this tool?
- You can, but you shouldn't store it that way. Fast hashes like MD5 and SHA-256 are brute-forced at billions of guesses per second on modern GPUs. Real password storage uses bcrypt, scrypt, or Argon2 — deliberately slow algorithms with a unique salt per password.
- Why do two different files show the same MD5?
- Either the files are actually identical (the common case), or you've found an MD5 collision — two distinct inputs engineered to share a hash. Because collisions are practical for MD5, identical MD5s prove nothing about two files being the same; compare SHA-256 instead.
- Is my data uploaded anywhere?
- No. All hashing runs entirely in your browser — SHA-256 and SHA-512 use the WebCrypto API, MD5 and SHA-1 run in local JavaScript. Files are read locally and never transmitted, so you can safely checksum private documents.