HMAC Generator

Generate a keyed-hash message authentication code (HMAC) using SHA-256, SHA-384, or SHA-512. Your secret key never leaves your browser.

Privacy: All processing happens in your browser via the Web Crypto API. Your secret key is never sent to our servers.

What Is HMAC?

HMAC (Hash-based Message Authentication Code) is a specific type of message authentication code involving a cryptographic hash function and a secret key. It provides both data integrity (the message hasn't changed) and authentication (the sender knows the secret key). The formula is: HMAC(K, m) = H((K' ⊕ opad) || H((K' ⊕ ipad) || m)) where K is the key, H is the hash function, and opad/ipad are fixed padding constants.

Common HMAC Use Cases

Choosing an Algorithm

Worked Example

Message: message
Key: secret
HMAC-SHA256: 8b5f48702995c1598c573db1e21866a9b825d4a794d169d7060a03605796360b

Also try our AES Encryption tool for symmetric message encryption →

Awesome findWhatIsMyIP Blog

Frequently asked questions

What is the difference between a hash and an HMAC?

A plain hash proves data integrity; an HMAC also proves authenticity because it mixes in a secret key. Only someone with the key can produce or verify a valid HMAC, so it detects tampering by a third party.

What are HMACs used for?

Signing API requests and webhooks, verifying JWTs that use HS256/384/512, and message authentication inside TLS and other protocols.

Does my secret key leave the browser?

No. The key and message are processed locally with the Web Crypto API and are never sent to the server.