An HMAC is a keyed message authentication code: it combines a secret key with a hash algorithm so parties that share the key can check message integrity and authenticity. Unlike an ordinary hash, an HMAC cannot be reproduced without the key. This generator encodes the entered message and secret as UTF-8, imports the key for HMAC signing with the selected hash, and displays the signature as lowercase hexadecimal. It is useful for understanding protocol examples and comparing test vectors, but it does not configure a webhook, sign an HTTP request automatically, or manage key rotation.
Enter the message in the multiline Message field and the shared value in Secret Key. Select SHA-1, SHA-256, SHA-384, or SHA-512, then press Generate HMAC. SHA-256 is selected initially. Both message and secret must contain non-whitespace characters for the action button to be enabled. Clear removes the current message, key, and output. If an algorithm selection changes after a result is produced, run the operation again so the output reflects the selected digest function.
For a concrete debugging workflow, start with a short sample message and a test-only key, select SHA-256, and generate a signature. Compare the resulting hex with a trusted HMAC-SHA256 test vector, taking care to match every byte of the key and message, including case, whitespace, and line endings. A one-character difference changes the MAC. Do not copy a production API secret into a demonstration page simply to reproduce a live signature; first use a sandbox key and synthetic payload.
The output panel labels the selected algorithm and offers a plain-text result. HMAC-SHA-1 produces a shorter signature than HMAC-SHA-256; SHA-384 and SHA-512 are available when the protocol requires them. This interface takes one message and one secret at a time and does not expose key encoding, output truncation, canonical request construction, timestamp handling, or a verifier input. These details matter in real integrations: follow the upstream service's exact signing specification instead of assuming every HMAC API uses identical message formatting.
Use cases include validating a development webhook sample, learning why a secret key matters in message authentication, and comparing an implementation against a documented test vector. Hash Generator is a useful contrast when you need an unkeyed digest for a file or string. Secure Token Generator can create random secret material for a test environment, while JWT Encoder creates an unsigned token for structure previews; neither tool replaces a production key-management or signing library.
The operation is implemented with browser Web Crypto SubtleCrypto and the component keeps the message and key in its page state rather than sending them to a dedicated HMAC endpoint. However, the secret is typed into a normal text input and remains visible on screen, so do not enter production credentials on a shared device or public display. Clear the fields when finished. Browser support is required for Web Crypto; errors are presented as output. A copied MAC is only meaningful if the receiver uses the same key and canonical message bytes.
Keep keys random, private, scoped to a system, and replaceable; never embed a shared secret in public client-side application code. Protect verification code against timing leaks by using an established constant-time comparison routine rather than string equality in sensitive server code. HMAC proves possession of a key, not the identity or trustworthiness of a person in every wider workflow. Do not use a bare hash when authentication is required, and do not use this interactive page as the only evidence that a production signature implementation is correct.
Interoperability depends on bytes, not just what a message looks like in an editor. The helper UTF-8-encodes both text and secret, so a key supplied as visible hex characters is treated as those literal characters rather than decoded hexadecimal bytes. Likewise, a newline at the end of a payload is part of the message. When comparing with a provider's signature, read its documentation for key encoding, canonicalization, header inclusion, and output encoding, then test a published vector before debugging a live webhook.
HMAC is a message authentication primitive for parties that share a secret. Because both the sender and verifier possess that secret, a valid MAC does not provide non-repudiation: either party could have produced it. A public-key digital signature has different distribution and verification properties. Choose the primitive based on the trust model and protocol rather than merely matching an output string. This page can help reproduce a small known vector, but it does not explain or implement each API's request-signature protocol end to end.
When rotating a key, systems often need a limited overlap window in which a verifier can accept both the previous and replacement keys. This interactive tool has no key versioning, storage, or rotation state, so do not use it to coordinate a deployed secret change. Keep keys out of tickets and chat transcripts, restrict who can access them, and revoke them after exposure. For webhook verification, compare the received signature with a constant-time routine and reject stale timestamps or replayed requests when the provider's design calls for those checks.
A useful local test has a known message, a non-production key, and a documented expected output. Change only one variable at a time—message, key, or selected hash—to identify why signatures differ. Record whether the reference expects lowercase hex or another representation; this page outputs lowercase hexadecimal. Never paste an active secret into a public report to make the test easier for another person to reproduce.