فارسی

HMAC Generator & Signature Checker

Sign a message with a shared key, or check a received HMAC signature. Output is hex or Base64, and the key stays in your browser.

Use this tool in your browser without installing software.

About this tool

HMAC is a keyed hash: instead of hashing the message alone, it combines a key with the message so nobody without the key can produce a valid signature. It is the usual way to check webhook signatures, validate API requests, and compare a signature a server sent. Pick the algorithm: SHA-256 is the common choice, SHA-1 is only for compatibility with older systems, and SHA-384 or SHA-512 produce a longer signature. The key can be UTF-8 text or a hex string; in hex mode every two digits are one byte. Output is hex or Base64, and if you paste the expected signature the tool compares it in constant time and reports only whether it matches. HMAC does not encrypt the message; it confirms authenticity and integrity with a shared key.

How to use it

  1. 1

    Enter or paste the message, using exactly the bytes the other side signed.

  2. 2

    Add the shared key as text or hex, then choose the algorithm and output format.

  3. 3

    To verify, paste the received signature into the expected field; the comparison appears below it.

If the answer looks wrong

  • My signature does not match the server.

    The key, algorithm, and message bytes must all be identical. Extra whitespace, Windows versus Unix line endings, or a different text encoding changes the signature.

  • The hex key is rejected.

    Hex mode accepts only 0-9 and a-f, with an even number of digits; each byte is two digits. If your key is plain text, switch the format to text.

  • The Base64 output does not match the received signature.

    Set the output format to Base64 too. Base64url with - and _ is accepted for checking, but this tool writes standard Base64 with + and /.

  • Can an empty message be signed?

    Yes, HMAC of an empty message is valid. An empty key is not accepted, so no unintended result is produced.

Frequently asked questions

How is HMAC different from a plain hash?

Anyone can compute a plain hash, but HMAC needs a key. Without the key a valid signature cannot be produced, so a signature made with the shared key can be trusted.

Which algorithm should I choose?

SHA-256 is the common choice for new work. Choose SHA-1 only when the other system requires it. SHA-384 and SHA-512 produce longer signatures; use whichever the receiving service expects.

How does a hex key differ from a text key?

In text mode the characters are encoded as UTF-8, so the letter a is one byte. In hex mode every two digits are one byte; for example 6b is the byte k. The key must be exactly what the other side uses.

How do I check a received signature?

Set the output format to the one the signature was sent in, then paste it into the expected field. Spaces and line breaks are ignored. A match turns green; a mismatch turns red.

Does HMAC encrypt the message?

No. The message stays readable to anyone who sees it. HMAC only proves it was signed with the shared key and was not changed on the way. Confidentiality needs encryption.

Is my message or key sent anywhere?

No. The calculation runs in your browser with WebCrypto, and no request carries the message or the key.