HMAC-SHA256 Signature Generator

HMAC Webhook & API Signature Generator

Generate client-side HMAC signatures using SHA-256, SHA-384, or SHA-512 via the native Web Cryptography API.

Computed HMAC (SHA-256 - hex)
Generating signature...

At a Glance

Category
Developer Cryptography & Security
Best For
Backend developers, API integration engineers, security auditors, and DevOps teams
Privacy
100% in your browser: nothing you enter is uploaded
Time Required
Real-time (< 5 ms async cryptographic execution)
Cost
Free Forever
Updated
November 2026

Quick Overview

What This Tool Does

The HMAC-SHA256 Signature Generator is a client-side cryptographic tool that combines a private secret key with a message payload to compute a verifiable message authentication code. It allows developers to test webhook signing logic, verify payload authenticity, and debug API authentication headers in real time.

Who Should Use It

Backend developers implementing webhook receivers (for Stripe, GitHub, Shopify, Slack), API developers testing signed request headers, and security engineers auditing cryptographic signatures.

When to Use It

Use this utility when verifying incoming webhook signatures in local development, diagnosing signature mismatch errors in API integrations, or generating test tokens for automated integration tests.

Why It Is Useful

Testing webhook authentication on third-party cloud tools exposes private API signing secrets to untrusted servers. Leveraging the browser’s native `window.crypto.subtle` API guarantees genuine cryptographic security while keeping secret keys 100% private.

Key Features & Capabilities

Hardware-Accelerated Web Crypto API

Computes signatures via browser native SubtleCrypto for genuine cryptographic performance and safety.

Multi-Algorithm Support (SHA-256/384/512)

Easily toggle between industry-standard SHA-256, SHA-384, and SHA-512 cryptographic digest functions.

Dual Output Formats (Hex & Base64)

Output resulting signatures in lowercase Hexadecimal notation or standard Base64 encoding.

Complete Zero-Knowledge Security

Secret keys and message payloads never leave your browser RAM; zero telemetry or server logging.

How to Use This Tool

1

Enter Secret Signing Key

Type or paste your webhook signing secret (e.g., whsec_... from Stripe or your API secret) into the Secret Key field. Tip: Ensure no accidental leading or trailing whitespace is included when copying your secret key.

2

Paste Message Payload

Enter the exact raw message string or JSON payload body received from the webhook dispatcher. Tip: Webhook signatures are extremely sensitive to whitespace; paste the exact raw unformatted body string.

3

Select Hash Algorithm & Encoding

Choose HMAC-SHA-256 (most common), SHA-384, or SHA-512, and select Hex or Base64 output format. Tip: GitHub and Stripe webhooks use HMAC-SHA-256 with Hexadecimal encoding.

4

Copy Generated HMAC Digest

Compare the resulting cryptographic digest against your incoming request signature header. Tip: Click Copy Digest to transfer the signature directly into your unit tests or Postman collections.

Worked Transformation Example

Computing HMAC-SHA256 with SubtleCrypto in JavaScript

A developer computes an HMAC signature using browser Web Crypto.

Sample Inputs
Input Payloadconst encoder = new TextEncoder(); const key = await crypto.subtle.importKey("raw", encoder.encode("secret"), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]); const signature = await crypto.subtle.sign("HMAC", key, encoder.encode("message"));
Transformed Outputconst hex = Array.from(new Uint8Array(signature)).map(b => b.toString(16).padStart(2, "0")).join(""); console.log(hex);
Calculation Breakdown
Uses native SubtleCrypto importKey and sign methods to generate cryptographically authentic signatures.
Specification: RFC 2104 (HMAC: Keyed-Hashing for Message Authentication) & W3C Web Crypto API

Technical Specification & Algorithm

Generates cryptographically valid Hash-based Message Authentication Codes adhering to RFC 2104 using the browser W3C Web Cryptography API (SubtleCrypto.sign).. Zero external network requests, analytics beacons, or server telemetry dispatched. Executed in 100% Client-Side Web Cryptography API (SubtleCrypto).

Formula / AlgorithmRFC 2104 (HMAC: Keyed-Hashing for Message Authentication) & W3C Web Crypto API
const encoder = new TextEncoder();
const key = await crypto.subtle.importKey("raw", encoder.encode("secret"), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
const signature = await crypto.subtle.sign("HMAC", key, encoder.encode("message"));

Frequently Asked Questions

What is the purpose of an HMAC signature in webhooks?
An HMAC proves two things: the payload was sent by someone possessing the shared secret (authenticity), and the message was not modified in transit (integrity).
Is it safe to enter my live production webhook secret into this tool?
Yes. All hashing executes locally on your CPU via SubtleCrypto. Your key never traverses any network or touches any server.
Why does Stripe prepend "t=..." and "v1=..." to their webhook signatures?
Stripe includes a UNIX timestamp (t) to prevent replay attacks. The actual HMAC is calculated over "${timestamp}.${rawBody}".
What is the length of an HMAC-SHA256 signature in hexadecimal?
HMAC-SHA256 produces a 256-bit (32-byte) digest, which represents exactly 64 hexadecimal characters.

Complementary QuickForma Utilities