SHA-2 Hash Generator

Generate SHA-256, SHA-384, or SHA-512 digests locally in the browser using Web Crypto.

Last updated: August 2026 | By Workshelve Team

SHA-256 Digest
SHA-2 output will appear here...

Input bytes

0

Hash chars

0

Digest size

256 bits

What gets hashed

This tool hashes the UTF-8 bytes of the text you enter. SHA-256 outputs 32 bytes / 64 hex characters, SHA-384 outputs 48 bytes / 96 hex characters, and SHA-512 outputs 64 bytes / 128 hex characters.

What hashes mean

SHA-2 hashing is deterministic and one-way: the same bytes always produce the same digest, even a one-byte change will ordinarily produce a completely different-looking digest, and the digest is not something you can decrypt back into the original text.

Practical limits

Hashing is performed locally with Web Crypto and this component does not send the input anywhere. Empty text is valid and has a defined digest, but raw SHA-2 is not appropriate for password storage and this tool hashes text only, not files.

What SHA-2 Hashing Does

SHA-2 is a family of cryptographic hash functions that turns input bytes into a fixed-length digest. This tool offers SHA-256, SHA-384, and SHA-512. The output is shown as lowercase hexadecimal, which is just a text representation of the raw digest bytes.

The tool hashes the UTF-8 bytes produced by JavaScript's TextEncoder. That matters because hashing depends on exact bytes, not visual appearance. Two strings that look similar can hash differently if they use different Unicode code points or normalization forms.

Hashing is one-way and deterministic. The same bytes always produce the same digest, but there is no reverse operation that recovers the original text from the hash. That makes SHA-2 useful for fingerprints, integrity comparison, and signing workflows, but not for storing passwords by itself.

How to Use This Tool

Digest Sizes and Output Lengths

Each SHA-2 variant produces a different fixed-size digest:

SHA-256: 256 bits = 32 bytes = 64 hexadecimal characters
SHA-384: 384 bits = 48 bytes = 96 hexadecimal characters
SHA-512: 512 bits = 64 bytes = 128 hexadecimal characters
Formula: displayed hash length = digest bytes × 2 hex characters per byte

Important Behavior

Empty text is valid and has a defined SHA-2 digest.
This tool hashes text input only, not files or binary uploads.
Hashing is performed locally with Web Crypto; this component does not send the input anywhere.
Web Crypto digesting is not streaming here, so the full input is hashed in memory. Web Crypto digesting requires a secure context (HTTPS) in supporting browsers.
Do not use a raw SHA-2 digest as a password-storage scheme; use Argon2, scrypt, bcrypt, or PBKDF2 instead.
HMAC is a different construction from a plain hash and requires a secret key.

Worked Examples

Example 1: SHA-256 of the empty string

Input:
"" (zero UTF-8 bytes)
Result:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

This is the standard SHA-256 digest of an empty byte sequence. A hash generator must allow it rather than rejecting blank input as invalid.

Example 2: Built-in sample text across all three variants

Input:
Workshelve SHA-2 example
SHA-256: 8d92fa67c96035c712711a2a3cb1ef02dbb4a8948d0f6fddc3c1041acb7e6707
SHA-384: 80bfc2d2c71e39567ab3588c6744dbb1f64531a998f7432cd66a00759395170801529c196e55b9c55261c92e4434fb17
SHA-512: 7e31424b9cff9c669ba6b15610a758c3bef387de0011908a9f3965faf32331f0692bdfc61a2c5a2f61a3e5fb49ebfd530a569ba24a6a9ffe082b76c85253b0f7

Each algorithm hashes the same UTF-8 bytes but produces a different digest length.

Frequently Asked Questions

What exactly is being hashed here?

The tool hashes the UTF-8 bytes of the text you enter. If two strings differ by whitespace, casing, Unicode normalization, or any other byte-level detail, their digests will ordinarily differ too; cryptographic hashes are designed for collision resistance, not a mathematical guarantee that different inputs can never share a digest.

Is hashing the same as encryption?

No. Encryption is designed to be reversible with a key. SHA-2 hashing is one-way and does not provide a decrypt operation that recovers the original text.

Why does empty text still have a hash?

Because SHA-2 is defined for every byte sequence, including a zero-length message. The empty string has a standard digest for SHA-256, SHA-384, and SHA-512.

Should I store passwords with SHA-256 or SHA-512?

No. Raw SHA-2 is too fast for password storage. Use a password hashing or key-derivation scheme such as Argon2id, scrypt, bcrypt, or PBKDF2.

Can I use this to verify files?

Not directly. This component hashes text typed into the textarea. File verification needs a file-hashing workflow that reads raw file bytes instead of text input.

Why are SHA-256, SHA-384, and SHA-512 different lengths?

They are different members of the SHA-2 family with different digest sizes: 256, 384, and 512 bits respectively. Longer digests produce longer hexadecimal output strings.

Related Tools