01What is HMAC Generator?
HMAC Generator computes a keyed hash of a message, the kind webhook providers and signed APIs put in a request header. You give it a secret key and a message, pick HMAC-SHA256, HMAC-SHA384 or HMAC-SHA512, and it prints the signature. HMAC is defined in RFC 2104. In short, the key is mixed into the hash twice, once before the message and once after, so nobody without the key can produce a matching value. The tool imports your secret as a raw HMAC key with the browser's Web Crypto API and calls crypto.subtle.sign. Both the message and the secret are encoded as UTF-8 bytes first. That matches crypto.createHmac('sha256', secret).update(message) in Node.js and hmac.new(secret.encode(), message.encode(), hashlib.sha256) in Python. We checked it against the RFC 4231 test case with the key Jefe and against Node's crypto module, including non-ASCII text. The result refreshes about 300 ms after you stop typing. Output can be lowercase hex or Base64, because providers disagree. GitHub's X-Hub-Signature-256 header holds hex after a sha256= prefix, while Shopify's webhook header holds Base64. Pick the one your provider documents and compare the strings directly. A worked example. With the secret key and the message The quick brown fox jumps over the lazy dog, HMAC-SHA256 in hex is f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8. Flip Format to Base64 and the same 32 bytes read 97yD9DBThCSxMpjmqm+xQ+9NWaFJRhdZl0edvC0aPNg=. Switch to HMAC-SHA512 and you get 64 bytes, or 128 hex characters. Where this earns its keep is debugging. When your verification code says a signature is wrong, you can paste the raw body and the secret here and see what the correct value should be. If it matches the header, your code is hashing different bytes. If it doesn't, you probably have the wrong secret. Now the limits. A secret is required, and the tool shows Secret key is required instead of computing with an empty key. The key is always treated as text. If your provider hands you a hex or Base64 secret that is meant to be decoded to bytes first, the result here won't match. There is no SHA-1 or MD5 option, so older schemes like HMAC-SHA1 for OAuth 1.0 are out. The tool signs only. It doesn't parse headers, strip prefixes or check timestamps. Your key and message stay in the page's memory and Web Crypto. Nothing is posted to a server.
Backend developers who need to reproduce a webhook or API request signature by hand when their verification code and the provider disagree. The tool runs entirely in your browser, so your data never leaves your device.
02How to use HMAC Generator
- Enter the shared secret in Secret Key.
- Paste the exact bytes you want to sign into Message, such as the raw webhook request body.
- Choose an Algorithm: HMAC-SHA256, HMAC-SHA384 or HMAC-SHA512.
- Set Format to Hex or Base64 to match the provider's header.
- Copy the result and compare it with the signature you received. Use Reset to clear everything.
03Worked examples
- Input:
Secret: key, Message: The quick brown fox jumps over the lazy dog, HMAC-SHA256 - Result:
Hex: f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8 Base64: 97yD9DBThCSxMpjmqm+xQ+9NWaFJRhdZl0edvC0aPNg= - Hex and Base64 are the same 32 bytes written two ways.
- Input:
Secret: Jefe, Message: what do ya want for nothing?, HMAC-SHA256 - Result:
5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843 - This is test case 2 from RFC 4231, handy for checking your own implementation.
- Input:
Secret: key, empty Message, HMAC-SHA256 - Result:
5d5d139563c95b5967b9bd9a8c9b233a9dedb45072794cd232dc1b74832607d0 - An empty message still has a well-defined HMAC. Only the key is required.
- Input:
Secret: key, Message: hello, HMAC-SHA384 - Result:
eacbad575c301fa68afb26dae48b25bf5cd42fd08ed28c08c274ce62df7928f01249976cd8aaf1ab0681d3accedc9543 - 48 bytes, 96 hex characters.
- Input:
Secret: key, Message: hello, HMAC-SHA512 - Result:
ff06ab36757777815c008d32c8e14a705b4e7bf310351a06a23b612dc4c7433e7757d20525a5593b71020ea2ee162d2311b247e9855862b270122419652c0c92 - 64 bytes, 128 hex characters.
04Common use cases
- Reproducing a GitHub or Shopify webhook signature to find out why your verification fails
- Checking that your server and client compute the same HMAC-SHA256 for a test payload
- Generating expected values for unit tests of a request-signing helper
- Confirming whether a provider wants hex or Base64 by comparing both against a header you captured
- Signing the payload of a simple signed URL or token scheme during development
- Rotating a webhook secret and checking that the new one produces the signature the provider sends
05Tips
- Sign the raw request body, not a re-serialised JSON object. Re-formatting changes whitespace and key order, and the HMAC will no longer match.
- Strip the sha256= prefix from GitHub's header before comparing. The tool outputs only the digest.
- Some providers sign more than the body. Stripe signs the timestamp, a dot and the payload together, so build the message exactly as their docs say.
- In your own code, compare signatures with a constant-time function such as crypto.timingSafeEqual or hmac.compare_digest rather than ==.
- RFC 2104 recommends a key at least as long as the hash output, so use 32 or more random bytes for HMAC-SHA256.
06Related concepts
RFC 2104, Message authentication code, Webhook signature, Constant-time comparison.
Frequently Asked Questions
What is HMAC Generator?
HMAC Generator is a free, browser-based developer tool on AIDToolStack. Generate HMAC-SHA256/384/512 message authentication codes using Web Crypto It requires no installation or sign-up and works entirely in your browser.
Is HMAC Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does HMAC Generator store my data?
No. It runs in your browser; nothing is uploaded.