HMAC Generator and Webhook Signature Checker
Compute an HMAC of a message with a secret key using SHA-1, SHA-256 or SHA-512, and compare it with the signature a webhook provider sent you. The result is shown in hex and in Base64.
Runs in your browser: your files and text are not uploaded. Free, no account needed.
Last updated: · Reviewed by the QuickTooly Team
What is computed
The tool uses the browser's Web Crypto API (crypto.subtle) to compute HMAC as defined in RFC 2104. The message and the key are both encoded as UTF-8 text before signing. The output length depends on the hash: 20 bytes for SHA-1 (40 hex characters), 32 bytes for SHA-256 (64 hex) and 64 bytes for SHA-512 (128 hex). SHA-384 and MD5 are not offered.
Because the key is read as text, a secret that your provider gives you in hex or Base64 is used as those characters, not as the bytes they encode. That matches how GitHub, Stripe and Slack use their webhook secrets. If your own system decodes the key first, the results will differ.
Checking a webhook signature
Paste the raw request body exactly as it arrived. Re-formatted or re-serialized JSON, a changed key order or an added newline all produce a different HMAC. Some providers sign more than the body:
- GitHub: HMAC-SHA256 of the body. The
X-Hub-Signature-256header looks likesha256=<hex>; you can paste it with the prefix. - Stripe: HMAC-SHA256 of
<timestamp>.<body>, using thetvalue from theStripe-Signatureheader. Paste only thev1value, not the whole header. - Slack: HMAC-SHA256 of
v0:<timestamp>:<body>. Thev0=prefix on the signature is removed before comparing.
The checker compares against the last HMAC you generated. After you change the message, key or algorithm, click Generate HMAC again. Hex signatures are compared without regard to letter case. Base64 signatures, such as Shopify's X-Shopify-Hmac-Sha256, are compared exactly, because upper and lower case letters mean different bytes in Base64.
In your own server code, compare signatures with a constant-time function (for example crypto.timingSafeEqual in Node.js or hmac.compare_digest in Python), not with ==.
Frequently Asked Questions
Why do I get a different HMAC than my code?
Usually the input differs: a trailing newline, Windows line endings (the text box stores line breaks as LF only), a re-formatted JSON body, or a key that your code decodes from hex or Base64 before use. Also check that both sides use the same hash.
Is SHA-1 still safe for HMAC?
HMAC-SHA1 has no known practical attack, and some older APIs still require it. For new systems use HMAC-SHA256.
Related Tools
- JWT Builder - HS256 tokens are an HMAC-SHA256 over the header and payload; build one with a test secret.
- File Hash Calculator - a plain SHA-256 or SHA-512 checksum of a file, with no key.
- Bcrypt Generator - for storing passwords, which HMAC is not designed for.