HMAC Generator

Create an HMAC of a message with a secret key using MD5, SHA-1, SHA-256, SHA-384 or SHA-512, as hex or Base64. Useful for signing and checking webhooks and API requests.

Processed on your device. Files are not uploaded

How to make an HMAC

  1. Paste your message

    The exact text to be signed, including any whitespace.

  2. Enter the secret key

    Say whether the key is written as plain text, hex or Base64.

  3. Choose the algorithm

    SHA-256 is the usual. MD5, SHA-1, SHA-384 and SHA-512 are also available.

  4. Pick the output and copy

    Hex, Base64 or Base64URL.

    The receiver recomputes this with the same key to check the message.

Worked example

This is what HMAC Generator gives for its own sample values. Open the tool above and change anything to try your own.

Message

{"event":"order.created","id":42}
Secret key
my-secret
Key is written as
Plain text
Algorithm
SHA-256
Write the result as
Hex

HMAC

dc922e2d71c177ef9faac2415c3a04402274b6408ee9c0ba8ea5264b6327695b

About HMAC Generator

An HMAC is a signature made from a message and a shared secret. It is used to sign API requests and webhooks, so the receiver can check that the message is genuine and unchanged. MD5, SHA-1, SHA-256, SHA-384 and SHA-512 are supported.

FAQs

How do I check a webhook signature?

Make an HMAC of the exact raw body with your secret and compare it with the signature header, using a constant-time comparison in your code.

Which algorithm should I use?

SHA-256, unless the service tells you otherwise.

Is my key sent anywhere?

No. It stays in your browser.

Related tools