Hash Generator
Generate SHA-1, SHA-256, and SHA-512 cryptographic hashes using the Web Crypto API. Click any hash to copy.
Understanding Cryptographic Hashes
A cryptographic hash function takes any input and produces a fixed-size output (the “digest”) that is deterministic, fast to compute, and practically irreversible. Even a single changed character produces a completely different hash — this is called the “avalanche effect.”
SHA Algorithm Comparison
- SHA-1 (160-bit / 40 hex chars) — Deprecated for security since 2017 (Google demonstrated a collision). Still used for non-security checksums like Git commit hashes and file deduplication.
- SHA-256 (256-bit / 64 hex chars) — Part of the SHA-2 family. The industry standard for TLS/SSL certificates, Bitcoin mining, digital signatures, and HMAC authentication. Recommended for most use cases.
- SHA-512 (512-bit / 128 hex chars) — Also SHA-2 family. Offers higher security margin and is actually faster than SHA-256 on 64-bit processors due to native 64-bit operations.
Common Use Cases
- Data integrity — Verify file downloads by comparing hashes (e.g., checking ISO images, npm package integrity).
- Content addressing — Git, IPFS, and Docker use content hashes as identifiers.
- Digital signatures — Sign a hash of the document instead of the full content (RSA, ECDSA).
- HMAC tokens — Combine a secret key with SHA-256 for API authentication (e.g., Stripe webhooks, AWS Signature v4).
- Deduplication — Identify duplicate files or database records by comparing hashes instead of full content.
Hashing vs Encryption
Hashing is a one-way function — you cannot recover the original input from a hash. Encryption is reversible with the correct key. For password storage, never use plain SHA hashes; use purpose-built algorithms like bcrypt, scrypt, or Argon2 that add salt and configurable work factors to resist brute-force attacks.
SHA-3 and the Future of Hashing
SHA-3 (Keccak) was standardized by NIST in 2015 as a backup to SHA-2, using a completely different internal structure (sponge construction vs Merkle-Damgård). While SHA-2 remains unbroken and widely used, SHA-3 provides an insurance policy against potential future attacks on SHA-2’s construction. SHA-3 variants include SHA3-256 (256-bit), SHA3-512 (512-bit), and SHAKE128/SHAKE256 (variable-length output). In practice, SHA-256 remains the industry standard for TLS certificates, blockchain, and digital signatures because no practical attacks have been found against it.
Hash Verification in Practice
Hash verification is essential for software distribution security. When downloading files like Linux ISOs, node.js binaries, or Python packages, publishers provide SHA-256 checksums. After downloading, generate the hash of the downloaded file and compare it to the published value — any mismatch indicates corruption or tampering. Package managers automate this: npm verifies SHA-512 integrity hashes in package-lock.json, pip checks hashes with --require-hashes, and docker verifies image layer digests. Subresource Integrity (SRI) in web browsers uses the same principle: <script integrity="sha384-..."> ensures CDN-hosted scripts haven’t been modified.
crypto.subtle.digest) and requires HTTPS. All hashing happens locally — your input is never transmitted.