HMAC Generator & Verifier
Generate HMAC hashes online with SHA-256, SHA-512, SHA-384, and SHA-1. Authenticate API requests, webhooks, and tokens with Hex or Base64 digests.
Runs in your browser · Free, no sign-up · Nothing is stored
About this tool
Web APIs, microservices, and webhook integrations commonly use Hash-based Message Authentication Codes (HMACs) to detect payload changes and verify that a signature was generated by a party possessing a shared secret. This browser-based HMAC generator calculates message authentication codes with HMAC-SHA-256, HMAC-SHA-384, HMAC-SHA-512, and legacy HMAC-SHA-1. It is useful for creating test vectors and debugging signature mismatches when you know the exact message bytes, key encoding, algorithm, and output format. HMAC does not encrypt data or prevent replay attacks by itself.
How to use it
What Is an HMAC Generator?
A Hash-based Message Authentication Code (HMAC) combines a cryptographic hash function with a shared secret key. The sender calculates an authentication code from the exact message bytes, and the recipient independently calculates the expected value using the same secret.
A matching result provides assurance that the signed content has not changed and that the authentication code was generated by a party possessing the shared secret. HMAC produces a deterministic code, not an asymmetric digital signature: it does not reveal which specific person or system used the key, does not encrypt the payload, and does not prevent replay attacks without additional protocol controls such as signed timestamps, nonces, or idempotency checks.
How to use it
- Select the hash algorithm. HMAC-SHA-256 is the recommended default for new integrations; HMAC-SHA-1 is included only for legacy interoperability.
- Enter the secret key (interpreted as UTF-8 text) and the exact payload to authenticate. HMAC operates on bytes, so whitespace, line endings, and encoding all affect the result.
- Optionally paste an expected signature to check it against the computed value. A sha256= prefix is stripped automatically, and hex input is matched case-insensitively.
- Click the Generate button and copy the hex or base64 digest with "Copy Hex" or "Copy Base64".
Why use this over alternatives
This utility calculates and verifies HMAC values locally through the browser's Web Crypto API. It supports common SHA-2 algorithms, hexadecimal output, and Base64 output without requiring an account. Production verification should run on the receiving server using the exact provider protocol and a maintained cryptographic library or official SDK.
Questions
- Can this tool verify GitHub or Stripe webhook signatures?
- It can reproduce simple HMAC calculations when you provide the exact secret, signed bytes, algorithm, and output encoding. GitHub signs the original payload bytes with HMAC-SHA-256 and sends a sha256=-prefixed hex value in the X-Hub-Signature-256 header — use the exact received bytes, since re-serializing JSON changes the HMAC. Stripe uses a provider-specific procedure with the raw body, the Stripe-Signature header, and the endpoint secret; use the official SDK or Stripe's documented procedure instead.
- How should HMAC signatures be compared securely?
- Production verification should use a constant-time comparison or the verification function of a trusted cryptographic library. Ordinary string equality can leak timing information and should not be used for security-sensitive signature checks. The compared values must also use the same encoding and length.
- Does HMAC encrypt the message?
- No. HMAC authenticates the signed bytes but does not hide their contents. Anyone who can view the request can still read the payload unless a separate encryption or secure transport mechanism is used. Use HTTPS for webhook transport and protect sensitive payloads according to the application's security requirements.
- Is my secret sent to a server?
- Cryptographic calculations are performed locally through the browser's Web Crypto API. Avoid entering active production secrets on shared, managed, or untrusted devices, and store production webhook secrets in an approved secrets manager rather than hard-coding them.
Related tools
All security tools- Hash GeneratorGenerate cryptographic SHA-1, SHA-256, SHA-384, or SHA-512 hashes for any text using the browser Web Crypto API
- JWT DecoderDecode JWT tokens into readable JSON header and payload
- Secure Password GeneratorGenerate strong, random passwords instantly
- Bcrypt Hash Generator & VerifierGenerate secure Bcrypt password hashes and verify plaintext passwords against existing hashes