HMAC-SHA256 signatures and verification
- Free
- No sign-up
- No upload
- Works offline
Tool facts
- Price
- Free, no sign-up, no watermark
- Are files uploaded?
- No. Everything is processed in this browser, on your device.
- Offline use
- Works without a connection once this page has loaded
- Built with
- Web Crypto, WebAssembly, and hash-wasm
- Browser
- A recent Chrome, Edge, Firefox or Safari, on computer or phone.
Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.
About HMAC Generator
HMAC Generator computes keyed-hash message authentication codes (RFC 2104) for a message and a secret key with five algorithms at once: HMAC-SHA256, HMAC-SHA512, HMAC-SHA384, HMAC-SHA1 and HMAC-MD5. The key can be plain text, hex or Base64, and the result can be shown as hex, Base64 or URL-safe Base64url, which covers the formats used by payment webhooks, API request signing and JWT HS256 signatures.
The most common use is checking a webhook: paste the raw request body as the message, enter your endpoint secret, then paste the signature header value into Verify. The algorithm that matches turns green, and a prefix such as sha256= is ignored. The SHA variants use your browser's Web Crypto API and HMAC-MD5 uses a WebAssembly hash library, so the secret key is never sent anywhere.
HMAC Generator runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.
How to use HMAC Generator
- Paste the message into the Message box exactly as it was signed, without reformatting it.
- Enter the Secret key and choose whether it is Text, Hex or Base64 under Key format.
- Pick Hex, Base64 or Base64url under Output format and copy the signature you need.
- To check a signature, paste it into Expected signature under Verify; the matching algorithm is highlighted.
Frequently asked questions
Why doesn't my webhook signature match?
Almost always because the message is not byte-for-byte identical to what the sender signed. Use the raw body before any JSON parsing, keep the original whitespace and line endings, and include any extra parts the provider documents, such as a timestamp joined with a dot. Also check whether the secret is meant to be used as text or decoded from hex or Base64 first.
Is HMAC-SHA1 or HMAC-MD5 still secure?
HMAC is much more robust than the plain hash: the known collision attacks on MD5 and SHA-1 do not directly break HMAC-MD5 or HMAC-SHA1. Still, choose HMAC-SHA256 or stronger for new systems and only use the older ones for compatibility.
How long should the secret key be?
At least as long as the hash output: 32 random bytes for HMAC-SHA256 and 64 for HMAC-SHA512. Longer keys are hashed down first, so they add no security. A short human-chosen key can be brute-forced if an attacker sees a message and its signature.
Is my secret key sent to a server?
No. All signatures are computed in this page with the Web Crypto API and WebAssembly. Nothing you type leaves your device.
Can I use this to sign a JWT?
An HS256 JWT signature is HMAC-SHA256 over the text header.payload (both Base64url-encoded) with Base64url output. Paste that string as the message, choose Base64url and the result is the third part of the token.