Hash Generator Guide: MD5 vs SHA-1 vs SHA-256 Explained (2026)
📅 August 2026⏱ 9 min read✍️ ToolLoom Editorial
"Just hash it" is common advice that hides a surprising amount of nuance — which algorithm, for what purpose, and why some of the most familiar ones (MD5, SHA-1) are considered broken today. Here's what a hash actually does, how the major algorithms differ, and where each one is safe to use.
A hash function takes any input — a single word, a password, an entire file — and produces a fixed-length string of characters called a hash or digest. No matter how large the input is, the output is always the same length for a given algorithm. Change even a single character of the input, and the entire output changes unpredictably — this property is called the avalanche effect.
Crucially, hashing is a one-way operation. There's no key, and no legitimate way to run the process backwards to recover the original input from its hash — which is exactly what makes it useful for verification without needing to store or transmit the original data.
🔒
One-Way
No key exists to reverse a hash back to its original input.
📏
Fixed Length
A one-character input and a 10 GB file, hashed with the same algorithm, produce equal-length outputs.
⚡
Deterministic
The same input always produces the exact same hash, every time.
🌊
Avalanche Effect
One changed character produces a completely different, unpredictable output.
MD5 vs SHA-1 vs SHA-256 vs SHA-512
Algorithm
Output Size
Hex Length
Security Status
MD5
128-bit
32 characters
Broken — collisions demonstrated
SHA-1
160-bit
40 characters
Broken — collisions demonstrated (2017)
SHA-256
256-bit
64 characters
Secure — industry standard today
SHA-384
384-bit
96 characters
Secure — used where longer output is preferred
SHA-512
512-bit
128 characters
Secure — largest common output, high collision resistance
💡
For any new project needing general-purpose hashing (file checksums, data fingerprinting, blockchain-style integrity checks), SHA-256 is the safe, well-supported default. Reach for SHA-512 when you specifically need a larger output space; avoid MD5 and SHA-1 for anything security-relevant.
Why MD5 and SHA-1 Are Considered Broken
"Broken" in cryptography has a precise meaning: researchers have found a practical way to defeat one of the core guarantees the algorithm is supposed to provide. For hash functions, that guarantee is collision resistance — it should be computationally infeasible to find two different inputs that produce the same hash.
Algorithm
Collision Attack
Year Demonstrated
MD5
Practical collisions, since refined to be very cheap
2004, worsening since
SHA-1
"SHAttered" attack by Google/CWI researchers
2017
⚠️
Both remain fine for low-stakes, non-adversarial uses — like quickly checking if two files are probably identical during development. Neither should be used anywhere a malicious party might deliberately try to forge a matching hash: digital signatures, certificate issuance, or password storage.
Why Passwords Need Bcrypt, Not Raw Hashing
This is one of the most common security mistakes in application development: using a fast, general-purpose hash like SHA-256 to store passwords. SHA-256 is cryptographically secure against collisions — but its speed is the problem, not its security. Modern GPUs can compute billions of SHA-256 hashes per second, which means an attacker with a stolen password database can brute-force guess enormous numbers of candidate passwords very quickly.
Approach
Speed
Password-Safe?
Raw MD5/SHA-1/SHA-256
Billions of hashes/sec on GPU
No
bcrypt
Deliberately slow, tunable cost factor
Yes
scrypt / Argon2
Slow AND memory-hard
Yes — Argon2 is the current recommended standard
Dedicated password-hashing algorithms are deliberately slow and, in the case of scrypt and Argon2, deliberately memory-intensive — both properties that make large-scale brute-force guessing dramatically more expensive for an attacker, even with specialised cracking hardware.
Verifying File Integrity With Checksums
When you download software, many publishers list a SHA-256 (or sometimes MD5) checksum alongside the download link. Comparing this published hash against the hash of the file you actually received confirms the file wasn't corrupted during transfer or tampered with by a compromised mirror.
1
Note the published hash
Copy the checksum listed on the official download page — usually SHA-256.
2
Generate the hash of your downloaded file
Use your OS checksum utility: certutil -hashfile file.exe SHA256 on Windows, or shasum -a 256 file on macOS/Linux.
3
Compare character by character
An exact match confirms the file is byte-for-byte identical to what the publisher released.
Worked Example
Hashing the text ToolLoom with different algorithms produces completely different outputs, despite the identical input:
Algorithm
Output Length
MD5
32 hex characters
SHA-1
40 hex characters
SHA-256
64 hex characters
SHA-512
128 hex characters
✅
Even changing "ToolLoom" to "toolloom" (just capitalisation) would produce four entirely different, unrelated-looking hashes — there's no way to tell from the output that the inputs were similar. Try ToolLoom's Hash Generator to see this avalanche effect in real time, and to verify a hash against your own input instantly.
Other Real-World Uses of Hashing
Git commit hashes — every commit's SHA-1 (moving to SHA-256) identifier is derived from its content and history
Blockchain block linking — each block references the hash of the previous one, creating a tamper-evident chain
Duplicate file detection — comparing hashes is far faster than comparing entire file contents
Digital signatures — signing algorithms typically sign a hash of a document, not the document itself
Data deduplication in storage systems — identical content produces identical hashes, letting systems store one copy
API request signing — HMAC-based signatures use hash functions to verify request authenticity
Common Mistakes When Using Hashes
Using MD5/SHA-1 for anything security-critical — fine for casual checks, unsafe against a determined attacker
Hashing passwords with SHA-256 directly — always use bcrypt, scrypt, or Argon2 for password storage instead
Not salting hashes — even secure algorithms benefit from a unique salt per record to defeat precomputed rainbow tables
Assuming a matching hash proves authenticity, not just integrity — a hash confirms content wasn't altered, not that the source is trustworthy
Comparing hashes case-sensitively when one side isn't — hex output case (upper/lower) can differ between tools even for a correct match
🔐 Generate a Hash Instantly — Free
MD5, SHA-1, SHA-256, SHA-384, SHA-512 — plus a built-in verifier. Runs entirely in your browser.
Encryption is reversible — with the correct key, ciphertext can be decrypted back to the original data. Hashing is one-way by design: there is no key and no way to recover the original input from its hash. A hash is meant to be a fixed-length fingerprint used for verification and comparison, not a way to securely store and later retrieve the original data.
Both algorithms have known practical collision attacks — meaning researchers have demonstrated ways to construct two different inputs that produce the same hash, undermining the core guarantee a hash is supposed to provide. MD5 collisions were demonstrated in 2004 and have gotten progressively easier to produce since; SHA-1 collisions were publicly demonstrated by Google researchers in 2017 (the "SHAttered" attack). Both remain fine for non-security uses like quick duplicate-file detection, but should never be used where tamper resistance or password security matters.
SHA-256 is cryptographically secure, but it's also extremely fast — which is exactly the wrong property for password storage. A fast hash lets an attacker with a stolen password database try billions of guesses per second using modern GPUs. Dedicated password-hashing algorithms like bcrypt, scrypt, and Argon2 are deliberately slow and "memory-hard," making large-scale guessing attacks computationally expensive even with powerful hardware.
Compare the file's hash against the hash published by the source. Generate the hash of your downloaded file using your operating system's checksum utility (certutil on Windows, shasum or md5 on macOS/Linux), then compare it character-by-character against the official published hash. If they match exactly, the file is byte-for-byte identical to what the source published; any mismatch means the file was altered or corrupted in transit.
MD5 produces a 128-bit hash, shown as 32 hexadecimal characters. SHA-1 produces a 160-bit hash, shown as 40 hex characters. SHA-256 produces a 256-bit hash, shown as 64 hex characters. SHA-512 produces a 512-bit hash, shown as 128 hex characters. Longer outputs generally mean a larger space of possible hash values, which makes accidental or deliberate collisions statistically far less likely.
Not through the hash function itself — hashing is mathematically one-way. What attackers actually do is precompute hashes for enormous lists of common passwords or phrases (rainbow tables) and simply look up whether a given hash matches one they've already computed. This is why unique, unpredictable input matters for anything security-sensitive, and why fast, unsalted hashes are especially vulnerable to this lookup approach.
About ToolLoom: We build free tools for Indian students, professionals and creators. All hashing happens instantly in your browser via the Web Crypto API — nothing you type is uploaded or stored. Found an error? Email contact@toolloom.in