Generate Hash-based Message Authentication Codes (HMAC) using a secret key and your choice of hashing algorithm: SHA-256, SHA-512, SHA-1, or MD5.
What is an HMAC Generator?
HMAC (Hash-based Message Authentication Code) is a cryptographic technique that combines a message with a secret key and runs it through a hash function. The result is a unique signature that proves both who sent the message and that it wasn’t altered. This tool lets you generate and verify HMAC signatures right in your browser, without installing anything or uploading your keys to a third-party server.
How to Use the HMAC Generator
- Paste your message or payload into the input field.
- Enter your secret key in the key field.
- Choose a hashing algorithm (SHA-256 is recommended for most use cases).
- The HMAC signature is generated instantly as you type.
- Copy the output hash and use it in your app, API request, or webhook verification.
Use Cases
Webhook signature verification. Services like Stripe and GitHub sign their webhook payloads with an HMAC-SHA256 signature. Use this tool to manually calculate the expected signature from a payload and secret key, so you can confirm your backend validation logic is working correctly before going to production.
API request signing. REST APIs often require HMAC-signed Authorization headers. During development, you can quickly generate the correct signature for a request to check that your signing code produces the right output.
JWT signature debugging. The HS256 algorithm in JSON Web Tokens is HMAC-SHA256 under the hood. You can use this tool to reproduce and inspect the signature portion of a JWT when debugging authentication issues.
Why Use This Tool
Every HMAC computation runs locally inside your browser using the Web Crypto API. Your secret key and message payload never leave your machine. There’s no account, no rate limit, and no data retention. This makes it practical for verifying real API keys and sensitive payloads during development without the risk of exposing secrets to an online service.
Understanding HMAC vs Standard Hashing
While standard hashing algorithms like SHA-256 create a unique fingerprint of a message, they do not verify the sender’s identity. Anyone can take a modified message and compute a new hash for it. HMAC solves this by incorporating a shared secret key, making it impossible for someone without the key to forge a valid signature.
This added layer of security makes HMAC ideal for validating data sent between systems. For instance, in webhook notifications, the receiving server recalculates the HMAC using the shared secret. If the calculated signature matches the header, it confirms both authenticity and message integrity.
When designing APIs using HMAC, developers should follow key rotation policies and use secure, randomly generated secrets. Additionally, implementing timestamp checks alongside HMAC signatures helps prevent replay attacks where a third party intercepts and re-sends valid requests.