HMAC generator and verifier
Create an HMAC (hash-based message authentication code) for any message and secret key, or check that a signature you received is correct. Choose SHA-256, SHA-512, SHA-384 or SHA-1, enter the key as text, hex or Base64, and get the signature in hex, Base64 or Base64url. The verify box accepts GitHub's sha256= header and Stripe's Stripe-Signature header as they are, which makes it useful for debugging webhooks. Everything runs with your browser's built-in Web Crypto, so keys and payloads are never uploaded.
Key format
Algorithm
Output
Enter a secret key to compute the HMAC.
Verify a signature
Paste a signature in hex or Base64, a GitHub header (sha256=…) or a Stripe-Signature header (t=…,v1=…).
How to use the HMAC Generator
- 1
Paste the message
Paste the exact payload, such as the raw webhook body. Every byte matters, including spaces and line breaks.
- 2
Enter the secret key
Type the shared secret and choose whether it is plain text, hex or Base64.
- 3
Choose the algorithm and output
Pick SHA-256 (the usual choice) or another hash, and hex or Base64 output.
- 4
Verify a signature (optional)
Paste a received signature or header to see whether it matches.
How HMAC works
HMAC (RFC 2104) combines a secret key with a hash function, so only someone with the key can produce or check the signature. The key is padded to the hash's block size and mixed with two constants before hashing twice.
Stripe signs the text 'timestamp.payload' rather than the payload alone; when you paste a Stripe-Signature header, the timestamp is taken from it automatically.
- HMAC(K, m) = H((K′ ⊕ opad) ‖ H((K′ ⊕ ipad) ‖ m))
When to use it
- Debug why a GitHub, Stripe, Shopify or Slack webhook signature check fails.
- Sign API requests while testing an integration.
- Check test vectors when implementing HMAC in your own code.
Limits
- The message is treated as UTF-8 text; for binary payloads, sign them in your own code.
- A matching signature proves the sender knew the key and the message wasn't changed. It doesn't prove the message is recent; check timestamps to stop replay attacks.
- SHA-1 is offered for old systems; prefer SHA-256 for anything new.
Privacy
Signatures are computed in your browser with Web Crypto. Your keys and messages are never sent anywhere.
Frequently asked questions
What is an HMAC?
A short signature computed from a message and a secret key. Anyone with the same key can recompute it to check that the message is genuine and unchanged.
Is HMAC the same as a hash?
No. A plain hash such as SHA-256 can be computed by anyone. An HMAC also needs the secret key, so it proves who created it.
Why doesn't my webhook signature match?
Usually the payload is not byte-for-byte the same: frameworks often parse and re-serialise JSON, changing spaces or key order. Sign the raw request body exactly as received.
How do I verify a GitHub webhook?
Paste the raw body as the message, your webhook secret as the key, choose SHA-256 and paste the X-Hub-Signature-256 header (sha256=…) into the verify box.
How do I verify a Stripe webhook?
Paste the raw body, your endpoint secret (whsec_…) as a text key, and the whole Stripe-Signature header. The tool signs 'timestamp.body' as Stripe does.
Hex or Base64 output?
They are the same bytes written differently. GitHub and Stripe use hex; Shopify and many APIs use Base64.
Is it safe to paste my secret key here?
The key is processed only in your browser and never transmitted. For production secrets, prefer testing with a rotated or test-mode key anyway.
Related tools
People also use
- Phishing URL CheckerCheck a suspicious link for phishing tricks such as look-alike brand names and punycode, without opening it.
- SSH Key GeneratorMake an Ed25519 or RSA SSH key pair in OpenSSH format, with its fingerprint, without installing anything.
- 2FA / TOTP Code GeneratorGet 6-digit 2FA codes from a secret or QR code, create test secrets and check codes, all in your browser.
- Bcrypt & Argon2 Hash GeneratorCreate and check bcrypt and Argon2 password hashes, with parameters compared to OWASP guidance.
Last updated November 21, 2026 · How we build and test our tools