HMAC Generator
Enter a message and a secret key, pick a hash algorithm and get the HMAC in both hex and Base64. It is built for signing and verifying webhooks and API requests.
Use the tool
Why this tool exists
HMAC proves that a message came from someone who holds a shared secret and was not changed on the way. Payment providers, Git hosts and chat platforms sign their webhooks this way, and many APIs expect an HMAC signature on every request.
When a signature check fails, you want to calculate the expected value yourself and compare. This tool computes the HMAC from your exact message and key, shown in hex and in Base64, so you can match whichever format the service documents. It runs in your browser, so your test secret is not sent anywhere. Use test keys while debugging, not live production secrets.
How to use it
- Paste the message (the exact payload bytes you were sent) into the Message box.
- Enter the shared secret in the Secret key box.
- Choose the algorithm, for example SHA-256.
- Copy the hex or Base64 value and compare it with the signature you received.
Frequently asked questions
Why does my HMAC not match the webhook signature?
The most common cause is a message that differs by one byte: reformatted JSON, changed whitespace or a trailing newline. Sign the raw request body exactly as received, and check you used the right secret, algorithm and output format.
Which algorithm should I use?
Use whatever the service specifies, most often SHA-256. For new designs choose SHA-256 or stronger. HMAC-MD5 and HMAC-SHA1 are still considered usable for message authentication, but they are legacy choices.
Is it safe to paste my real secret here?
The calculation happens in your browser and nothing is uploaded. Even so, prefer test keys while debugging, and rotate any secret you have pasted into a page that you cannot fully trust.
What is the difference between a plain hash and an HMAC?
A plain hash can be computed by anyone who has the message. An HMAC mixes in a secret key, so only someone with the key can produce or verify it. That is what makes it an authentication code.