SHA-256 vs SHA-1 vs MD5: Checksum, Not a Password
MD5 (RFC 1321) is a 128-bit digest (32 hex chars). SHA-1 (FIPS 180-4) is 160 bits (40 hex) and collision-broken (SHAttered, 2017). SHA-256 (also FIPS 180-4) is 256 bits (64 hex). crypto.subtle.digest computes SHA-256 and SHA-1 in a secure context; MD5 is JavaScript because SubtleCrypto has no MD5. These are unkeyed checksums, not HMAC, not bcrypt, and not a file verifier. Nothing is uploaded.
A digest length is not a security product. The three algorithms on the live hash generator map bytes to a fixed hex string. Collision resistance, a keyed MAC, and a password KDF are different jobs. This page names those jobs so the hex is not oversold.
Three digest lengths
MD5: 128 bits, RFC 1321
Ron Rivest’s MD5 (IETF RFC 1321, 1992) outputs 128 bits — 32 hexadecimal characters. It processes 512-bit blocks. SubtleCrypto does not implement MD5, so Docify uses a JavaScript RFC 1321 routine. RFC 6151 (2011) replaces the original security considerations: MD5 is no longer acceptable where collision resistance is required, such as digital signatures. A non-adversarial checksum or cache key is a different use.
SHA-1: 160 bits, collision-broken
SHA-1 is specified in FIPS 180-4 (originally FIPS 180-1, 1995). The digest is 160 bits — 40 hex characters. NIST deprecated SHA-1 in 2011 and disallowed it for digital signatures at the end of 2013. In 2017, Stevens, Bursztein, Karpman, Albertini, and Markov (Google / CWI Amsterdam) published SHAttered: two different PDF files with the same SHA-1. NIST’s hash-function table lists SHA-1 collision resistance as below 80 bits. The live tool still offers SHA-1 so you can match a legacy fingerprint, and it labels that hex collision-broken.
SHA-256: 256 bits, FIPS 180-4
SHA-256 is in the SHA-2 family in FIPS 180-4. The digest is 256 bits — 64 hex characters. NIST lists 128-bit collision resistance and 256-bit preimage resistance. No practical collision on the full 64-round function is published. That is not a promise that none will appear, and it is not SHA-3 (FIPS 202 / Keccak), SHA-224, SHA-384, or SHA-512 — those names are not on this site. crypto.subtle.digest("SHA-256") needs a secure context (HTTPS or localhost).
Collision resistance is not a checksum
Wang & Yu, RFC 6151, SHAttered
Finding two different inputs with the same digest breaks collision resistance. Wang and Yu’s MD5 collisions (CRYPTO 2004 / EUROCRYPT 2005) made that practical for MD5. SHAttered did the same for SHA-1 with real PDFs. A checksum that only detects accidental bit flips can still use a broken hash. A signature, a certificate, or a commitment that assumes “same digest means same file” cannot. The generator does not look for collisions and does not claim a digest proves authenticity.
Zero-byte files vs empty text
The well-known empty-message SHA-256 is FIPS 180-4’s hash of zero bytes:
SHA-1 of zero bytes is da39a3ee5e6b4b0d3255bfef95601890afd80709; MD5 is d41d8cd98f00b204e9800998ecf8427e. Docify hashes an empty file as those zero bytes. Empty text is rejected so a blank box is not mistaken for that test vector. Text is UTF-8 via TextEncoder; a file uses File.arrayBuffer() (raw bytes, not a data URL).
Jobs this hex does not do
HMAC, password KDFs, SHA-3
HMAC (RFC 2104) is a keyed MAC; it needs a secret the other party already shares. Password storage needs a slow salted KDF — bcrypt, Argon2, or PBKDF2 — not a single unkeyed digest. SHA-3 is FIPS 202, a different sponge construction, and is not offered. The page also does not compare a digest to a published checksum, so it is not a package or ISO verifier. Git historically addressed objects with SHA-1 and later added SHA-256; this site does not implement Git.
Hash UTF-8 text or file bytes
SHA-256, SHA-1, or MD5 checksum. Hex only. Nothing is uploaded.
Use Hash Generator →FAQ
- How long is each digest in hex?
- MD5 (RFC 1321) is 128 bits: 32 lowercase hex characters. SHA-1 (FIPS 180-4) is 160 bits: 40 hex characters. SHA-256 (also FIPS 180-4) is 256 bits: 64 hex characters. Docify prints that hex; Uppercase only reformats it. These lengths do not make a digest a password hash or a MAC.
- Why are MD5 and SHA-1 labeled collision-broken?
- Collision resistance means it should be infeasible to find two different inputs with the same digest. Wang & Yu published practical MD5 collisions in 2004–2005; RFC 6151 says MD5 is no longer acceptable where collision resistance is required (for example digital signatures). Stevens, Bursztein, Karpman, Albertini, and Markov (Google / CWI) published SHAttered in 2017: two different PDFs with the same SHA-1. NIST deprecated SHA-1 in 2011 and disallowed it for digital signatures at the end of 2013. A checksum or cache key can still use a broken hash; a signature or commitment cannot.
- Is SHA-256 a password hash or HMAC?
- No. crypto.subtle.digest("SHA-256") is an unkeyed hash of the bytes you give it. HMAC needs a secret key. Password storage needs a slow KDF (bcrypt, Argon2, PBKDF2) with a salt. This guide and the live generator do neither. They also do not compare a digest to a stored value, so they are not a file verifier.
- What is the FIPS “abc” SHA-256 digest?
- FIPS 180-4’s SHA-256 example for the three ASCII bytes 61 62 63 (“abc”) is ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. SHA-1 of the same bytes is a9993e364706816aba3e25717850c26c9cd0d89d. MD5 of the same bytes is 900150983cd24fb0d6963f7d28e17f72. An empty file is zero bytes: SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. Empty text is rejected; SHA-3 (FIPS 202) is not offered.