About the HMAC Generator
HMAC Generator calculates a keyed-hash message authentication code for a message using your browser’s Web Crypto API. Choose HMAC-SHA-256, HMAC-SHA-384 or HMAC-SHA-512, enter the message as text or choose one local file, and provide the secret key either as UTF-8 text or as Base64 bytes. The result is shown in lowercase hexadecimal and Base64, each with its own Copy button.
Unlike an ordinary hash such as SHA-256, an HMAC depends on a secret key: anyone can compute a checksum, but only someone who knows the key can produce or verify the HMAC. That is why HMACs are used for API request signing and webhook verification. The key is kept only in the page while you work, is never included in copies or the downloadable summary, and is cleared on Reset, when you choose a different file and when you leave the page.
How to use
- Choose Text or File and enter the message or pick a file (up to 100 MB).
- Choose whether the key is UTF-8 text or Base64, then enter it.
- Pick HMAC-SHA-256, HMAC-SHA-384 or HMAC-SHA-512.
- Click Generate HMAC.
- Copy the hex or Base64 value, or download the summary.
Key features
- HMAC-SHA-256, HMAC-SHA-384 and HMAC-SHA-512.
- Text (UTF-8) or one local file up to 100 MB.
- Secret key as UTF-8 text or Base64 (standard or URL-safe).
- Lowercase hex and Base64 output with Copy buttons.
- Plain-text summary download without the key.
- Key cleared on Reset, file change and page exit.
Best practices
- Use a random key of at least 32 bytes for HMAC-SHA-256.
- Never paste production secrets on shared or untrusted devices.
- Make sure both sides use exactly the same message bytes, including line endings.
- Compare HMACs using a constant-time comparison in your own code.
- Rotate keys if you suspect they have been exposed.
Benefits
- Quickly check webhook and API signatures.
- Verify your own HMAC code against known values.
- Works offline with no uploads.
- Keeps secret keys out of downloads and storage.
Frequently asked questions
What is the difference between HMAC and a hash?
A hash (like SHA-256) depends only on the message, so anyone can calculate it. An HMAC also mixes in a secret key, so it proves the message came from someone who knows the key and was not changed.
Should my key be text or Base64?
Use the format your system uses. Many APIs give a text secret; others give random bytes encoded in Base64. Choosing the wrong format gives a different result.
Why does my HMAC not match the one from my server?
Check that the algorithm, key format and message are exactly the same, including spaces, line endings and character encoding. Text here is encoded as UTF-8.
Is my secret key stored?
No. It is used only in this tab, is never included in copies or downloads, and is cleared on Reset, when you choose a different file and when you leave the page.
Is there a file size limit?
Yes, 100 MB. Larger files are refused before they are read, because the browser must load the whole file into memory.
Which output format should I use?
Hex is most common in documentation and logs; Base64 is shorter and common in HTTP headers. Both represent the same bytes.