HMAC Generator

Generate an HMAC signature.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter a secret key and a message and get the HMAC-SHA256 signature as 64 hex characters. Use it to test webhook signatures and signed API requests. Only SHA-256 is supported.

How to use

1
Step 1
Type the secret key.
2
Step 2
Paste the message to sign.
3
Step 3
Press Run and compare the hex signature with the one you expect.

How it works

HMAC mixes a secret key into the hash so that only someone who knows the key can produce or verify the signature. The tool uses the Web Crypto API with SHA-256, reads both key and message as UTF-8 text and prints the result as lowercase hex.

Worked example

The standard test vector

Input
Key: key Message: The quick brown fox jumps over the lazy dog
Output
f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8
Walkthrough
This is the HMAC-SHA256 example given in the HMAC Wikipedia article, which makes it a useful check that your own implementation matches.

Limitations

  • Only HMAC-SHA256. SHA-1, SHA-512 and MD5 variants are not available.
  • The key is treated as plain text, not as hex or Base64 bytes. Decode a Base64 secret first if your provider gives you one.
  • Output is hex only, not Base64.

Questions

How do I generate an HMAC SHA256?
Enter the key and message and press Run. The hex signature is shown.
Does it support SHA-512 or SHA-1?
No. This tool computes HMAC-SHA256 only.
Is my secret key sent anywhere?
No. The signature is calculated in your browser.
Why does my signature not match the provider's?
Check for extra whitespace, a different message encoding, or a key that must be Base64-decoded or hex-decoded first.

Features

  • HMAC-SHA256
  • Hex output
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • What Is A RESTful API?

    Traversy Media

    API context for JWT, JSON, and encoding utilities.

    Watch on YouTube
  • Learn Regular Expressions - Crash Course

    freeCodeCamp.org

    Regex primer for tester and explainer pages.

    Watch on YouTube