SHA-256 File Hash
How it works
SHA-256 (Secure Hash Algorithm 2, 256-bit) is a cryptographic hash function that produces a deterministic 64-character hexadecimal fingerprint of any input. This tool hashes files entirely in your browser using the Web Crypto API — the file bytes never leave your device.
**What file hashing is used for** Verifying download integrity: software publishers publish SHA-256 hashes alongside release files. After downloading, compute the hash locally and compare — a mismatch indicates corruption or tampering. Git uses SHA-1 (being migrated to SHA-256) to identify every commit and blob by content. Docker image layers are identified by SHA-256 of their content, enabling content-addressable storage and deduplication. IPFS uses SHA-256 in CIDs (Content Identifiers) to create self-verifying links.
**SHA-256 properties** Collision resistance: no two different inputs produce the same hash (no known practical attacks against SHA-256). Pre-image resistance: you cannot reconstruct the input from the hash. Avalanche effect: changing a single byte of input changes ~50% of output bits. The hash does not reveal file size, type, or content — it is a one-way function.
**SHA-256 vs MD5 vs SHA-1** MD5 and SHA-1 are deprecated for security purposes — practical collision attacks exist for both. SHA-256 is part of the SHA-2 family, which remains unbroken. SHA-3 (Keccak) is an alternative standard but SHA-256 dominates deployment.
Frequently Asked Questions
- The software publisher provides the expected SHA-256 hash alongside the download. After downloading, compute the hash locally using this tool (or sha256sum on Linux/macOS, Get-FileHash on Windows PowerShell), then compare character-by-character with the published hash. A mismatch means the file was corrupted during download or tampered with. Most Linux distro ISO downloads include SHA-256 checksums in a SHA256SUMS file.
- In theory yes (collision), but no practical collision attacks against SHA-256 are known. The probability of a random collision is approximately 1 in 2^128 (the birthday paradox halves the effective collision resistance from 256 to 128 bits). SHA-256 was designed with 128-bit collision resistance — computationally infeasible with any foreseeable technology. MD5 and SHA-1 have known practical collisions; SHA-256 does not.
- The file bytes are read directly in your browser using the File API and hashed using the Web Crypto API. The file never leaves your device. This is important for confidential files — source code, medical records, financial documents — where uploading to a third-party server for hashing would expose the content. Browser-based hashing provides the same cryptographic guarantee with no privacy risk.
- Git uses SHA-1 (migrating to SHA-256) to identify commits and file blobs by content. Docker content-addresses layers by SHA-256, enabling deduplication. IPFS uses SHA-256 in CIDs (Content Identifiers) to create self-verifying links. Bitcoin uses SHA-256 twice (SHA-256d) for proof-of-work. TLS certificate fingerprints are SHA-256 hashes. Password hashing should use bcrypt/Argon2 (not raw SHA-256, which is too fast for password storage).