Hash Generator
Generate cryptographic hashes using the Web Crypto API. Runs entirely in your browser.
What is a Hash Function and Why Do Developers Use SHA-256 Hashing?
A hash maps arbitrary input bytes to a fixed-size digest. The same bytes give the same digest. Hashes are not reversible encodings, but predictable inputs can be recovered by guessing, and collisions exist because the output space is finite.
Hash Algorithms Explained — SHA-1 vs SHA-256 vs SHA-512
- SHA-1 (160-bit) — Legacy algorithm still used in Git commit hashes. Considered broken for security purposes since 2017 (SHAttered attack). Do not use for new security applications.
- SHA-256 (256-bit) — A SHA-2 digest used for integrity checks and cryptographic protocols. Raw SHA-256 is unsuitable for password storage; PBKDF2-HMAC-SHA256 is a distinct, deliberately expensive password derivation scheme.
- SHA-384 produces 384 bits using the SHA-512 compression design with different initial values and output truncation. It is not simply the first 384 bits of an ordinary SHA-512 digest.
- SHA-512 produces a 512-bit SHA-2 digest. Select an algorithm supported by the protocol and threat model rather than assuming output size alone establishes security.
Common Use Cases for Hash Generation
- Verifying file integrity after download — Compare the SHA-256 hash of a downloaded file against the publisher's checksum to detect corruption or tampering
- Password storage requires a password KDF — Do not use this raw digest tool. Use a vetted implementation of Argon2id, scrypt, bcrypt, or PBKDF2 with a unique salt and appropriately configured cost.
- Digital signatures and certificates can use SHA-2 digests as part of an authenticated protocol. A raw digest alone neither signs data nor establishes the identity of its sender.
- Git object identifiers traditionally use SHA-1; repositories can also use SHA-256. A commit hash covers the serialized commit object, including tree and parent references and metadata.
- Blockchain and cryptocurrency — Bitcoin mining uses double SHA-256 hashing to validate transactions
- Subresource Integrity requires an algorithm prefix and a Base64-encoded digest. This tool displays hexadecimal digests, so its output cannot be pasted unchanged after sha256- in an integrity attribute.
- API request signing — HMAC-SHA256 signatures authenticate API requests in AWS, Stripe, and other platforms
How This Online Hash Generator Works
This tool uses the browser's native Web Crypto API (crypto.subtle.digest()) to compute hashes. This is the same cryptographic engine used by HTTPS and browser security — it produces the same hash output as openssl dgst, sha256sum, or hashlib in Python. All processing happens locally in your browser.
Frequently Asked Questions
This tool supports SHA-1 (160-bit), SHA-256 (256-bit), SHA-384 (384-bit), and SHA-512 (512-bit) hash algorithms via the browser's native Web Crypto API. These are the most widely used cryptographic hash functions for file integrity verification, digital signatures, and data validation.
Yes. You can either type or paste text directly, or upload a file to compute its hash. File hashing reads the binary content and computes the digest, which is useful for verifying downloads, checking file integrity, and comparing file versions.
This tool uses the browser's Web Crypto API, which does not include MD5 because it is considered cryptographically broken since 2004. Collision attacks against MD5 are practical and fast. For security purposes, SHA-256 or SHA-512 should be used instead.
Hash computation uses the browser’s Web Crypto API. Shared page services and local drafts are separate from hashing. Local computation does not make raw hashes suitable for password storage; use a dedicated salted password KDF.
Choose the digest matching the publisher’s algorithm and compare it with a checksum obtained through a trusted channel. A matching digest supports integrity only to the extent that the expected checksum is authentic; it does not prove the file is safe.