SHA-256 for Developers: Checksums, HMAC and What Hashing Cannot Do
When to use SHA-256 (and when not to), how HMAC adds a secret, why password hashing needs bcrypt or Argon2 instead, and how to verify checksums quickly.
SHA-256 is the fingerprint function of the internet — embedded in TLS certificates, package managers and blockchains. Yet it is also the most misused primitive in application code. This guide draws the usable line.
What SHA-256 is good for
- Integrity: compare a download hash with the published one — same fingerprint, same bytes.
- Cache and dedup keys: arbitrary content maps to a stable 64-character hex identifier.
- Signature inputs: JWT HS256 and RSA/ECDSA signatures all hash with SHA-2 underneath.
Generate any digest offline with the SHA-256 Hash Generator — nothing you paste leaves the browser, which matters when hashing URLs or internal identifiers.
What hashing cannot do
A hash is one-way and unkeyed. It provides no confidentiality (anyone sees it) and no authentication (anyone can compute it). Encrypting something is a different operation with a key; hashing it merely fingerprints it.
HMAC: hashing with a secret
HMAC wraps SHA-256 with a key: only holders of the secret can produce a matching tag. That is what turns a plain digest into a verifiable signature — the mechanism behind JWT HS256 and most API request signing. Decode a JWT and inspect its signature claims with the JWT Decoder.
Passwords: do not use SHA-256 directly
Fast hashes are build for speed — exactly what attackers exploit with GPU cracking. Password hashing needs deliberately slow, salted KDFs: bcrypt, scrypt or Argon2. Generate strong random passwords instead of hashing weak ones, using the Password Generator.
Quick checksum workflow
After downloading a binary, generate its SHA-256 locally and compare character by character with the vendor value — the hash tool does it in one paste, including large inputs.
Related guides
Base64 vs Hex Encoding: When to Use Each (Developer Guide)
Base64 vs hex encoding compared: size overhead, readability, common use cases in JWTs, data URLs and git diffs — with a quick decision table for engineers.
Read guide →2026-10-11How to Decode a JWT: Reading Header, Payload and Signature
Decode any JWT by hand or with a browser tool: how the three parts are encoded, which claims matter (sub, exp, iss, aud) and why decoding is not verification.
Read guide →2026-10-07UUID v4 and v7: The Complete Guide for Databases and APIs
What a UUID actually encodes, v4 vs v7 trade-offs for database indexes, how unique is truly unique, and why UUIDs are not secrets.
Read guide →Try these tools
SHA-256 Generator
Compute the SHA-256 digest of any text instantly — with SHA-1, SHA-384 and SHA-512 alongside. Uses WebCrypto when available, with a pure-JS fallback. Includes HMAC demo mode.
Open tool →JWT Decoder
Decode a JWT header and payload into readable JSON with formatted dates for exp/iat/nbf, signature state and expiry status. Safe: verification never happens in the browser.
Open tool →Password Generator
Generate cryptographically strong passwords with adjustable length and character sets, ambiguous-character filter and entropy readout. Five candidates at a time, 100% offline.
Open tool →