HMAC Generator and Verifier

Generate or verify HMAC message authentication codes with SHA-256, SHA-384, SHA-512, or legacy SHA-1. Choose exact text, Hex, or Base64 bytes and output format.

Generate or verify a message authentication code

HMAC combines the exact bytes of a message with a shared secret key and a hash algorithm. Use the same key, message bytes, and algorithm on both sides to get a matching MAC.

This tool computes HMAC with browser Web Crypto. Its controls do not put your values in the page URL or browser storage. The shared site shell may load separate analytics and advertising scripts, so do not enter keys your organization forbids sharing with this site.

HMAC inputs

Limit: 1,048,576 bytes. Whitespace and line endings are part of the message.

Limit: 65,536 bytes. Key length alone does not measure randomness or strength.

Optional MAC verification

Enter an expected MAC to compare it with these exact message and key bytes. Generic HMAC verification does not reconstruct a provider's webhook payload or validate timestamps and replay rules.

Not checked

Generated MAC

How to use the HMAC generator

  1. Enter the message and shared secret key. Choose Text (UTF-8), Hex, or Base64 to define the bytes for each value.
  2. Select the HMAC hash and output format, then choose Generate HMAC.
  3. To compare a MAC, paste it into Expected MAC, choose its format, and select Verify expected MAC.

For example, RFC 4231 test case 2 uses key Jefe and message what do ya want for nothing?. HMAC-SHA-256 returns 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843.

HMAC is a message authentication code for parties sharing a secret. It is not encryption, password hashing, or a public-key digital signature. A normal text entry is encoded as UTF-8; JSON reformatting, whitespace, line endings, and binary-key interpretation can all change the MAC.

HMAC generator FAQ

What is the difference between HMAC and a hash?

A plain hash uses the message alone. HMAC combines message bytes with a shared secret key, so holders of that key can create and check the same authentication code.

Does a matching HMAC verify a webhook?

It verifies only the bytes and key you supplied. Webhook providers may sign a timestamp and exact raw request body in a provider-specific format, and may enforce replay protection. This generic comparison does not perform those protocol checks.

Why can my HMAC differ from another tool?

Check the algorithm, key bytes, message bytes, line endings, whitespace, JSON serialization, and output encoding. Hex and Base64 key modes decode bytes; Text mode encodes the characters as UTF-8.

What does “Not checked” mean?

No expected MAC has been compared yet. Generation creates a MAC, while verification is a separate action that reports whether your expected MAC matches.

Should I use SHA-1?

SHA-1 is included only for legacy compatibility. Prefer SHA-256 or SHA-384/512 when the system you are integrating with supports them.

Infinio Tools
© 2026 Infinio Labs