HMAC Generator

Nothing is uploaded. Prefer throwaway keys for testing; rotate anything used in production.

Signature

About this tool

Compute an HMAC (hash-based message authentication code) over any message using a secret key. HMAC-SHA256, HMAC-SHA512, and HMAC-SHA1 are available, with hex or Base64 output. Signing runs in your browser through the Web Crypto API, so neither the message nor the key leaves your device.

Need only one algorithm, with its parameters and FAQ? Use HMAC-SHA256, HMAC-SHA512, or HMAC-SHA1. There is no HMAC-MD5 page: browsers' Web Crypto API does not expose MD5, and MD5 is unsuitable for authentication anyway.

How to use

  1. Choose the algorithm your service expects — HMAC-SHA256 is the common default.
  2. Enter the message exactly as it will be sent, including line endings.
  3. Paste the secret key and pick whether it is plain text or hex bytes.
  4. Copy the signature, or paste an expected signature to verify it.

Example

Algorithm: HMAC-SHA256
Message:   hello
Key:       secret

Signature: 88aab3ede8d3adf94d26ab90d3bafd4a2083070c3bcce9c014ee04a443847c0b

FAQ

Which algorithms are supported?

HMAC-SHA1, HMAC-SHA256, and HMAC-SHA512, all via the browser Web Crypto API. HMAC-MD5 is not exposed by Web Crypto and is deliberately not offered, since MD5 is unsuitable for authentication.

Is HMAC the same as a plain hash?

No. A plain hash such as SHA-256 takes no key, so anybody can produce it. HMAC folds a secret key into the digest, which is what lets a server verify that a request came from someone holding the key.

Should I paste a production secret?

Prefer not to. The computation is local and nothing is uploaded, but a web page can be modified or extended by its authors after you visit. Test with throwaway keys and rotate anything sensitive.

Why does my HMAC not match my server?

Encoding, almost every time. Confirm the key bytes (plain UTF-8 versus hex-decoded), the exact message bytes including trailing newlines, and the output form (hex versus Base64).

Is my key stored anywhere?

The key is kept only in the input field for the current page view. It is deliberately not written to localStorage, so it disappears when you leave or reload the page.