🔑 HMAC Generator
Generate HMAC signatures with SHA algorithms. Runs in your browser.
Last updated: November 8, 2026 · By the BoltQuickTools team
Reproduce a webhook or API signature by hand
When a webhook handler rejects requests with "invalid signature", you need to work out whether your code or your input is wrong. This page computes the HMAC for a message and key so you can compare it with what your code or the sender produced. Signing uses the browser's crypto.subtle, and the page's code does not send your message or key anywhere. Even so, a test secret is the sensible thing to paste into any web page.
Producing and comparing a signature
- Choose Hash Algorithm (HMAC-SHA1, HMAC-SHA256, HMAC-SHA384 or HMAC-SHA512) and Output Format (Hex, Base64 or Base64URL).
- Fill in Message and Secret Key. The signature appears shortly after you stop typing, or press Generate.
- Paste a known value into Optional: Compare with Expected Signature to get a match or no-match result.
- Copy Signature, Load Sample and Clear do what their names say.
The built-in sample, worked through
Load Sample fills these two fields:
Message: {"event":"payment.succeeded","amount":1999,"currency":"USD"}
Secret Key: super_secret_key_123
The line under the buttons reads Message bytes: 60 | Key bytes: 20. With HMAC-SHA256, the three output formats are:
Hex 018274a788fcec238181048e3079b9daaecabbbeefa518dc220f08c521bf8935
Base64 AYJ0p4j87COBgQSOMHm52q7Ku77vpRjcIg8IxSG/iTU=
Base64URL AYJ0p4j87COBgQSOMHm52q7Ku77vpRjcIg8IxSG_iTU
Why a signature can fail to match
- The message must be byte for byte what was signed. Re-serialising JSON, changing key order, or pretty-printing it all give a different result. Use the raw request body.
- Watch the byte counters. A trailing newline pasted into Secret Key counts as part of the key and adds one to Key bytes.
- Browser text boxes turn CRLF line endings into a single line feed, so a body with Windows line endings cannot be reproduced exactly here.
- The key is always taken as UTF-8 text. If a provider's key is meant to be Base64 or hex decoded first, this page signs with the literal characters and the result will differ. There is no setting for a decoded key.
- Many services sign more than the body, such as
timestamp.body. Build that exact string in Message. - The comparison only removes whitespace. It is case-sensitive and does not convert between formats, so an uppercase hex value reports
No matchagainst lowercase output. Prefixes likesha256=must be removed first.
Signing questions
Can the message be empty?
Yes. An empty message still produces a signature. The key cannot be empty: the page shows Enter a secret key to generate a signature. instead.
Is an HMAC the same as encrypting the message?
No. The message stays readable. The signature only proves that someone holding the key produced this exact text. Compare with a plain digest from the hash generator, which involves no key.
Can I use this to build or check a JWT?
A signed JWT with HS256 is an HMAC over the header and payload in Base64URL form, so the Base64URL output format is the right one to compare. The JWT generator and JWT decoder handle the token structure for you.