About the HMAC Generator
This HMAC Generator signs messages using HMAC-SHA-256, SHA-1, SHA-384 or SHA-512 via the browser Web Crypto API. Developers and ops people use it to debug webhooks, test API signatures, or confirm expected digests. You provide the message and the secret key as plain text, hex or Base64. The tool returns the HMAC in hex and Base64. All work runs in your browser; nothing is uploaded to a server and no installation is required. The implementation follows the standard HMAC construction from RFC 2104 and uses SubtleCrypto.importKey and SubtleCrypto.sign (Web Crypto). That makes the tool straightforward for testing provider formats like Shopify or Stripe, and safer for secrets because the computation stays local to your device.
How to use it
- 1Enter the message or payload to sign.
- 2Enter the secret key and pick its encoding: text, hex or Base64.
- 3Choose the hash algorithm: SHA-1, SHA-256, SHA-384 or SHA-512.
- 4Click Generate and copy the HMAC in hex or Base64.
Worked example
Input: message = "Hi There" Key (hex) = 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b Algorithm = SHA-256 Output (hex) = b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7
How it works
Signs a message with a secret key using HMAC-SHA-256, SHA-1, SHA-384 or SHA-512 (Web Crypto API)Key as text, hex or Base64; output in hex and Base64Works in the browser with nothing to installSource: RFC 4231 - Test Vectors for HMAC-SHA-256MDN Web Crypto API - SubtleCrypto.sign. Last checked 5 November 2026.
What it is good for
- Runs entirely in your browser; no data is uploaded.
- Accepts keys as text, hex or Base64 for matching provider formats.
- Outputs both hex and Base64 to match common API expectations.
- This tool only generates HMAC digests; it does not manage, store or rotate keys.
- Requires a modern browser with the Web Crypto API; older browsers may not support it.
Questions people ask
What is HMAC?
HMAC is a keyed hash that provides message integrity and authentication. It combines a secret key with a hash function using the construction defined in RFC 2104.
Which algorithm should I use?
Prefer SHA-256 or SHA-512 for new systems. Use the same algorithm your receiver expects; some older systems still use SHA-1, but SHA-1 is legacy.
Is it safe to paste my secret key here?
Only if the page runs fully in your browser and the site states it uses the Web Crypto API. This tool performs the signing client-side and does not upload keys, but do not paste production secrets into sites that do not state client-side operation.
Why does my webhook verification fail?
Common causes are using the wrong key, the wrong canonical input (the raw request body must match), the wrong hash algorithm, or the wrong output encoding (hex vs Base64). Check the provider docs for their exact signing format.
Should I use hex or Base64 for the HMAC output?
It depends on the receiver. Some services expect hex, others expect Base64. For example, Shopify expects Base64 HMAC-SHA256 in its webhook header; confirm in the receiver's docs.
Help keep every tool free
FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.