Webhook signature verifier
Runs in your browserCheck webhook signatures from Stripe, GitHub, Shopify, Slack, Svix, Clerk, Paddle, Twilio, Square and Discord, and find out why a check fails.
Paste headers, body and secret
Try the Stripe or GitHub example: the secrets are whsec_demo and demo-secret.
How each provider signs its webhooks
| Provider | Header | Signed content | Algorithm |
|---|---|---|---|
| Stripe | Stripe-Signature: t=…,v1=… | timestamp.body | HMAC-SHA256, hex; secret used as text including whsec_; 5 min tolerance |
| GitHub | X-Hub-Signature-256: sha256=… | raw body | HMAC-SHA256, hex |
| GitLab | X-Gitlab-Token | – | no signature: the secret token itself is sent |
| Shopify | X-Shopify-Hmac-Sha256 | raw body | HMAC-SHA256, Base64 |
| Slack | X-Slack-Signature: v0=… + X-Slack-Request-Timestamp | v0:timestamp:body | HMAC-SHA256, hex; 5 min tolerance |
| Svix, Clerk, Resend, Standard Webhooks | svix-signature: v1,… / webhook-signature | id.timestamp.body | HMAC-SHA256, Base64; secret after whsec_ is Base64-decoded |
| Paddle Billing | Paddle-Signature: ts=…;h1=… | ts:body | HMAC-SHA256, hex |
| Square | x-square-hmacsha256-signature | notification URL + body | HMAC-SHA256, Base64 |
| Twilio | X-Twilio-Signature | URL + POST parameters sorted by name | HMAC-SHA1, Base64, key is the Auth Token |
| Discord | X-Signature-Ed25519 + X-Signature-Timestamp | timestamp + body | Ed25519 signature, checked with the app’s public key |
Verify the raw body, compare in constant time
Nearly every failed check has the same cause: the framework parsed the JSON and the code signs a re-serialized copy. Sign the raw bytes before anything touches them.
import express from "express";
import crypto from "node:crypto";
// express.raw keeps the exact bytes. express.json() would re-serialize them.
app.post("/webhooks/github", express.raw({ type: "application/json" }), (req, res) => {
const expected = "sha256=" + crypto.createHmac("sha256", process.env.WEBHOOK_SECRET)
.update(req.body).digest("hex");
const got = req.get("X-Hub-Signature-256") || "";
const ok = got.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected));
if (!ok) return res.sendStatus(401);
const event = JSON.parse(req.body);
res.sendStatus(204);
});import hmac, hashlib, os
from flask import request, abort
@app.post("/webhooks/github")
def github():
body = request.get_data() # raw bytes, not request.json
expected = "sha256=" + hmac.new(os.environ["WEBHOOK_SECRET"].encode(), body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, request.headers.get("X-Hub-Signature-256", "")):
abort(401)
return "", 204$body = file_get_contents('php://input'); // Laravel: $request->getContent()
$expected = 'sha256=' . hash_hmac('sha256', $body, getenv('WEBHOOK_SECRET'));
if (!hash_equals($expected, $_SERVER['HTTP_X_HUB_SIGNATURE_256'] ?? '')) {
http_response_code(401);
exit;
}// Use the SDK, it also checks the timestamp const event = stripe.webhooks.constructEvent( req.body, // raw Buffer from express.raw() req.headers["stripe-signature"], process.env.STRIPE_WEBHOOK_SECRET // whsec_..., used as is );
# GitHub / any HMAC-SHA256 hex printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" # Stripe: sign "timestamp.body" printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" # Shopify: Base64 instead of hex printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -binary | base64
The usual suspects, in order of likelihood
Parsed and re-serialized JSON (other spacing, key order, escaped umlauts), a trailing newline from a file or echo, or CRLF line endings. The tool tries all of these and tells you which one matches.
Test mode and live mode have different secrets, and so does every endpoint. Stripe’s secret is used as text including whsec_; Svix’s is Base64-decoded after the prefix.
Stripe, Slack and Svix reject requests older than five minutes to stop replays. A request you saved earlier fails for that reason alone.
GitHub, Stripe and Slack send hex, Shopify, Svix, Square and Twilio Base64. Comparing a hex digest with a Base64 header never matches.
Use crypto.timingSafeEqual, hmac.compare_digest or hash_equals so the time a comparison takes reveals nothing.
Questions about the webhook signature verifier
Why does my Stripe webhook signature fail?
Almost always because the body is not the raw request body: express.json() or a framework parsed it first. Use express.raw() for the webhook route. Second most common: the secret of another endpoint or of test mode.
Is it safe to paste my webhook secret here?
The check runs in your browser and nothing is sent anywhere; the page’s Content-Security-Policy forbids it. If in doubt, roll the secret afterwards in the provider’s dashboard, or use the command line examples on this page.
What is the signed content for GitHub webhooks?
The raw body only. GitHub sends HMAC-SHA256 of the body with your secret, as hex with the prefix sha256= in X-Hub-Signature-256.
Why is there a timestamp in the signature?
So that an attacker who captures one valid request can’t send it again later. Verify the signature first, then reject timestamps older than a few minutes.
Does GitLab sign webhooks?
Not with an HMAC. GitLab sends the secret token you set in the X-Gitlab-Token header. Compare it with a constant-time comparison.