Skip to content

HMAC GeneratorNew

Create and verify HMAC-SHA256, SHA512, SHA384 or SHA1 signatures.

Runs in your browser · free · no sign-up

HMAC-SHA-256 (Hex)

About the HMAC Generator

Check webhook signatures, test API request signing or learn how HMAC works, with the result updating as you type.

An HMAC (hash-based message authentication code) proves two things about a message: that it came from someone who knows a shared secret key, and that it was not changed on the way. Payment gateways, Shopify, Stripe, GitHub, Slack and many other services sign their webhooks with HMAC-SHA-256, and many APIs require you to sign your requests the same way.

This generator computes HMAC with SHA-256, SHA-512, SHA-384 or SHA-1 as you type. Enter the message exactly as it was sent, the secret key as plain text or as hexadecimal bytes, and choose hex or Base64 output to match the documentation you are following. To debug a failing integration, paste the signature you received into the comparison box: the page tells you immediately whether the two match.

The classic test vector is a good check: the message “The quick brown fox jumps over the lazy dog” with the key “key” gives f7bc83f4…d8 with HMAC-SHA-256. If your code produces the same value, your implementation is correct and any mismatch lies in how the message is captured.

All calculations use your browser’s Web Crypto engine, or the open-source noble-hashes library on plain-HTTP hosts, so keys never leave your device. Never paste a live production secret on a shared or public computer.

How to use the HMAC Generator

  1. 1Paste the message (for webhooks: the raw request body).
  2. 2Enter the secret key as text or hex and choose the algorithm.
  3. 3Copy the signature or paste an expected one to compare.

Key features

  • HMAC-SHA-256, SHA-512, SHA-384 and SHA-1.
  • Text or hex keys.
  • Hex or Base64 output.
  • Instant comparison with an expected signature.

Practical uses

  • Verifying webhook signatures from payment gateways.
  • Testing API request signing.
  • Teaching how message authentication works.

Tips and common mistakes

  • Use the raw request body, not re-formatted JSON.
  • Strip prefixes such as “sha256=” before comparing.
  • Compare signatures in constant time in production code.

Limitations

  • Messages are treated as UTF-8 text; binary payloads must be pasted as text.
  • HMAC with MD5 is not offered.

Privacy

Messages and keys stay in your browser.

Frequently asked questions

What is HMAC?

A hash-based message authentication code: a hash of the message mixed with a secret key, so only someone with the key can produce or check it.

Why does my webhook signature not match?

Most often the message is not byte-for-byte the raw body (extra spaces, re-formatted JSON) or the provider expects hex vs Base64, or a prefix such as “sha256=”.

Is HMAC-SHA1 still safe?

HMAC-SHA1 is still considered secure, but prefer SHA-256 for new systems.

Is my key sent anywhere?

No. The signature is computed in your browser.

Related tools

AES Text EncryptionNewEncrypt and decrypt text with a password (AES-256-GCM).
AES File EncryptionNewPassword-protect any file as an encrypted .enc file.
Salted Hash GeneratorNewHash text with a salt (SHA-256/512) or derive a PBKDF2 key.
TOTP Code GeneratorNewLive 2FA codes from a secret key, plus an authenticator QR code.