Security Tools
HMAC Generator (HMAC-SHA256, SHA-384, SHA-512)
Calculate HMAC-SHA256, SHA-384, SHA-512 or SHA-1 signatures in your browser with text, hex or Base64 keys, output hex or Base64, and verify webhook signatures.
How to use HMAC Generator (HMAC-SHA256, SHA-384, SHA-512)
Enter the message and the secret key, choose their formats and the hash algorithm, and the HMAC updates as you type. Pick hex or Base64 output, or paste a signature you received to check whether it matches.
- Enter message and keyPaste the exact message and the secret key, and set each format to UTF-8 text, Hex or Base64.
- Choose algorithm and outputPick SHA-256, SHA-384, SHA-512 or legacy SHA-1, and lower or upper-case hex, Base64 or Base64URL.
- Verify a signaturePaste a signature, even with a sha256= prefix, to see Match or No match next to the result.
What an HMAC proves
An HMAC is a keyed hash: only someone holding the same secret key can produce the same value for a message, so it shows the message came from a key holder and wasn't altered on the way. That's why APIs use it to sign requests and services such as GitHub and Stripe use it to sign webhooks. With the message message to sign and the key secret, HMAC-SHA256 gives 8a3646d7d465db2511084ee623f2f2ad8d1e60f7df8802edd348cb5d16d288bd, or ijZG19Rl2yURCE7mI/LyrY0eYPffiALt00jLXRbSiL0= in Base64.
Why a signature doesn't match
Almost always the input differs by at least a byte. Common causes are a JSON body that was re-serialised with different spacing or key order, a trailing line break, or a key that is really hex or Base64 but was entered as text. The message is used exactly as typed, spaces at either end included, and a trailing line break triggers a warning. Verification accepts hex in either case, Base64, Base64URL and prefixes such as sha256= or v1=. Many providers sign a timestamp together with the body, so build the signed string the way their documentation describes.
Accuracy and data handling
A format or strength result covers only the checks shown here and does not replace a full security review or secure key management. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
What's the difference between HMAC and a plain SHA-256 hash?
Anyone can compute the SHA-256 of a message. An HMAC mixes in a secret key, so without the key nobody can produce a valid signature, even if they know the message.
Is HMAC-MD5 supported?
No. The calculation uses the browser's Web Crypto API, which offers HMAC with SHA-1, SHA-256, SHA-384 and SHA-512 only. New designs should avoid MD5 anyway.
Are my message and key sent to the server?
No. The HMAC is computed in your browser with Web Crypto and nothing is sent to the server. Using a test key while debugging is still good practice.
More Security Tools
Related toolsDerive PBKDF2 keys with your own salt, iteration count, hash and output length.
Create prefixed random API keys and the SHA-256 hashes to store server-side.
Make cryptographically random PINs that skip 0000, 1234, years and dates.
Create easy-to-type passphrases from random words, with the entropy shown for each setting.
Create random one-time code samples and see how easy each length is to guess.
Get CRC-32, CRC-16, CRC-8, Adler-32 and other checksums from text, hex or Base64.