Developer tool

HMAC generator

Sign a message with a secret key. Nothing is transmitted.

HMAC generator Runs on your device
  • Runs in your browser — your text is never sent anywhere
  • No sign-up, no quotas, free to use as often as you like

How it works

An HMAC proves two things at once: that a message has not been altered, and that whoever produced it holds the shared secret. It is what signs webhooks, API requests and download links across most of the web.

Different from a plain hash, in the way that matters

Anyone can compute SHA-256 of a message, so a bare hash proves nothing about who made it — change the message, recompute the hash, and nobody can tell. An HMAC folds a secret key into the calculation, so it cannot be recomputed without the key. That is the entire point, and it is why webhook signatures use HMAC rather than a hash.

Verifying safely

When you check an HMAC on a server, compare it with a constant-time function — crypto.timingSafeEqual in Node, hash_equals in PHP. An ordinary == returns as soon as two bytes differ, and the time it takes leaks how much of the signature was right, which is enough to forge one given patience. It is a real attack, not a theoretical one.

Which algorithm

SHA-256 unless something specifies otherwise. SHA-1 is included because plenty of older APIs still require HMAC-SHA-1, and HMAC-SHA-1 has not been broken the way plain SHA-1 has — but there is no reason to choose it for something new.

Hex or Base64

Purely a matter of what the other side expects. Hex is twice as long and easier to read; Base64 is more compact and common in HTTP headers. The same signature is shown in both.

Your key stays here

Generated with the browser's own Web Crypto API. The key and the message are never sent anywhere, which is the only responsible way to offer this — a signing tool that uploads your secret has handed away the thing the secret protects.

FAQ

HMAC generator — questions

How is HMAC different from a hash?

A hash can be recomputed by anyone. An HMAC needs the secret key, so it proves who produced it.

Which algorithm should I use?

SHA-256 unless an API specifies otherwise. SHA-1 is offered for older systems that still require it.

Should I use hex or Base64?

Whichever the other side expects. Both are shown for the same signature.

Why does comparison have to be constant-time?

A normal comparison exits early on the first mismatch, and the timing difference leaks how much was correct — enough to forge a signature.

Is my secret key sent anywhere?

No. Everything runs in your browser through the Web Crypto API.