Free tool · no signup · runs in your browser

Webhook Signature Generator & Verifier

Compute and check HMAC webhook signatures the way Meta, Slack, GitHub, Stripe and Shopify send them. See the exact string that was signed, find out why a signature does not match, and copy server code that verifies it properly.

Platform

Signature scheme

Header X-Hub-Signature-256, HMAC with SHA-256, hex encoded, prefixed sha256=. Documentation

Secret and payload

The secret you typed when you created the webhook.

Paste the body exactly as received, before any parsing. Every space and line break counts.

Check a received signature

With or without the header name and prefix.

Verify it on your server

import crypto from "node:crypto";
import express from "express";

const app = express();

// Read the body as raw bytes: parsing JSON first changes what you hash.
app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const expected = "sha256=" + crypto.createHmac("sha256", process.env.WEBHOOK_SECRET).update(req.body).digest("hex");
  if (!safeEqual(expected, req.get("X-Hub-Signature-256"))) return res.sendStatus(401);
  const event = JSON.parse(req.body.toString("utf8")); // safe to parse now
  // ... handle the event, then answer quickly
  res.sendStatus(200);
});

function safeEqual(a, b) {
  const x = Buffer.from(String(a));
  const y = Buffer.from(String(b));
  return x.length === y.length && crypto.timingSafeEqual(x, y); // constant time
}

Both read the raw body, compare in constant time, and only then parse the JSON. Keep the secret in an environment variable, never in code.

The HMAC runs in your browser's Web Crypto API. Secrets, bodies and signatures are never sent anywhere.

How webhook signing works

A webhook is an HTTP request a platform sends to your server when something happens. Anyone who knows the address can send a request to it too, so the platform signs each one. It takes a secret only it and you know, runs an HMAC over the request body (sometimes with a timestamp in front), and puts the result in a header. Your server repeats the calculation with its copy of the secret. If the two results are equal, the request came from the platform and was not changed on the way.

The calculation is the same everywhere; the details are not. Which header, which bytes, which prefix, hex or base64: get one of them wrong and every request fails. This page follows each platform's documentation to the letter, so you can compare your code's output with a known-good one.

A signature proves two things and only two: the sender knew the secret, and the bytes were not altered. It does not prove the event is new (that is what timestamps are for), and it says nothing about whether your handler processed it. Platforms retry failed deliveries, so make handlers safe to run twice for the same event ID, and answer quickly with a 2xx before doing slow work.

The schemes side by side

PlatformHeaderWhat is signedOutput
MetaX-Hub-Signature-256Raw body, with non-ASCII characters escaped as sentsha256= + hex
SlackX-Slack-Signaturev0: + timestamp + : + raw bodyv0= + hex
GitHubX-Hub-Signature-256Raw bodysha256= + hex
StripeStripe-SignatureTimestamp + . + raw bodyt=...,v1= hex
ShopifyX-Shopify-Hmac-SHA256Raw bodyBase64
TelegramX-Telegram-Bot-Api-Secret-TokenNothing: the secret itself is sentYour secret_token

All HMACs here use SHA-256. Stripe may send several v1 values while you roll a secret, and a match with any one is enough; it also adds a v0 entry for sandbox events and debug entries, which must be ignored. GitHub still sends a legacy SHA-1 X-Hub-Signature header, which you should not use.

Five reasons a correct secret still fails

  • The body was parsed first. JSON.parse then JSON.stringify changes spacing, key order and escapes. Hash the bytes that arrived.
  • A newline appeared or vanished. Some proxies and test tools add one at the end; editors convert line endings. The checker tries these variants for you.
  • Characters were decoded. Meta signs the six characters \u00e9 where the body contains an accented letter, not the letter é itself. Decoding and re-encoding the body produces different bytes.
  • The wrong encoding or prefix. Shopify sends base64, the others hex; Meta and GitHub add sha256=, Slack v0=.
  • The timestamp is stale. For Slack and Stripe the signature can match and the request still be rejected if the timestamp is more than five minutes old.

When the signature is right and requests still do not arrive, the problem is delivery, not signing: work through the webhook debugging guide.

This tool or the verification tester?

They answer different questions. This page computes signatures locally and sends nothing, so it is for checking your verification code against the documented scheme. The webhook verification tester does the opposite: it sends Meta's or Slack's setup handshake to your live endpoint and reports how it answered, which is what you need when the platform says your callback URL could not be validated. For Telegram, the Telegram webhook checker shows what Telegram itself reports about delivery. If you would rather not write this code at all, Conferbot builds an AI chatbot for your website without code, free to start.

Frequently asked questions

Why does my webhook signature not match?

Almost always because the bytes you hashed are not the bytes that were signed. The usual causes are hashing parsed and re-serialised JSON instead of the raw body, a framework that changed line endings or added a newline, the wrong secret (test versus live, or an API key instead of the signing secret), hex compared with base64, or a missing prefix such as sha256=.

What is the raw body, and how do I get it?

It is the request body exactly as it arrived, before any JSON or form parsing. In Express, use express.raw on the webhook route so req.body is a Buffer. In Flask, call request.get_data(). In Next.js API routes, turn off the built-in body parser for that route and read the stream. Parse the JSON only after the signature checks out.

Why should signatures be compared in constant time?

A normal string comparison stops at the first different character, so how long it takes leaks how much of a guess was right. Repeated over many requests, that timing can help an attacker build a valid signature. Use crypto.timingSafeEqual in Node.js or hmac.compare_digest in Python, as the generated code does. Slack and GitHub both say this explicitly.

Is Telegram's secret token a signature?

No. When you call setWebhook with secret_token, Telegram sends that same string back in the X-Telegram-Bot-Api-Secret-Token header of every update. Nothing is hashed; you compare the header with the value you set. It must be 1 to 256 characters of letters, digits, underscores and hyphens. Treat it like a password and compare it in constant time.

Why do Slack and Stripe put a timestamp in the signature?

To stop replays. Because the timestamp is part of the signed string, an attacker who captures a valid request cannot change the time without breaking the signature. Your server rejects requests whose timestamp is too far from its own clock: Slack says five minutes, and Stripe's libraries default to five minutes. Keep the server clock synchronised.

Is it safe to paste my signing secret here?

The HMAC is computed by your browser's built-in Web Crypto API. The secret, body and signature are not sent to Conferbot or anywhere else, and nothing is stored. Even so, prefer a test or rotated secret for debugging, and never paste a live secret into a page you do not trust.

Related

Skip the webhook plumbing

Build an AI chatbot for your website or messaging channels without writing the receiving code. No code, free plan.