Introduction
A SHA-256 digest appears as 64 hex characters, but where do those characters come from? Type abc above and inspect the padded bytes, the expanded schedule, and the eight working registers at any compression round. The tool calculates every stage locally instead of drawing an animation disconnected from the real algorithm. Select a block and move the round slider to see exactly which words and constants feed the state.
What this tool does
- Encodes text as UTF-8 bytes and displays SHA-256's 256-bit hex digest.
- Displays the appended 80 byte, zero padding, 64-bit big-endian original bit length, and resulting 512-bit blocks.
- Lists all 64 32-bit message schedule words for each block.
- Shows the eight input registers, round constant, schedule word, temporary sums, and final chained state for each of 64 rounds.
- Limits the live trace to 256 UTF-8 bytes so the display stays manageable.
How this tool works
The visualizer implements SHA-256 on the client, retaining intermediate values while it hashes. The first tab shows the complete padded byte buffer. The second tab shows W[0] to W[63] for the selected 512-bit block. The final tab lets you scrub through all 64 rounds and inspect register values before each update. Each block starts with the chaining state from the previous block; the final state is concatenated into the digest.
Input length is measured in bytes, not JavaScript characters. The text 0.85em] font-mono">é occupies two bytes in UTF-8, so its padding length differs from a one-byte ASCII character. Data entered here stays in the browser. Use the separate [SHA-256 Hash Generator when you only need a digest.
SHA-256 padding, schedule, and compression
NIST FIPS 180-4, sections 5.1.1, 5.2.1, and 6.2.2, defines the padding and SHA-256 computation. A 1 bit followed by enough zeros puts the message at 448 bits modulo 512, then a 64-bit field records the original bit length. This means an ASCII message of 56 bytes needs a second block: there is no room for the 8-byte length field in the first block.
Each block begins with 16 big-endian 32-bit words. The schedule expands them to 64 using shifted and rotated versions of earlier words. Each compression round combines W[t] with one of 64 fixed constants, the Choose and Majority functions, and two large Sigma rotation functions. Every sum wraps modulo 2^32. After 64 rounds, the working registers are added to the incoming state, also modulo 2^32. Eight 32-bit words make the 256-bit output. SHA-256 is a hash function, not encryption: there is no decryption key or way to recover arbitrary plaintext from its digest.
How to use this tool
- Enter a short message, for example
abc. Non-ASCII characters are encoded as UTF-8 first. - Open Padding to identify the original bytes, the 80 marker, zero padding, and encoded bit length.
- Open Message schedule and select a block. Compare W[0..15], which come from the block, to W[16..63], which are calculated.
- Open Compression rounds. Move the slider to inspect K[t], W[t], T1, T2, and the a through h registers at each step.
- Compare the displayed final digest with a known SHA-256 value or the site's hash generator.
Real-world examples
The standard abc example
Input abc is three bytes (61 62 63). It begins with the first padded word 61626380 and yields ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad.
The empty message
Input an empty string. The padded message still contains one complete 512-bit block starting with 80. The digest is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
Crossing a block boundary
Type 56 ASCII a characters. The padding marker and 64-bit length cannot both fit in the first block. Select block 2 to see how the previous block's output becomes the new compression input.
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| SHA-256 | 512-bit blocks, 64 rounds, 256-bit digest | Integrity and digital signature workflows |
| SHA-1 | 512-bit blocks, 80 rounds, 160-bit digest | Legacy compatibility only |
| SHA-512 | 1024-bit blocks, 80 rounds, 512-bit digest | Longer SHA-2 digest |
Limitations or considerations
Only UTF-8 text is accepted here, up to 256 bytes; this is not a raw file hashing tool. The displayed intermediate states are pedagogical, not a secure password hashing workflow. Fast hashes are inappropriate for storing passwords without a dedicated password hashing scheme. A digest alone cannot prove who published an expected checksum; see the Checksum Calculator for comparison with a trusted value.
Frequently asked questions
What are the stages of SHA-256?
Encode and pad the message, parse it into 512-bit blocks, expand each block into 64 words, then perform 64 compression rounds per block. Concatenate the final eight state words.
Why is my SHA-256 padding two blocks long?
After a 1 bit and zero padding, the last 64 bits must hold the original length. A 56-byte ASCII input cannot fit that field in the same 512-bit block, so padding spans two blocks.
What is the message schedule in SHA-256?
It is 64 words, W[0] to W[63]. The first 16 are read from the current message block; the remaining 48 combine earlier words with bitwise rotations, shifts, and addition modulo 2^32.
Can I reverse SHA-256 from its digest?
No. SHA-256 is designed as a one-way hash. You can hash candidate messages to compare digests, but the output does not include enough information to reconstruct arbitrary input.
Conclusion
Run 0.85em] font-mono">abc first, then a 56-byte input to see a second block. [How SHA-256 Works provides the longer explanation.