SHA-256 hash generator and calculator
Compute a SHA-256 digest instantly, with input length shown in both characters and bytes — useful for debugging encoding or whitespace mismatches.
0 characters · 0 bytes
Generator and calculator, together
Most SHA-256 tools stop at "type text, get hash." This one adds the handful of extra details that actually matter when you're trying to reproduce or debug a specific expected hash value: the exact character count and byte length of your input, computed live as you type.
Why byte length matters for hashing
A hash function operates on bytes, not on "characters" in the abstract sense — and those two counts diverge the moment your input contains anything outside basic ASCII. An emoji, an accented letter, or a curly quote pasted from a word processor can occupy multiple bytes in UTF-8 while visually looking like a single character. If a hash you compute here doesn't match a value produced by another system, a byte-count mismatch is one of the first things worth checking, since it usually points to an encoding difference (UTF-8 vs UTF-16, or an unexpected trailing newline) between the two environments.
Common mismatches this catches
- Trailing whitespace or newlines — a value copied from a file often carries an invisible trailing
\nthat changes the byte count (and therefore the hash) without changing how the text looks on screen. - Encoding differences — the same visible character can be represented by different byte sequences depending on whether a system uses UTF-8, UTF-16, or Latin-1.
- Unicode normalization — visually identical text can be stored as different underlying code points (e.g. a precomposed accented letter vs. a base letter plus a combining accent mark), which produces different hashes even though nothing looks different.
Calculating a keyed (HMAC) hash
If your "calculation" involves a shared secret rather than a plain digest — verifying a webhook signature, checking an API request signature, or reproducing a JWT's HS256 signing step — use our dedicated SHA-256 with salt / HMAC tool, which adds a second input for the key and supports the standard HMAC-SHA256 construction.
Batch and file hashing
This page is built for quickly checking individual strings by hand. For hashing entire files, most operating systems include a built-in SHA-256 utility: certutil -hashfile file.zip SHA256 on Windows, or shasum -a 256 file.zip on macOS and Linux — both produce output directly comparable to what this calculator generates for text.
Frequently asked questions
Why does my SHA-256 hash not match the one I expected?
The most common causes are a hidden trailing newline, a difference in character encoding (UTF-8 vs UTF-16), or comparing a hash of the file itself against a hash of the file's visible text content, which are not the same input.
Does this calculator support hashing files, not just text?
No, this tool hashes text input only. Use your operating system's built-in checksum utility (shasum, certutil, sha256sum) for hashing files directly.
What is the difference between character count and byte count?
Character count is how many visible characters (code points) your input contains. Byte count is how many bytes that text occupies once encoded — typically identical for plain ASCII text, but different for accented letters, emoji, or other non-ASCII characters under UTF-8.