HMAC Generator

Keyed hashes with SHA-256, SHA-384 or SHA-512 for webhook signatures, API auth and token checks.
Client-side · verifiable
How this tool works

A plain hash proves a message has not changed. An HMAC (hash-based message authentication code) also proves it came from someone who holds a secret key. The construction, standardised in RFC 2104, is H((key ⊕ opad) ‖ H((key ⊕ ipad) ‖ message)): two nested hashes with the key mixed in, which is why HMAC-SHA1 stays secure even though SHA-1 collisions exist.

Where you meet it every day:

  • webhook signatures from Stripe, GitHub, Slack and Shopify
  • AWS Signature v4 request signing
  • JWT tokens with the HS256/HS384/HS512 algorithms
  • the TOTP codes in your authenticator app (HMAC-SHA1 of a time counter)

This page uses the Web Crypto API’s subtle.sign("HMAC"). Keys can be entered as text or, for binary keys, as hex.

Security note

What leaves your browser

Key and message stay in your browser. No request is made and nothing is stored. Paste production secrets only on a machine you trust, and rotate any key you have pasted anywhere else.

FAQ
What is the difference between a hash and an HMAC?

A hash has no key; anyone can compute it. An HMAC needs the key, so a valid HMAC proves the sender knows the secret and the message is intact.

How long should the HMAC key be?

At least as long as the hash output: 32 bytes for SHA-256. Longer keys are hashed down first, so there is no benefit beyond the block size (64 bytes).

Is HMAC-SHA1 still safe?

Yes. HMAC does not rely on collision resistance, which is the only broken property of SHA-1. New systems should still prefer SHA-256.

How do I verify a webhook signature?

Compute HMAC-SHA256 of the raw request body with your endpoint secret and compare it, in constant time, with the signature header. Use this page to check a sample by hand.