Compute HMAC-SHA256, HMAC-SHA512, HMAC-SHA1 or HMAC-MD5 of a message with a secret key, to test webhook and API signatures
Sign a message with a secret key using HMAC-SHA256 and friends, to debug webhook signatures and signed API requests.
How to use it
Paste the exact message (for webhooks: the raw request body, byte for byte). Enter the secret key. Paste the signature you received under the list to check it, in hex or Base64.
Examples
HMAC-SHA256
Input
Message: The quick brown fox jumps over the lazy dog Key: key
Result
f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8
RFC 4231 test case 2 (HMAC-SHA256)
Input
Message: what do ya want for nothing? Key: Jefe
Result
5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843
The standard’s own test vector: any HMAC-SHA256 that gives a different result is broken.
Why webhook signatures don’t match
The body was parsed and re-serialized. Sign the raw bytes exactly as received. Wrong encoding: some providers send hex, others Base64, sometimes with a prefix like "sha256=". The compare field leaves a prefix like that out and reads both encodings. The signed string includes more than the body, e.g. a timestamp: "t=…" + "." + body. A test secret is used against live events, or the reverse.
What GitHub, Stripe, Slack and Shopify sign
| Provider | Header | Message signed | Output |
|---|---|---|---|
GitHub | X-Hub-Signature-256: sha256=… | the raw body | hex |
Stripe | Stripe-Signature: t=…,v1=… | t value + "." + raw body | hex (v1) |
Slack | X-Slack-Signature: v0=… | "v0:" + X-Slack-Request-Timestamp + ":" + raw body | hex |
Shopify | X-Shopify-Hmac-Sha256 | the raw body | Base64 |
Sources: GitHub: validating webhook deliveries, Stripe: verify signatures manually, Slack: verifying requests, Shopify: verify webhooks, RFC 4231: HMAC-SHA test vectors
Questions
- Is my text or file uploaded?
No. Everything runs in your browser, so your data stays on your device. Nothing you paste is uploaded unless you share it. SHA-1 and SHA-2 come from your browser’s Web Crypto API, the others from open-source code loaded with the page (the SHA-3, BLAKE and RIPEMD families from the audited @noble/hashes), which matters when you hash passwords or keys. - Is the key stored?
No. The key stays in this tab, and text hashed with a key is not kept in recent work. HMAC-SHA uses your browser’s Web Crypto API; HMAC-MD5 is worked out by the page. - Why doesn’t my HMAC match the webhook’s signature?
Almost always one of four things: the body was parsed and written out again instead of signed as the raw bytes received; the encoding differs (hex or Base64, sometimes with a prefix such as sha256=); the signed text holds more than the body, as Stripe’s timestamp, a dot and the body; or a test secret meets live events.