Code · Made a little simpler

HMAC Generator

Generate or verify HMAC-SHA-256, SHA-384, SHA-512 and legacy SHA-1 tags locally. Enter text or encoded bytes and output Hex, Base64 or Base64URL.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Enter a full tag in the chosen result encoding to check for a match. For exact bytes such as CRLF, enter an encoded message.

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

HMAC Generator: how to use it

  1. Choose an algorithm and the formats of the secret key and message. Paste the inputs or choose Load RFC 4231 example to try a published test vector.
  2. Choose Hex, Base64 or Base64URL for the result. Optionally enter a complete tag in the same format to verify it.
  3. Choose Calculate HMAC. Review the byte counts and any match result. Copy or download the generated tag.

Limits and notes

Runs on this device with Web Crypto on HTTPS or localhost. The key must contain 1 to 4,096 bytes. The message can be empty or up to 1 MiB. The verifier expects the full tag for the selected algorithm. Use encoded input bytes for exact CRLF line endings.

How your privacy works →

HMAC Generator: common questions

What is the difference between a Hex key and a UTF-8 key?

In Hex, 0b is one byte with value 11. In UTF-8 text, the same input is the two characters 0 and b and yields a different tag.

Why did my HMAC change after I formatted the JSON?

HMAC uses the actual message bytes. Added spaces, indentation or a changed line ending change those bytes and produce a different tag.

Does the downloaded file contain the secret key?

The text file contains only the generated tag in the chosen encoding. The browser uses the message and key in a local worker for the calculation.

Guides