SHA-256 Hash Generator - Generate SHA-256 Hashes Online
—Generate a SHA-256 Hash
Type or paste text and its 64-character SHA-256 digest appears below.
The text is encoded as UTF-8 and hashed by the browser's Web Crypto API
(crypto.subtle.digest), the same primitive many web apps
use themselves. Nothing leaves the page. Paste hello and
you should see a hash starting 2cf24dba; if you get
something else, check for a stray space or newline.
Same Digest, Different Spellings
The 32 bytes of a SHA-256 digest are written in several ways depending on the tool. Knowing which one you are looking at saves a lot of "why don't these match" debugging:
- Hex (this page,
sha256sum, GitHub release pages):2cf24dba5fb0... - Docker and OCI image digests add a prefix:
sha256:2cf24dba5fb0... - Subresource Integrity uses Base64:
sha256-LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ= - Windows
Get-FileHashprints upper-case hex. Case does not matter.
Verifying a Download
Projects publish a SHA-256 next to each release so you can confirm the file was not corrupted or swapped. This page hashes text, so for a file run one of these and compare the result with the published value:
sha256sum file.tar.gz # Linux
shasum -a 256 file.tar.gz # macOS
Get-FileHash file.tar.gz # PowerShell (SHA-256 by default)
With a SHA256SUMS file in the same folder,
sha256sum -c SHA256SUMS checks every listed file at once.
Where SHA-256 Is Used
Most TLS certificates are signed with SHA-256 (the
sha256WithRSAEncryption or ECDSA-SHA256 you see in
certificate details). Bitcoin hashes block headers with SHA-256 twice.
Container registries address image layers by their SHA-256. JWTs signed
with HS256 use HMAC-SHA256, and RS256 and ES256 sign a SHA-256 hash of
the token. Git can store objects under SHA-256 instead of SHA-1, though
SHA-1 is still the default.
SHA-256 or Something Else?
Prefer SHA-256 over MD5 and
SHA-1, both of which have
practical collision attacks.
SHA-512 is equally sound
and sometimes faster in software, but its 128-character output is more
than most uses need. To authenticate a message with a shared secret,
hashing secret + message yourself is not safe (SHA-256 is
open to length-extension attacks); use the
HMAC-SHA256 generator instead.
Related Tools
JWT Decoder
Decode JSON Web Tokens and inspect header, payload and signature.
Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings back to plain text.
URL Encode / Decode
Percent-encode or decode URLs and query-string parameters safely.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.