What Is a Hash?
A hash function takes any input — a word, a file, a gigabyte of data — and produces a fixed-length fingerprint called a digest. The output looks like a meaningless string of hex, but it has three properties that make it extraordinarily useful. First, it is deterministic: the same input always produces the same digest, which is why two people can verify they have identical files by comparing hashes. Second, it is one-way: there is no operation that recovers the input from the digest. Third, it has the avalanche effect: change a single bit of the input and the digest changes beyond recognition, so even a one-character edit is trivially detectable.
The digest length never varies with input length. Hashing the letter a with SHA-256 and
hashing a 10-gigabyte video with SHA-256 both produce exactly 64 hex characters. That constant-size
property is what makes hashes cheap to store, compare, and index no matter what they describe.
MD5, SHA-1, SHA-256: The Three Algorithms
| Algorithm | Digest length | Status | Still good for |
|---|---|---|---|
| MD5 | 128 bits / 32 hex | Broken (2004) | Legacy checksums, non-adversarial dedup |
| SHA-1 | 160 bits / 40 hex | Deprecated (2017) | Reading old git commit IDs and similar |
| SHA-256 | 256 bits / 64 hex | Current standard | Checksums, signatures, TLS, anything new |
"Broken" and "deprecated" are precise terms: they mean collisions are constructible by a motivated attacker, not that the algorithms produce random-looking output. MD5 and SHA-1 remain fine for detecting accidental corruption — they fail at the adversarial job SHA-256 still does.
How This Tool Works
SHA-1 and SHA-256 are computed with crypto.subtle.digest, the WebCrypto API that ships
with every modern browser — the same native, hardware-accelerated implementation browsers use for
TLS. MD5 is a different story: WebCrypto deliberately omits it because it is insecure, so this page
includes a small, self-contained TypeScript implementation of the classic RFC 1321 algorithm. Both
paths encode your input as UTF-8 and return lowercase hex. Because everything runs in the page, you
can hash confidential drafts, keys, or test fixtures without them crossing the network.
A Short History of the Algorithms
MD5 was designed in 1991 as the successor to MD4 and became the default checksum of the 1990s —
the md5sum command shipped with every Unix, and download pages printed MD5 strings.
In 2004, cryptographers found practical collision attacks, and by 2008 chosen-prefix attacks made
it possible to forge two documents with identical MD5s. SHA-1 followed in 1995 as part of the
original SHA family and enjoyed the same ubiquity — git still uses it for commit IDs — until the
2017 SHAttered publication demonstrated a real collision and browsers began rejecting SHA-1
certificates. The SHA-2 family (SHA-224/256/384/512) arrived in 2001 specifically to fix SHA-1's
weaknesses, and SHA-256 is now the quiet workhorse of the internet: TLS certificates, package
registries, software checksums, and most blockchains all lean on it. The pattern across thirty
years of history is that algorithms age out only under attack — today's "broken" was once
standard, which is why security guidance evolves but the plain checksum use case never disappears.
Hashing in the Wild
Digests are so common you have been trusting them all week. Every git commit ID is a SHA-1 hash of the commit's metadata — which is why git can detect a rewritten history, and why the project moved to SHA-256 for new repositories. Docker and OCI image IDs are SHA-256 digests of the image manifest, so pulling the same image twice and comparing hashes verifies integrity. npm, PyPI, and other package registries publish integrity hashes that installers check before running code. Download pages for operating systems and firmware publish checksums so you can confirm a file is exactly what the vendor shipped. API frameworks use digests as etags for cache validation, and deduplication engines hash chunks of data to find duplicate storage. In all of these, the pattern is identical: compute a digest, store or transmit it, and later recompute and compare. That is the whole job, and it is why this page exists.
Step-by-Step: Hashing "hello"
Type hello and switch the algorithm. With MD5 you get
5d41402abc4b2a76b9719d911017c592; with SHA-1,
aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d; with SHA-256,
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Notice three things:
the digests are completely unrelated to each other, the input length is invisible in the output, and
the algorithm determines the output length (32, 40, or 64 characters). Now change one letter to
hellp and watch the whole digest change — that is the avalanche effect.
Reference Table
Paste any row below into the tool and check the outputs against these independently computed values:
| Input | MD5 | SHA-1 | SHA-256 |
|---|---|---|---|
| hello | 5d41402abc4b2a76b9719d911017c592 | aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d | 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
| (empty string) | d41d8cd98f00b204e9800998ecf8427e | da39a3ee5e6b4b0d3255bfef95601890afd80709 | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
| The quick brown fox jumps over the lazy dog | 9e107d9d372bb6826bd81d3542a419d6 | 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 | d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 |
| café | 07117fe4a1ebd544965dc19573183da2 | f424452a9673918c6f09b0cdd35b20be8e6ae7d7 | 850f7dc43910ff890f8879c0ed26fe697c93a067ad93a7d50f466a7028a9bf4e |
What Hashes Are For — and Not For
Good uses:
- Integrity checking: a downloaded file's published SHA-256 lets you verify nothing was corrupted or tampered with in transit.
- Deduplication: hashing content (duplicate articles, image variants, database rows) gives you a cheap equality key to compare.
- API and cache tokens: etags and content-addressable storage keys are frequently SHA-256 digests of the content.
- Understanding git: every commit ID you have ever seen is a SHA-1 hash of the commit's contents.
- Test fixtures: asserting a known digest in tests proves your pipeline produces stable, spec-correct output.
Wrong uses:
- Password storage: MD5 and SHA are too fast for passwords — GPUs try billions of guesses per second. Use bcrypt, scrypt, or Argon2 with a per-user salt.
- Encryption: hashes are not reversible, so they cannot protect data that must be read back. That is what encryption is for.
- Signing anything adversarial with MD5 or SHA-1: collisions can be forged, which is why certificates and signatures migrated to SHA-256.
Troubleshooting & Practical Tips
Hex vs Base64
This tool outputs lowercase hex, the most common digest format. Some APIs expect base64 — same digest, different text encoding. If a system rejects your digest, check which encoding it wants before suspecting the hash itself.
Hashes Are Always the Same Length
An empty string still hashes — MD5 of "" is d41d8cd98f00b204e9800998ecf8427e. If you are checking for "empty" values in data, compare the input, not the digest length.
Newlines Change the Hash
Hashing a file on the command line hashes its exact bytes — including the trailing newline. If you hash the visible text of that file here, the digests will differ. That is not a bug; a hash is a fingerprint of bytes, not of meaning. When comparing against a published checksum, always hash the exact file, or the exact string without the newline.
Hashing Is Not Encryption
A hash cannot be reversed into the original data, which is a feature for fingerprints and a deal breaker for confidentiality. If you need the data back, encrypt it; if you only need to compare or detect changes, hash it.