HMAC Generator
Compute HMAC-SHA1, HMAC-SHA256, HMAC-SHA384, and HMAC-SHA512 message authentication codes using a secret key. Supports plain text, hex, and Base64 key encodings; outputs in hex, Base64, or URL-safe Base64. Verify a received HMAC on the Verify tab. Runs entirely in your browser; nothing is uploaded.
Guide
How to Use
- 1 Enter your message
Type or paste the message you want to authenticate into the Message field. The byte count updates as you type.
- 2 Enter your secret key
Type or paste your secret key into the Secret key field. Use the key encoding selector to specify whether the key is plain text, hex, or Base64.
- 3 Select an algorithm and output encoding
Choose one of the four supported algorithms: HMAC-SHA1, HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512. Then pick your output format: hex, Base64, or URL-safe Base64.
- 4 Read the HMAC result
The HMAC is computed in a background Web Worker and displayed instantly. Copy it, download it as a .txt file, or switch to the Verify tab to compare it with an expected value.
- 5 Verify an HMAC
Switch to the Verify tab and paste the expected HMAC into the Expected HMAC field. A green indicator appears if it matches the computed HMAC, or a red indicator if it does not.
Reference
HMAC Algorithms Compared
| Algorithm | Output size | Inner hash | Best for |
|---|---|---|---|
| HMAC-SHA1 | 160-bit (20 bytes) | SHA-1 | Legacy systems only — avoid for new work |
| HMAC-SHA256 | 256-bit (32 bytes) | SHA-256 | General-purpose API authentication, JWT |
| HMAC-SHA384 | 384-bit (48 bytes) | SHA-384 | Higher-security signing, TLS context |
| HMAC-SHA512 | 512-bit (64 bytes) | SHA-512 | High-assurance message authentication |