Generate an HMAC signature

Compute an HMAC-SHA-256, SHA-512 or SHA-1 signature over a message with a shared secret, for testing webhooks and API signatures.

Generate an HMAC signature

0 characters

Three steps — nothing to install

  1. Paste the message

    The exact bytes the server will sign, including spacing and line breaks.

  2. Enter the secret

    The shared key, as UTF-8 text. It stays in this tab.

  3. Compare the signature

    Hex or Base64, matching what the service expects in its header.

HMAC versus a plain hash

A plain hash of a message proves nothing about who sent it: anyone can hash anything. HMAC mixes a secret key into the hash, so only someone with the key can produce a valid signature. The receiver recomputes it and compares; a mismatch means the body or the key is wrong.

HMAC is not encryption and it does not hide the message, which travels in clear unless the connection is TLS. Its job is integrity and authenticity: this body came from someone with the key, and it was not changed in transit.

How webhook signature checks work

Most services sign a timestamp plus the raw body, then send the result in a header such as X-Signature. You recompute it with the same key and compare. The failure modes are always the same: the body was re-serialised before hashing, a trailing newline was added, or the header was Base64 while the code expected hex.

Paste the body exactly as received — not a pretty-printed version — and check whether the service includes the timestamp in the signed string. That detail is in each service's documentation and no generic tool can guess it, which is why the message box here is free text.

Keeping the key out of the page

Nothing typed here is sent anywhere: the signature is computed with Web Crypto in the tab. That still does not make it a good place to paste a production secret, because any script on the page — or an extension — could read it. Use a test key, or a key you are about to rotate.

When the service supports it, prefer signing with a short-lived key and verifying on the server with a constant-time comparison. A normal string comparison leaks timing, which is a real attack against a signature check, though not one this page can fix for you. For unkeyed hashes, see the hash generator.

Frequently asked questions

What is the difference between HMAC and a hash?HMAC uses a secret key, so it proves the message came from someone holding that key. A plain hash proves nothing about origin.
Hex or Base64?Whichever the service documents. This tool produces both so you can compare against the header you received.
Is the secret uploaded?No. The key and message stay in the tab and are used by Web Crypto locally.
Why does my signature not match?Usually the body was re-encoded, a newline was added, the timestamp was not included, or the encoding differs. Paste the raw body.
Can HMAC encrypt data?No. It authenticates, it does not hide. Use AES-GCM for encryption.
Is HMAC-SHA-1 still usable?It is not broken the way plain SHA-1 is, but new systems should use SHA-256.