SHA-256 Generator
Generate a SHA-256 digest from text with the Web Crypto API.
Your result will appear here…
How to use SHA-256 Generator
- Enter the text to hash, exactly as it should be encoded.
- Select Generate.
- Copy the 64 hexadecimal characters after the label.
Example
Input / settings:
hello
Output:
SHA-256: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
The tool prints the label SHA-256: before the digest. Copy only the 64 hexadecimal characters when you compare against a bare digest.
When to use
- Compare a computed digest with a value published for a text sample.
- Create a repeatable fingerprint for a test fixture.
- Cross-check the output of another SHA-256 implementation.
Overview
SHA-256 is one of the SHA-2 hash functions specified in FIPS 180-4 and RFC 6234. This tool encodes your text as UTF-8, computes the 256-bit digest with the browser's Web Crypto API, and prints it as 64 lowercase hexadecimal characters after the label SHA-256:.
Supported input
text
Output details
hexadecimal SHA-256 digest
Common mistakes
- Invisible differences change the digest: hello, Hello, hello followed by a space, and hello followed by a newline all produce different results.
- Two spellings of the same character hash differently. é as one character (U+00E9) and as e plus a combining accent (U+0301) give different digests because their UTF-8 bytes differ.
- Empty input is not an error. It returns the digest of zero bytes, e3b0c442…b855, which is not an empty string.
- A matching digest shows that two inputs are identical, not who produced them. Use an HMAC when a shared secret must authenticate the data.
Practical tips
- Check an implementation with the RFC 6234 test vector: the 56-character input abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq must produce 248d6a61…06c1.
- The output is lowercase hexadecimal, while RFC 6234 prints uppercase. Compare digests without regard to letter case.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers. The text is encoded and digested in your browser with SubtleCrypto.digest and is not sent anywhere. A digest of a guessable value can be found by trying guesses, so hashing a password or other short secret this way is not a safe way to store or share it. Password storage needs a purpose-built scheme such as Argon2id; the OWASP cheat sheet explains the options.
References
- RFC 6234: US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)
- NIST FIPS 180-4: Secure Hash Standard
- MDN: SubtleCrypto.digest()
- OWASP Password Storage Cheat Sheet
Frequently asked questions
How long is a SHA-256 result?
The digest is 256 bits, shown as 64 hexadecimal characters. With the SHA-256: label the result line is 73 characters.
Why is the SHA-256 of an empty string not empty?
A hash function always produces a fixed-size digest. For zero bytes of input it returns e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
Is the hexadecimal output uppercase or lowercase?
Lowercase. If another system prints uppercase hexadecimal, the digests are the same value written differently.