How Do You Generate an HMAC Online?

Updated 2026-06-27

To generate an HMAC online, paste your message and secret key into the HMAC Generator, choose a hash algorithm like SHA-256, and read the result in hex or Base64 — all computed in your browser using the Web Crypto API, with nothing uploaded.

An HMAC (hash-based message authentication code) proves two things at once: that a message has not been tampered with, and that it came from someone who holds the shared secret key. It is the mechanism behind webhook signatures (Stripe, GitHub, Shopify), signed API requests, and many token formats.

How to compute an HMAC step by step

Why key encoding matters most

The single biggest reason two HMACs disagree is the key encoding. The string 5365637265744b6579 is nine bytes when read as hex but eighteen bytes when read as UTF-8 text, and those two interpretations produce completely different HMACs. If your server stores the key as raw random bytes (often shown as Base64 or hex), select the matching encoding here rather than leaving it on UTF-8. The live byte count next to the key field is your sanity check: if the number does not match the key length your backend expects, the encoding is wrong.

Hex vs Base64 output

Both outputs encode the exact same bytes — they are just two ways of writing them down. Webhook headers such as X-Hub-Signature-256 typically use hex, while many cloud APIs expect Base64. Because the tool shows both at once, you never have to convert manually; just copy the format the other system wants.

Privacy: it runs entirely in your browser

Unlike server-side HMAC tools, the HMAC Generator computes everything locally with the browser's native Web Crypto API. Your message and secret key never leave the page and are never uploaded. That makes it safe to paste a real production webhook secret or signing key, and it keeps working offline once the page has loaded.

A quick verification workflow

If you only need a plain digest or checksum of a file or string — without a secret key — reach for the Hash & Checksum Generator instead, which covers MD5, SHA-1/256/512, and CRC32 with a built-in verify mode. HMAC is the right choice specifically when authentication with a shared secret is required, not just integrity.

Try the HMAC Generator →