SHA-256 Hash Generator - Hash Text & Files
Generate SHA-256 hashes from text or files instantly in your browser. Uses native Web Crypto API. No data uploaded. Free, private, and offline-capable.
About
SHA-256 produces a fixed 256-bit (32-byte) digest from arbitrary input, rendered as a 64-character hexadecimal string. It belongs to the SHA-2 family designed by the NSA and standardized in FIPS 180-4. A single bit change in the input produces an entirely different hash - the avalanche property - making it computationally infeasible to reverse-engineer the original message or find two inputs with the same digest. This tool computes SHA-256 using your browser's native SubtleCrypto module, meaning no data leaves your machine. It handles raw text encoded as UTF-8 and binary files of any size.
Incorrect hash verification leads to real consequences: corrupted firmware installs, tampered software packages, and undetected file modifications in forensic chains of custody. This tool approximates zero overhead by delegating to hardware-accelerated crypto primitives rather than a JavaScript reimplementation. Limitation: browsers enforce a same-origin policy on SubtleCrypto, so this tool requires HTTPS or localhost context to function. Pro Tip: always compare hashes in lowercase-normalized form to avoid false mismatches from case differences.
Formulas
SHA-256 operates on padded 512-bit message blocks through 64 rounds of compression. Each round applies bitwise operations, modular addition, and logical functions to eight working variables derived from initial hash values (H0 through H7).
The core compression function per round i:
Where H(m) is the final hash digest of message m. h0..7 are the eight 32-bit words of the final state after all blocks are processed. ‖ denotes concatenation. Ch(e, f, g) = (e ∧ f) &xor; (¬e ∧ g) is the Choice function. Maj(a, b, c) = (a ∧ b) &xor; (a ∧ c) &xor; (b ∧ c) is the Majority function. Σ0 and Σ1 are bitwise rotation functions. Ki are 64 constant words derived from cube roots of the first 64 primes. Wi are the message schedule words expanded from the input block. All additions are modulo 232.
Reference Data
| Hash Algorithm | Digest Size | Block Size | Rounds | Status (2024) | Collision Resistance |
|---|---|---|---|---|---|
| MD5 | 128 bit | 512 bit | 64 | Broken | 218 operations |
| SHA-1 | 160 bit | 512 bit | 80 | Deprecated | 263 operations |
| SHA-224 | 224 bit | 512 bit | 64 | Secure | 2112 |
| SHA-256 | 256 bit | 512 bit | 64 | Secure (Standard) | 2128 |
| SHA-384 | 384 bit | 1024 bit | 80 | Secure | 2192 |
| SHA-512 | 512 bit | 1024 bit | 80 | Secure | 2256 |
| SHA-512/256 | 256 bit | 1024 bit | 80 | Secure | 2128 |
| SHA3-256 | 256 bit | 1088 bit | 24 | Secure (Keccak) | 2128 |
| SHA3-512 | 512 bit | 576 bit | 24 | Secure (Keccak) | 2256 |
| BLAKE2b | 512 bit | 1024 bit | 12 | Secure | 2256 |
| BLAKE3 | 256 bit | 512 bit | 7 | Secure (Fastest) | 2128 |
| RIPEMD-160 | 160 bit | 512 bit | 80 | Legacy (Bitcoin) | 280 |
| Whirlpool | 512 bit | 512 bit | 10 | Secure | 2256 |
| CRC-32 | 32 bit | - | - | Non-cryptographic | None |