CalculatorsConvertersDeveloperTextAll toolsDirectory
Submit your tool Sign in
Theme
Home/Answers/Security
How-to

How do I create an HMAC signature for a webhook payload?

Short answer

Paste the payload and your shared secret into a browser-based HMAC generator and pick a hash like SHA-256 to compute the keyed signature. It uses the Web Crypto API on your device, so the payload and secret are never sent to a server.

Why webhooks use HMAC

A webhook receiver needs to know a request really came from the expected sender and was not tampered with. HMAC solves this: the sender computes a keyed hash of the payload using a shared secret and includes it as a signature, and the receiver recomputes the same HMAC and compares. Because only the two parties know the secret, a matching signature proves authenticity and integrity.

Compute or verify a signature locally

A client-side HMAC generator lets you paste a payload and secret and get the SHA-256, SHA-384 or SHA-512 signature in your browser, so neither the payload nor the secret leaves your machine. That is useful for testing that your own signing code produces the right value. It is free and needs no account.

Step by step

  1. Open the HMAC generator. Open the HMAC generator in your browser.
  2. Enter payload and secret. Paste the message payload and the shared secret key.
  3. Choose the hash. Pick SHA-256, SHA-384 or SHA-512 and read the resulting signature.

Frequently asked questions

What does an HMAC prove?

A matching HMAC proves the payload was not altered and came from someone holding the shared secret.

Is my secret sent anywhere?

No. The HMAC is computed in your browser with the Web Crypto API, so nothing is uploaded.

Which hash should I use?

Match whatever your receiver expects; SHA-256 is the most common choice.

Related answers