MD5, SHA-1, SHA-256, SHA-512 and CRC-32 of any text, with checksum verification.
HMAC Generator
Sign a message with a secret key: HMAC-SHA-256, SHA-1, SHA-512 and MD5.
Runs in your browserProcessed locally. Your input never leaves your device.
Optional. Paste the signature header you received; a sha256= prefix is fine.
Details
About this tool
Computes an HMAC - a digest keyed with a shared secret - and checks it against a signature you were sent. Takes the key as text, hex or Base64, because every provider hands it over differently and reading it the wrong way is the single most common reason a signature will not verify.
A plain hash answers "what is this content?", and anyone can compute one. An HMAC answers "was this produced by someone holding the key?", because without the key the correct value cannot be worked out from the message. That one difference is what turns a digest into a signature, and it is why HMAC - not a bare hash of the secret concatenated with the message - is the construction the standards specify.
The everyday use is webhooks. Stripe, GitHub, Shopify, Slack and most of the rest sign each callback with HMAC-SHA-256 over the raw request body, and your endpoint recomputes the signature to prove the request came from them rather than from anyone who learned the URL. When that check fails, recomputing it by hand is how you find out why - which is what this tool is for. HMAC also underpins JWTs signed with HS256, AWS request signing, and one-time password codes.
Two details decide whether your signature matches. The message must be the exact raw bytes that were sent: parse the JSON and print it back and the whitespace changes, so the signature does too. And the key must be interpreted the way the provider meant it - a secret handed over as Base64 is bytes, not the letters of the Base64 itself.
Keep going
Related tools
- Runs in your browserDeveloper
-
Inspect the header and payload of a JSON Web Token.
Runs in your browserDeveloper -
Convert text to Base64 and back.
Runs in your browserDeveloper
Good to know
Questions people actually ask
- How is an HMAC different from a hash?
- A hash answers "what is this content?" and anyone can compute it. An HMAC answers "was this produced by someone holding the key?", because without the key the right value cannot be worked out. That is what makes it usable as a signature.
- My webhook signature will not verify. What is wrong?
- Two causes cover nearly every case. First, the key: providers publish it as text, hex or Base64, and reading it the wrong way gives a valid-looking signature that never matches. Second, the message: it must be the exact raw request body, byte for byte. Parsing the JSON and printing it back changes the whitespace, and the signature with it.
- Is HMAC-MD5 broken, given MD5 is?
- No, and the distinction is a real one rather than a technicality. What broke MD5 was collisions - being able to construct two inputs with the same digest - and the HMAC construction does not rely on collision resistance. HMAC-MD5 has no practical attack against it and long-lived APIs still use it safely. It is still not what to choose for something new: HMAC-SHA-256 costs the same and carries no argument with it.
- How should I compare signatures in my own code?
- With a constant-time comparison - Python's hmac.compare_digest, Node's crypto.timingSafeEqual, PHP's hash_equals. An ordinary string comparison stops at the first differing character, so how long it takes leaks how much of the signature was correct, and an attacker who can measure that can recover the rest one character at a time. This page is a debugging aid and does not need the guarantee; your endpoint does.
- Is it safe to paste a production secret here?
- The computation runs entirely in your browser and the key is never transmitted - an automated test fails the build if any request carries it. That said, treat any secret you paste into any web page as one you may want to rotate afterwards, this one included.