JoyToolsJoyTools

Stripe Webhook Signature Verifier & Tester (`Stripe-Signature: t,v1`)

100% Client-Side Private — Zero Server Uploads

Generate and verify Stripe Stripe-Signature (t=timestamp,v1=hex) HMAC-SHA256 webhook headers over ${timestamp}.${raw_body} in browser.

🔒 100% Client-Side: Dữ liệu được xử lý trực tiếp trên trình duyệt và không bao giờ rời khỏi thiết bị của bạn (Zero Server Uploads).
E-E-A-T Security Proof →
Interactive Workspace
Platform:
Algorithm:
Format:
Signed String: "1710864000.{raw_body}"
Stripe-Signature (SHA-256 / HEX)
Enter secret key to compute signature...

Verify Received Stripe-Signature Header

Share & Developer Embed

How do I use Stripe Webhook Signature Verifier & Tester (`Stripe-Signature: t,v1`)?

1

Notice the tool is pre-configured to 'Stripe (t,v1)' mode with a sample `checkout.session.completed` event payload, `whsec_...` secret, and `t=1710864000` timestamp.

2

Paste your endpoint's Signing Secret (`whsec_...`), Unix timestamp (`t=`), and exact raw JSON request body.

3

Copy the generated `Stripe-Signature: t=...,v1=...` header value to test your webhook endpoint in Postman, cURL, or Vitest.

4

Or paste a received `Stripe-Signature` header into the Verifier input at the bottom to check if your payload and secret match.

What features does Stripe Webhook Signature Verifier & Tester (`Stripe-Signature: t,v1`) offer?

Pre-configured for Stripe's exact `${timestamp}.${raw_payload}` signed payload construction

Outputs the full `t=1710864000,v1=...` `Stripe-Signature` HTTP header plus the raw hex digest

Pre-loaded with a realistic `checkout.session.completed` Stripe event (`evt_1P6xYz...`) and `whsec_` test secret

Instant verification box accepts either the full `t=...,v1=...` header or the standalone `v1` hex signature

Helps debug `No signatures found matching the expected signature for payload` errors in Next.js & Express

100% Client-Side Web Crypto API: live `whsec_` signing secrets never leave your browser

How Stripe Computes the `Stripe-Signature` (`t=...,v1=...`) Header

Unlike generic webhooks that hash only the JSON body, Stripe prepends the Unix timestamp (`t`) and a literal period (`.`) before computing HMAC-SHA256 to prevent replay attacks.

Stripe Signed Payload Construction
signed_payload = `${timestamp}.${raw_http_body}`

The Unix timestamp from `t=` and the exact UTF-8 request body are joined by a `.` character before hashing.

Stripe v1 Signature Header
v1 = HMAC_SHA256_HEX(whsec_secret, signed_payload)

Stripe transmits `Stripe-Signature: t=<timestamp>,v1=<hex_digest>`. (The `whsec_` prefix is part of the ASCII secret string).

Stripe Webhook Signature Components & Tolerance Rules
Header ElementFormat / ExampleCryptographic RoleStripe SDK Verification Rule
Timestamp (t)t=1710864000Unix epoch seconds when Stripe sent eventDefault 300s (5 min) replay tolerance
Live/Test Signature (v1)v1=5257a869e7ecebeda32...HMAC-SHA256 hex digest of t.bodyCompared via constant-time crypto.timingSafeEqual
Legacy Test Signature (v0)v0=6ffbb59b2300aae63f2...Deprecated schema signatureIgnored by modern stripe.webhooks.constructEvent
Signing Secretwhsec_...Endpoint-specific shared HMAC keyDistinct per webhook URL & Stripe CLI session

How is Stripe Webhook Signature Verifier & Tester (`Stripe-Signature: t,v1`) used in real-world workflows?

Next.js App Router & Node.js Developers

Debugging `No signatures found matching the expected signature` Errors

If `await req.json()` was called instead of `await req.text()`, key ordering or whitespace changes break the HMAC. Paste your raw body here to verify the exact `v1` digest.

QA & API Automation Engineers

Generating Valid `Stripe-Signature` Headers for Postman & Integration Tests

Compute a valid `t=...,v1=...` header for custom mock `invoice.payment_failed` or `customer.subscription.deleted` payloads.

Security & Payment Engineers

Verifying Production vs. Stripe CLI `whsec_` Secret Mismatches

Confirm whether a failed webhook was signed with the Stripe Dashboard endpoint secret or the local `stripe listen` CLI secret.

Frequently Asked Questions about Stripe Webhook Signature Verifier & Tester (`Stripe-Signature: t,v1`)

Why does `stripe.webhooks.constructEvent` fail in Next.js or Express?

In 99% of cases, middleware (`express.json()`) or `await req.json()` parsed and re-serialized the JSON body before passing it to `constructEvent()`, altering whitespace or key formatting. In Next.js App Router, always pass `const rawBody = await request.text()` directly to `stripe.webhooks.constructEvent(rawBody, sig, secret)`.

Why does my Stripe signature not match if I only hash the JSON body?

Stripe does not hash the JSON body alone. Stripe hashes the concatenated string `${timestamp}.${raw_body}` (the `t=` Unix timestamp, a literal dot `.`, and the raw payload) using HMAC-SHA256 in lowercase hex.

Do I strip the `whsec_` prefix from my Stripe signing secret?

No! Keep the full `whsec_...` string intact when computing the HMAC-SHA256 signature—Stripe's signing key is the full ASCII string including `whsec_`.

Is it safe to paste my `whsec_` secret into this verifier?

Yes. All HMAC calculations use your browser's built-in `window.crypto.subtle` Web Crypto API. Zero data is transmitted over the network.