HMAC Generator (SHA-256, SHA-512…)

Compute an HMAC signature from a message and a secret key — for example to check a webhook signature from Stripe, GitHub or Shopify while debugging, or to build a signed API request by hand.

Your secret key and message stay in your browser. Nothing is sent or stored.

Compare with a signature

How to generate an HMAC

  1. Paste the message exactly as it was signed — for webhooks, that is the raw request body, byte for byte. Re-formatting JSON (adding or removing spaces) changes the signature.
  2. Enter the secret key. Most services give you a text secret; choose Hex or Base64 if your key is in one of those encodings.
  3. Pick the output format your service uses. The HMAC is calculated with all five algorithms at once.
  4. Paste a received signature into Compare to see whether it matches and which algorithm produced it.

What HMAC is and where it’s used

HMAC (hash-based message authentication code, RFC 2104) combines a cryptographic hash with a secret key. Only someone who knows the key can produce the right code for a message, so the receiver can check that the message came from the sender and wasn't changed on the way. Unlike a plain hash, an attacker can't recompute it after tampering with the message.

ServiceTypical scheme
Stripe webhooksHMAC-SHA256 of timestamp.body, hex, in the Stripe-Signature header
GitHub webhooksHMAC-SHA256 of the body, hex, X-Hub-Signature-256: sha256=…
Shopify webhooksHMAC-SHA256 of the body, Base64, X-Shopify-Hmac-Sha256
AWS Signature v4, JWT HS256HMAC-SHA256 (with their own message format)

Exact formats are defined in each provider's documentation and can change; check it when a signature doesn't match.

When signatures don’t match

In production code, compare signatures with a constant-time function (such as crypto.timingSafeEqual in Node.js or hmac.compare_digest in Python), not with ==.

Frequently asked questions

Is my secret key sent anywhere?

No. The HMAC is computed with your browser’s Web Crypto API (and our own MD5 implementation for HMAC-MD5) on your device. The page has no code that transmits it.

Which algorithm should I use?

HMAC-SHA256 is the standard choice and what most APIs expect. HMAC-SHA512 is equally fine. HMAC-SHA1 and HMAC-MD5 are still considered secure as MACs but are only worth using for compatibility with older systems.

What is the difference between a hash and an HMAC?

Anyone can compute a hash of a message. An HMAC also requires a secret key, so it proves the message was produced by someone who knows the key and hasn’t been altered.

Can I use an empty key?

Yes; HMAC is defined for empty keys, and the tool computes it, but it provides no security. It can be useful to reproduce test vectors.