HMAC Generator
Generate an HMAC signature from a message and a secret key.
How to use the HMAC Generator
- Paste the message you want to sign.
- Enter the secret key both sides share.
- Pick an algorithm — HMAC-SHA-256 if you are unsure — and copy the result.
About the HMAC Generator
HMAC stands for Hash-based Message Authentication Code, defined in RFC 2104. It mixes a secret key into the hashing process, and that one addition changes what the output proves. A plain hash only proves that some data produced some digest — if an attacker can change the message, they can simply recompute the hash to match, and nothing looks wrong. With HMAC, they cannot produce a valid code without the key, so the recipient gets both integrity (the message wasn’t altered) and authenticity (it came from someone holding the key).
HMAC isn’t just "hash the key and the message together" — it uses a nested construction, hashing twice with two derived key values. That structure is what makes HMAC immune to the length-extension attack that affects raw SHA-256 and SHA-512, where an attacker who knows a digest can append data and compute a valid new digest without knowing the original input. It is a real reason naive hash(secret + message) schemes fail and HMAC does not.
You have almost certainly used HMAC without noticing. Webhook signatures from Stripe and GitHub are HMACs — the header you compare against is computed from the raw request body and your signing secret. AWS request signing uses it. So do JWTs signed with HS256, which you can pull apart with our JWT decoder. HMAC-SHA-256 is the usual default and the right pick for new work. HMAC-MD5 is an interesting case: it is still considered acceptable as a MAC despite MD5’s collision weakness, because HMAC’s security doesn’t rest on collision resistance — but there is no good reason to choose it for a new design.
Frequently asked questions
What is the difference between HMAC and a plain hash?
A plain hash proves nothing if an attacker can change the message, because they can recompute the hash too. HMAC folds in a secret key, so only someone with the key can produce a valid code — that gives you authenticity as well as integrity.
Which algorithm should I choose?
HMAC-SHA-256 unless something specific tells you otherwise — it is the common default for webhooks, API signing and JWT HS256.
Is HMAC-MD5 safe?
It is still considered acceptable as a MAC even though MD5 itself is broken for collisions, because HMAC does not rely on collision resistance. That said, do not pick it for a new design — use HMAC-SHA-256.
Why does my webhook signature not match?
Almost always because the message bytes differ. Sign the exact raw request body — not a re-serialised version — and check for a trailing newline or a different key encoding.
Are my message and key stored?
No. Both are sent to our server because browsers cannot compute most of these algorithms, then used for the calculation and discarded immediately — never logged, never stored. For a live production signing key, doing this on your own machine is still the safest habit.

