♢

HMAC Generator

Generate hmac using the options shown.

Choose a file or fill the fields, then click Generate.

About HMAC Generator

Payment providers, webhook senders and many APIs sign their messages with an HMAC so the receiver can confirm the content came from someone holding the shared secret. Developers compute one by hand to debug a signature mismatch, check a webhook handler, or reproduce an example from API documentation.

How it works

The tool computes HMAC-SHA256 with the CryptoJS 4.2.0 library. The message box and the secret key are both treated as UTF-8 text, and the output is a 64-character lowercase hex string. SHA-1, SHA-512 and Base64 output are not offered. A key given in hex or Base64 is not decoded, so it is used as literal characters. An empty key is allowed and still produces a result. The computation happens in your browser, and the key is not transmitted.

How to use HMAC Generator

  1. Complete the available fields: Secret key. Use the field labels and examples shown in the workspace.
  2. Select “Generate” and check the result before copying or downloading it.

Worked example

Message: The quick brown fox jumps over the lazy dog. Key: key. Output: f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8. This is a widely published HMAC-SHA256 reference value, so you can use it to confirm your own code produces matching signatures.

Tips for a better result

  • Hash the exact raw request body the provider sent. Re-serializing JSON often changes spacing or key order and breaks the signature.
  • If the provider sends a Base64 signature, convert this hex output to Base64 before comparing, or compare the decoded bytes.
  • Use a test secret here, not a live production key, and rotate any secret you have pasted into shared tools or screens.

Frequently asked questions

My signature does not match the webhook header. Why?

Common causes are a modified body, a missing timestamp prefix that the provider includes in the signed string, a Base64 versus hex mismatch, or a secret that must be decoded first. Check the provider's exact signing recipe.

Can I choose SHA-1 or SHA-512?

No. This tool always uses SHA-256, the most common choice for webhooks and API signing. Services requiring HMAC-SHA1 or HMAC-SHA512 need a different tool or a few lines of code.

Is HMAC the same as encryption?

No. HMAC produces a fixed-length tag that proves integrity and knowledge of the key. The message itself is not hidden and cannot be recovered from the tag.

What to check

Local checks are not a security audit or live malware scan. Do not enter active passwords, API keys or other secrets.

Read the Privacy Policy for information about local processing, connected services and advertising.