What is a hash function?
A hash function maps any input — short or terabyte-long — to a fixed-size fingerprint (the digest). Two key properties: (1) the same input always produces the same output, so you can compare digests to detect changes; (2) for cryptographic hashes (SHA-256, SHA-512), it is computationally infeasible to find two inputs with the same output. Hashes underpin file checksums, Git commits, blockchain blocks, and every TLS handshake.
MD5 vs SHA-1 vs SHA-256 — which should I use?
For new code, use SHA-256 (or SHA-512). MD5 (since 2004) and SHA-1 (since 2017) are broken — researchers have produced collisions, meaning two different files with the same digest. They remain fine for non-security checksums (detecting bit-rot in a download, deduplicating files), but never use them for password hashing, signature verification, or content addressing where an attacker may craft input.
Can I use these hashes for password storage?
No. Password storage requires a slow, salted, memory-hard function — bcrypt, scrypt, Argon2, or PBKDF2 with at least 600,000 iterations. SHA-256 alone is too fast: a modern GPU can try billions of guesses per second against a database of leaked SHA-256 hashes. For password hashing, use Argon2id (preferred) or bcrypt with cost factor ≥ 12 in your backend; never store raw SHA-256 of a password.
Why is MD5 not in Web Crypto?
The W3C deliberately omitted MD5 from SubtleCrypto because it is cryptographically broken — exposing it as a first-class API risks developers using it where SHA-256 is required. We include MD5 here as a pure-JS implementation (about 100 lines of RFC 1321 reference code) so you can verify legacy checksums and interoperate with older systems, with a clear warning above the algorithm picker that MD5 is for non-security use only.
Are hashes reversible?
Cryptographic hashes are one-way — given a digest, you cannot recover the original input. However, hashes are not encryption: if the input space is small (a phone number, a UK postcode, a 6-digit PIN, a known dictionary word), an attacker can simply hash every candidate and look for a match. This is why password hashes need salt + slow KDF, and why hashing PII does not anonymise it.
What is the output size for each algorithm?
MD5 = 128 bits = 32 hex chars. SHA-1 = 160 bits = 40 hex chars. SHA-256 = 256 bits = 64 hex chars. SHA-384 = 384 bits = 96 hex chars. SHA-512 = 512 bits = 128 hex chars. Output is independent of input size — hashing one byte and hashing a one-gigabyte file both produce a digest of the same length.
Can I hash a file?
This page hashes text. To hash a file, drop it into the browser and read it with FileReader.readAsArrayBuffer — then pass the ArrayBuffer directly to crypto.subtle.digest. The same approach scales to multi-gigabyte files using streaming reads. We do not currently expose a file-hash mode here, but the Web Crypto API supports it natively.
Can I verify a checksum with this tool?
Yes — paste the original text, pick the algorithm shown alongside the published checksum (typically SHA-256 for modern releases, MD5 or SHA-1 for older mirrors), and compare the hex output. A character-for-character match means the content is intact. For binary files, use the file-hash workflow described above; the digest is the same regardless of where the bytes came from.