SHA-256 Hash Calculator
Enter text to compute its SHA-256 hash.
What SHA-256 produces
SHA-256 turns any input into exactly 256 bits, displayed here as 64 hexadecimal characters. The digest is deterministic — the same input always yields the same 64 characters — but there is no way to reconstruct the input from the output, and no known way to find two different inputs that share a digest. That combination of fixity, one-wayness and collision resistance is why SHA-256 appears in certificate chains, file verification pages, Bitcoin block headers and password-storage schemes.
The length is fixed regardless of input: hashing the empty string, one character, or a 4 GB file all produce exactly 256 bits. The tool reports the digest length as 256 for every input, since that is a property of the algorithm rather than of your text.
How the algorithm works, step by step
SHA-256, specified in FIPS 180-4, processes the message in 512-bit blocks. First the message is padded: a 1 bit is appended, then zeros until the length is 56 mod 64 bytes, then the original bit length packed into the final 8 bytes. A 13-character input like the default therefore occupies one block — 13 data bytes, 1 padding byte, 42 zero bytes and 8 length bytes — while anything over 55 characters spills into additional blocks.
Eight 32-bit state words are initialized to fixed fractional-bit constants. Each block is then expanded into 64 words: the first 16 come straight from the block, and each later word mixes earlier words through rotations of 7, 18, 17 and 19 bits plus a right shift of 3 or 10. A compression function then runs 64 rounds, each round blending the state through chosen functions, bitwise majority and choice logic, a quarter of constants, and modular addition — the rotr operations you can see in the source of this page.
After the final block, the eight state words are concatenated into the 256-bit digest. The whole construction is one-way because the rounds repeatedly overwrite information, and collision-resistant because each input bit diffuses into every state word across rounds.
Worked example at the default input
The default text "Hello, world!" is 13 characters, or 13 bytes of ASCII. Its SHA-256 digest is 315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3. Notice how nothing in that output resembles the input, and how changing a single character — capitalization, the comma, the final punctuation — produces an entirely different 64-character string. The famous empty-string digest e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 is another useful self-test: hash nothing and you should get exactly that.
Well-known test vectors
| Input | SHA-256 digest (hex) | Notes |
|---|---|---|
| (empty string) | e3b0c44298fc1c14...52b855 | The universal empty-input vector |
| abc | ba7816bf8f01cfea...20015ad | The FIPS 180-4 sample message |
| hello world | b94d27b9934d3e08...2efcde9 | Lowercase, no punctuation |
| Hello, world! | 315f5bdb76d078c4...94edd3 | This calculator’s default |
Why the output looks random
Digests are abbreviated in the table for readability; each is always 64 characters in full. Reproducing all four rows is a quick correctness check for any SHA-256 implementation. The 3-character difference between abc and hello world rows also shows the avalanche effect: inputs of similar size share nothing in their digests.
What SHA-256 is used for
- File integrity: download pages publish the SHA-256 of archives so you can verify a complete, untampered copy locally
- TLS certificates: certificate signatures and handshakes rely on SHA-256 as the standard digest
- Bitcoin: the proof-of-work target and the block address scheme are built on double SHA-256
- Password storage: as a building block inside salted, iterated schemes such as PBKDF2 — never raw, because raw SHA-256 is too fast for GPU attack
- Cache keys and deduplication: content-addressed storage keys content by its digest
Hashing is not encryption
A hash is a one-way fingerprint; encryption is a reversible transformation controlled by a key. Nothing is decrypted when you hash a password to check it — instead the presented password is hashed again and the two digests are compared. If you need the original text back, you need encryption, not a hash.
Practical notes on input
Two details change results in ways that surprise people. First, encoding: the digest of text depends on its bytes, so the same characters hashed as UTF-8 versus UTF-16 give different outputs — tools that hash text are implicitly choosing UTF-8 or Latin-1 bytes, and this calculator hashes the Latin-1 byte range exactly as standard implementations do for such input. Second, trailing whitespace: a single trailing newline or space produces a completely different digest, which is the most common reason two tools disagree about the same file. For pure byte-exact work, hash files rather than typed text, and compare your result with the Checksum Calculator for other algorithms.
Frequently asked questions
What is the SHA-256 hash of "Hello, world!"?
315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3. The 13-character input hashes to exactly 64 hexadecimal characters, like every other SHA-256 input.
Can a SHA-256 hash be reversed?
No. SHA-256 is a one-way function: the digest reveals nothing recoverable about the input, and the only practical attack is guessing inputs and comparing digests, which fails for anything with real entropy.
How long is a SHA-256 hash?
Always 256 bits, written as 64 hexadecimal characters. The digest length never changes with input size — an empty string and a 4 GB file both produce exactly 64 characters.
Is SHA-256 the same as encryption?
No. Encryption is reversible with a key; hashing is not reversible at all. A hash is a fingerprint used for verification, not a cipher used to store recoverable data.
Why do two tools give different hashes for the same text?
Almost always a byte difference: a trailing newline, different encoding such as UTF-8 versus UTF-16, or hidden whitespace. SHA-256 itself is standardized — identical bytes always produce identical digests.
What is the hash of an empty string?
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. It is the most widely quoted SHA-256 test vector, and hashing nothing in any correct implementation must reproduce it.
Is SHA-256 still secure in 2026?
Yes. No practical collision or preimage attack is known. SHA-1 and MD5 are the broken legacy digests; SHA-256 remains the default in TLS, code signing and blockchain systems.
Should I hash passwords with plain SHA-256?
No. Raw SHA-256 is too fast, letting GPUs try billions of guesses per second. Use a salted, deliberately slow scheme such as bcrypt, scrypt, Argon2 or PBKDF2, which uses SHA-256 internally at controlled cost.
Why does one changed character change the whole hash?
The avalanche effect. Every input bit feeds the 64-round compression function, and each round diffuses changes across all eight state words, so even a one-bit difference lands in a completely different 256-bit output.
Method and sources
- FIPS 180-4: Secure Hash Standard (SHA-256).