SHA-256 Hash Generator
Compute cryptographic SHA-256 digests in your browser via Web Crypto.
What Does the SHA-256 Hash Generator Do?
The SHA-256 Hash Generator computes a deterministic 256-bit (32-byte) cryptographic digest of any text input using the NIST FIPS 180-4 SHA-256 algorithm implemented by your browser's native SubtleCrypto engine (crypto.subtle.digest).
Input text is encoded as UTF-8 bytes prior to hashing, ensuring multi-byte Unicode characters hash identically to command-line utilities like sha256sum and OpenSSL.
Important note: SHA-256 is a one-way cryptographic hash function, not encryption. A hash cannot be 'decrypted' back into the original input.
How to Use This Tool
- Type or paste your input string into the text area (be mindful of trailing newlines!).
- Toggle between lowercase and uppercase hexadecimal output, and optionally paste an expected hash to verify an exact match.
- Click 'Copy Hash' to copy the 64-character hex digest.
Common Engineering Use Cases
- Verifying data integrity and computing deterministic content-addressable identifiers or cache keys.
- Generating Subresource Integrity (SRI) or webhook payload verification test vectors.
- Comparing computed digests against expected checksums during debugging.
Practical Developer Examples
NIST Standard Test Vector ('abc')
The three-character ASCII string 'abc' (without a trailing newline) always produces this exact 64-character hexadecimal SHA-256 digest.
abc
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Common Mistakes & Pitfalls to Avoid
- Treating SHA-256 as encryption—hashing is strictly one-way and cannot be reversed.
- Hashing user passwords with raw unsalted SHA-256 instead of a dedicated slow password KDF such as Argon2id, bcrypt, or PBKDF2.
- Comparing hashes when one tool included a trailing newline ('echo foo | sha256sum') and another hashed the bare string ('echo -n foo | sha256sum').
Frequently Asked Questions
Can a SHA-256 hash be reversed or decrypted?
No. SHA-256 is a one-way cryptographic hash function that maps arbitrary-length inputs to a fixed 256-bit output. Because infinite inputs map to a finite output space and the compression function is non-invertible, it cannot be decrypted.