Generate SHA-256 hashes using your browser's built-in Web Crypto API. Fast, accurate, and client-side only — no data is ever sent to our servers.
What is SHA-256?
SHA-256 is part of the SHA-2 family of hash functions, published by NIST in 2001. It turns any input into a 256-bit digest, written as 64 hexadecimal characters. It has no known practical collisions, which is why it secures TLS certificates, software signatures, Git (in its SHA-256 mode) and Bitcoin.
This tool uses crypto.subtle.digest('SHA-256'), the same native implementation your browser uses for HTTPS, so results match every standard SHA-256 library.
SHA-256 test vectors
Use these known values to check this tool, or your own code:
In short: use SHA-256 to fingerprint data, and bcrypt (or Argon2id) to store passwords. Our bcrypt vs Argon2 guide covers the password side in depth.
Why your SHA-256 hash doesn't match
A trailing newline or extra whitespaceecho "hello" | sha256sum hashes hello plus a newline. Use echo -n or printf, and watch for spaces copied from documents.
Hex vs Base64 outputThe same 32-byte digest can be written as 64 hex characters or 44 Base64 characters. Subresource Integrity (sha256-…) and many APIs use Base64; this tool and sha256sum print hex.
Hashing text vs hashing a fileHashing a file name, or a file's contents pasted as text, is not the same as hashing the file's raw bytes. Use a file-hashing command for downloads and archives.
Different text encodingThis tool hashes the UTF-8 bytes of your text. Other encodings give different results for any character outside plain ASCII.
Generate a SHA-256 hash on the command line or in code
Not on its own. SHA-256 is designed to be fast, so attackers with GPUs can test billions of guesses per second against a stolen hash. Use a password hashing function such as bcrypt or Argon2id. If you need a FIPS-approved option, OWASP recommends PBKDF2-HMAC-SHA256 with at least 600,000 iterations.
Can a SHA-256 hash be reversed?+
No. SHA-256 is a one-way function with no known practical attacks against it. As with any fast hash, though, short or common inputs can be found by guessing, so a hash of a weak password offers little protection.
How long is a SHA-256 hash?+
A SHA-256 hash is 256 bits (32 bytes), written as 64 hexadecimal characters or 44 Base64 characters.
What is the difference between SHA-256 and HMAC-SHA256?+
SHA-256 hashes data on its own, so anyone can compute it. HMAC-SHA256 mixes in a secret key, which proves the message came from someone who knows the key. Use HMAC for webhook signatures, API request signing and similar authentication checks.