HMAC Generator and Webhook Signature Verifier

Enter a message and key to get an HMAC, or paste a webhook body, header and secret to see whether the signature matches and, if not, why. The key stays in your browser, and Node and Python code with a timing-safe compare is included.

Updated

Signed as typed, as UTF-8. For a webhook, paste the body exactly as it arrived, before any JSON parsing or formatting.

Stays in this tab and is never sent anywhere or shown in the results. Where you can, use a test-mode secret.

Webhook providers use the secret string as text, so presets always do.

Paste the header value, with or without the header name. Optional in plain mode; for the Stripe header, all lines at once are fine.

HMAC-SHA256, hex

f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8

256 bits

Verify it on your server (Node.js)

import crypto from "node:crypto";

// Compare in constant time. timingSafeEqual needs equal lengths, so check that first.
const safeEqual = (a, b) => { const x = Buffer.from(a), y = Buffer.from(b); return x.length === y.length && crypto.timingSafeEqual(x, y); };

export function hmac(message, key) {
  return crypto.createHmac("sha256", key).update(message).digest("hex");
}
Algorithm
HMAC-SHA256
Message size
43 bytes (UTF-8)
Key size
3 bytes
  • The key and message are processed in this tab by the Web Crypto API and are not sent anywhere. The key is not shown in the results.

How is an HMAC calculated, and how do webhook signatures use it?

An HMAC (RFC 2104) mixes a secret key into a hash of a message, so only someone who holds the key can produce the right value. This page does it with the browser's Web Crypto API: it imports your key, signs the message's UTF-8 bytes with HMAC and the hash you chose (SHA-256, SHA-384, SHA-512 or SHA-1), and shows the digest as hex or Base64. Your key and message stay in this tab and nothing is sent to a server.

A webhook provider signs what it sends with a secret the two of you share, and your server repeats the sum and compares. Each provider fixes what is signed. Razorpay signs the raw body with your webhook secret and sends hex in X-Razorpay-Signature; its payment signature is the HMAC-SHA256 of order_id|razorpay_payment_id with your API key secret. Stripe signs the timestamp, a dot and the raw body, and puts t= and one or more v1= entries in Stripe-Signature. GitHub sends sha256= and the hex digest of the raw payload in X-Hub-Signature-256. Shopify sends the Base64 digest of the raw body in X-Shopify-Hmac-Sha256. Slack signs v0:timestamp:body and sends v0= and the hex digest.

Most failures are about bytes, not the secret. The signature covers the raw body exactly as it arrived, so a framework that parses the JSON and re-serializes it, a trailing line break, different line endings or the wrong encoding all give a different digest. In a preset mode, if the signature does not match, this page tries those causes one by one and tells you which one reproduces your signature. Your own server must compare in constant time (crypto.timingSafeEqual in Node, hmac.compare_digest in Python) and, for Stripe and Slack, reject old timestamps.

HMAC(K, m) = H((K' xor opad) || H((K' xor ipad) || m))      (RFC 2104)
Razorpay webhook: HMAC-SHA256(rawBody, webhookSecret) → hex
Razorpay payment: HMAC-SHA256(order_id + "|" + payment_id, apiKeySecret) → hex
Stripe: HMAC-SHA256(t + "." + rawBody, signingSecret) → hex, compared with each v1
GitHub: "sha256=" + HMAC-SHA256(rawBody, secret) → hex      Shopify: → Base64
Slack: "v0=" + HMAC-SHA256("v0:" + timestamp + ":" + rawBody, signingSecret) → hex

What does each provider sign, and how is it sent?

Webhook signature rules as each provider documents them (docs read 2026-11-11)
ProviderHeaderSigned stringKeyDigestReplay check
Razorpay webhookX-Razorpay-Signatureraw bodywebhook secrethexnone documented on the page
Razorpay paymentrazorpay_signature (Checkout)order_id|razorpay_payment_idAPI key secrethexnone
StripeStripe-Signature (t=, v1=)timestamp + "." + raw bodyendpoint signing secret (whsec_…)hex, any v1 may matchtimestamp; libraries default to 5 minutes
GitHubX-Hub-Signature-256raw payloadwebhook secret tokensha256= + hexnone
ShopifyX-Shopify-Hmac-SHA256raw bodyapp client secretBase64none
SlackX-Slack-Signature + X-Slack-Request-Timestampv0:timestamp:bodysigning secretv0= + hexreject beyond 5 minutes

How to verify a webhook signature

  1. 1
    Pick the providerChoose the Razorpay, Stripe, GitHub, Shopify or Slack mode, or plain HMAC for any other message and key.
  2. 2
    Paste the raw body and the headerPaste the body exactly as your server received it (a request log or the provider's delivery view), then the signature header value. For Stripe paste the whole header; for Slack also enter the timestamp header.
  3. 3
    Enter the secretUse the secret the provider documents for that signature: the webhook secret, the endpoint signing secret or the API key secret. It stays in this tab.
  4. 4
    Read the verdictA match means your server's maths is right. A mismatch comes with the most likely cause: encoding, whitespace, line endings, re-serialized JSON or a wrong secret. Copy the Node or Python code for your own endpoint.

Frequently asked questions

Why does my webhook signature not match when the secret is correct?
Almost always the body is not byte-for-byte what was signed. Express's json() parser or any framework that parses and re-serializes the JSON changes spacing, key order or Unicode escapes, so keep the raw body (express.raw, request.get_data()) and hash that. A trailing line break and CRLF versus LF endings do the same.
Is it safe to paste my real webhook secret here?
The key is used only by your browser's Web Crypto API and is not sent to any server or shown in the results. Even so, any secret you paste into a web page is exposed to that page, so use a test-mode secret when you can and rotate a live one if you are unsure.
Should I compare signatures with ==?
No. A plain comparison can stop at the first different character, and the time it takes can leak how much of a guess was right. Use crypto.timingSafeEqual in Node or hmac.compare_digest in Python, as the code on this page does; GitHub and Slack both say to use a constant-time comparison.
What are the several v1 values in Stripe-Signature?
When you roll an endpoint's signing secret and keep the old one active for up to 7 days, Stripe sends one v1 signature per active secret. Your code should accept the request if any v1 entry matches, and ignore v0 (a fake scheme sent only for sandbox events) and the debug entries.
What is the Razorpay payment signature, and is it the same as the webhook signature?
No. The payment signature checks the Checkout response: HMAC-SHA256 of order_id|razorpay_payment_id using your API key secret, where order_id is the one saved on your server. The webhook signature covers the whole webhook body and uses the separate webhook secret you set in the Dashboard.
Why is the same digest hex in one provider and Base64 in another?
An HMAC is just bytes, and each provider chose how to write them. Razorpay, Stripe, GitHub and Slack use hex; Shopify uses Base64, so a hex string never equals Shopify's header even when the bytes are identical. This page flags that case.
Does HMAC-SHA1 still work for signing?
HMAC does not depend on collision resistance the way a plain hash does, so HMAC-SHA1 is not broken by the known SHA-1 collisions, but it is legacy. Choose HMAC-SHA256 or stronger for anything new and keep SHA-1 only to interoperate with an old system.

Sources

Related tools

See all 135 free tools

Need a custom dev tool for your team?

We build internal tools, dashboards, APIs, and SaaS platforms. If you can describe it, we can ship it.

Built by CountryDevs · No signup · No ads · We count visits, never what you enter