Free tool · runs in your browser
Stripe webhook signature verifier: check Stripe-Signature and see why it fails
This page verifies a Stripe webhook signature in your browser: paste the endpoint secret, the Stripe-Signature header and the raw body, and it tells you whether the event is genuine and, if not, which of the usual causes is to blame.
Verify a Stripe signature
The verifier opens on a sample Stripe request signed with a demo secret. Replace the secret, headers and body with your own. Everything is computed in your browser; nothing you paste is sent.
The interactive tool needs JavaScript. The same core runs locally: npx @teamshift/webhook-inspect
How Stripe signs a webhook
| Header | Stripe-Signature, in the form t=<unix seconds>,v1=<hex>. A header can carry more than one v1 while a secret is being rolled. |
|---|---|
| Signed content | The timestamp, a period, then the raw request body: <t>.<body> |
| Algorithm and encoding | HMAC-SHA256, lowercase hex |
| Secret | The endpoint's signing secret, including the whsec_ prefix. Each endpoint has its own, and stripe listen prints a different one for local forwarding. |
| Replay protection | Compare the timestamp with the current time. Stripe's libraries reject events older than 300 seconds by default. |
A minimal check in Node.js
import crypto from 'node:crypto';
const sameBytes = (a, b) => a.length === b.length && crypto.timingSafeEqual(a, b);
export function verifyStripe(rawBody, header, secret, toleranceSec = 300) {
if (typeof header !== 'string') return false;
const timestamp = header.match(/t=(\d+)/)?.[1];
const signatures = [...header.matchAll(/v1=([0-9a-f]+)/g)].map((match) => match[1]);
if (!timestamp || signatures.length === 0) return false;
const expected = Buffer.from(crypto.createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex'));
const matches = signatures.some((signature) => sameBytes(Buffer.from(signature), expected));
return matches && Math.abs(Date.now() / 1000 - Number(timestamp)) <= toleranceSec;
}Pass the body exactly as it arrived, before any parsing. The tool on this page runs the same check and, when it fails, tries the common fixes to tell you which one applies.
Why Stripe verification fails
- The body was parsed first.
express.json()or a framework body parser re-serialized the JSON, so the bytes no longer match. Verify the raw body, then parse. - The secret belongs to another endpoint. A dashboard endpoint, a second endpoint and a
stripe listensession each have their ownwhsec_secret. Test-mode and live-mode secrets differ too. - An API key was used.
sk_test_…andrk_…keys call the API; they do not sign webhooks. - The event is old. A replayed or long-queued event fails the timestamp check even though the signature matches. The "Replayed an hour later" sample shows this.
Test your own endpoint
Enter your endpoint URL under "Send a signed test request to your endpoint" and the tool writes a curl command signed the way Stripe signs. Run it in a POSIX shell (macOS, Linux, WSL or Git Bash) to confirm your handler accepts a good signature, then change one character of the body and confirm it is rejected.
Other providers
- GitHub webhook signature verifier
- Shopify webhook signature verifier
- Slack webhook signature verifier
- Twilio webhook signature verifier
The main verifier also handles any generic HMAC header.
FAQ
How do I test a Stripe webhook signature without the Stripe CLI?
Paste your test-mode endpoint secret and a body into the tool on this page, enter your endpoint URL, and press "Build signed curl command". It signs the body with a current timestamp the way Stripe does and gives you a curl command to run against your handler.
Why does Stripe say "No signatures found matching the expected signature for payload"?
The HMAC your code computed differs from every v1 value in the header. The usual causes are a body that was parsed and re-serialized before verification, or a signing secret from a different endpoint, mode or stripe listen session.
Is it safe to paste my secret here?
The page sends nothing: the signature is computed in your browser with WebCrypto, and no field is stored or uploaded. Even so, prefer a test secret, and rotate any live secret you have pasted into a tool you do not control.