About the HMAC Generator tool
An HMAC (hash-based message authentication code) proves that a message came from someone who knows a shared secret and that it was not changed on the way. Payment providers, GitHub, Shopify and Slack sign their webhooks with HMAC-SHA256, and many APIs require requests to be signed the same way. When a signature check fails, you need a quick way to compute the expected value yourself.
Type or paste the exact message and the secret key, and this generator calculates HMAC-SHA1, HMAC-SHA256, HMAC-SHA384 and HMAC-SHA512 at the same time using your browser’s built-in Web Crypto API. The key can be entered as plain text, hex or Base64, since many services hand out secrets as hex or Base64 bytes, and the output can be lowercase hex, uppercase hex, Base64 or URL-safe Base64URL.
Paste a signature from a request header into the comparison box and the matching algorithm is highlighted, which quickly tells you whether the problem is the secret, the encoding or the message itself, for example a re-serialised JSON body or a missing trailing newline. The message is signed exactly as typed, as UTF-8. Keys and messages never leave your device.
How to use HMAC Generator
- Paste the payload into “Message” exactly as it was sent, or click “Load sample webhook”.
- Enter the “Secret key” and choose its “Key format”: text, hex or Base64.
- Choose the “Output” encoding to match the signature you are checking.
- Copy the HMAC you need, or paste an expected value into “Compare with an expected signature”.
Features
Four algorithms at once
HMAC-SHA1, SHA-256, SHA-384 and SHA-512 are computed side by side.
Flexible key input
Use a text secret or raw key bytes in hex or Base64.
Hex and Base64 output
Lowercase or uppercase hex, standard Base64 or URL-safe Base64URL.
Signature comparison
Highlights which algorithm matches a signature you paste in.
Native Web Crypto
Uses the browser’s own audited HMAC implementation, not a hand-written one.
When to use it
- Debug a failing Stripe, GitHub or Shopify webhook signature check.
- Sign test requests for an API that requires HMAC authentication.
- Verify HMAC test vectors while implementing signing in a new language.
- Compute an HS256 signature component when learning how JWTs work.
Frequently asked questions
What is the difference between a hash and an HMAC?
A hash like SHA-256 can be computed by anyone. An HMAC mixes in a secret key, so only someone who knows the key can create or verify the value.
Why doesn’t my signature match?
The most common reasons are a message that differs by whitespace or JSON key order, a secret entered as text when it should be hex or Base64, or comparing hex with Base64 output. Sign the raw request body exactly as received.
Which algorithm should I use?
HMAC-SHA256 is the most common choice and is considered secure. HMAC-SHA1 is still safe as an HMAC but is mainly used for older integrations.
Is an empty key allowed?
Yes. Following RFC 2104, an empty key is treated as a block of zero bytes, so the tool still produces the standard result.
Is my secret key sent anywhere?
No. The HMAC is computed with the Web Crypto API inside your browser tab.