What is HMAC and why do developers search for an HMAC calculator?
HMAC (Hash-based Message Authentication Code) combines a secret key with a hash function so that only someone who knows the key can produce the same tag for a given message. Unlike a plain SHA-256 hash, an attacker cannot forge a valid tag from the message alone. Teams look for an HMAC SHA256 online tool when they debug webhook signature verification, compare a header to a locally computed value, or document integration tests that show sample inputs and expected tags. This page focuses on HMAC-SHA256 and HMAC-SHA512 because those are what most modern APIs specify.
Keywords that match this tool include webhook signature generator, API HMAC test, signed request debugging, and UTF-8 HMAC — because byte-for-byte agreement with the provider depends on encoding and on the exact string being signed (often the raw HTTP body before JSON parsing).
How to use this HMAC generator (step by step)
- Paste your signing secret into the secret field, or click Upload file to load a UTF-8 key from disk. Use Show to confirm there are no accidental spaces or wrong characters.
- Paste the message or payload — for JSON webhooks, that is usually the raw JSON string as received, not pretty-printed unless the provider signs pretty-printed bytes. Upload a file if your fixture lives in a repo.
- Choose HMAC-SHA256 or HMAC-SHA512 and whether you need lowercase hexadecimal or Base64 to match documentation (some systems prefix hex with
sha256=in headers—add that prefix yourself when comparing). - Click Copy signature (with the copy icon) and paste the value next to your server-side computation or ticket. If the tag does not match, normalize the payload with our JSON formatter only after you confirm whether the signer uses canonical JSON.
HMAC vs plain hashing: when to use each
Use HMAC when two parties share a secret and need to prove authenticity of a message. Use a plain digest from the hash generator for integrity of public content (checksums, cache keys) where no secret is involved. For password storage, use dedicated password hashes (see password strength meter and industry guidance on bcrypt or Argon2), not HMAC of passwords in logs.
Encoding pitfalls: why verification fails even with the “same” JSON
HMAC is computed over bytes. A trailing newline, different Unicode normalization, or re-serialized JSON with another key order changes the tag. If you transport binary inside text, round-trip through Base64 encode and decode only when the protocol says to. Align with your provider’s test vectors before filing a bug.
Privacy and security notes
Signing runs locally; we do not receive your secret or message. For production keys, prefer dedicated secret managers and never paste live credentials into shared screens. For asymmetric signing and key pairs, use the RSA key pair generator when you need public-key workflows instead of shared HMAC secrets.
Related security and encryption tools
Browse the full security and encryption tools section on the home page. Highlights from the catalog:
- Password Strength Meter — Score password entropy, estimate crack time, and get practical hardening tips.
- bcrypt Hash Generator — Generate bcrypt hashes with configurable cost for secure password storage testing.
- AES Encrypt & Decrypt — Encrypt and decrypt text with AES-256 and a passphrase—runs fully in your browser.
- RSA Key Pair Generator — Create 1024–4096 bit RSA public/private key pairs locally for demos and dev workflows.
- CSP Builder — Toggle Content-Security-Policy directives and copy a header value ready for your server.
- Security Headers Checker — Analyze security-related HTTP headers on any URL with graded guidance to harden responses.
- JWT Encoder — Build HS256-signed JWTs from custom header and payload for API and auth testing.
- SSL Certificate Decoder — Paste PEM certificates to read subject, issuer, SANs, and validity windows.
- .htaccess Generator — Assemble common Apache .htaccess rules for redirects, HTTPS, caching, and access control.