HMAC Generator — HMAC-SHA256, SHA-512 and MD5 Online
- This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.
Hashes
- MD5
- —
- SHA-1
- —
- SHA-256
- —
- SHA-384
- —
- SHA-512
- —
About this tool
An HMAC is a hash that also depends on a secret key. Anyone can compute a plain SHA-256 of a message, but only someone who knows the key can compute the matching HMAC, so it proves both that the message was not changed and that it came from someone holding the key. That makes it the standard for API request signing and webhook verification.
Type the message, enter your secret and every HMAC appears at once. With the key key, the message The quick brown fox jumps over the lazy dog gives an HMAC-SHA256 of f7bc83f4…1a3cd8, an HMAC-SHA1 of de7c9b85…b4d9 and an HMAC-MD5 of 80070713…e275. Switch to Base64 when a service expects that format, as many webhook signatures do.
When a signature does not match the one a service sent, check three things: the exact bytes being signed, since a trailing newline or reformatted JSON changes everything; the key, which must be used as the same text or bytes; and the algorithm. Text is signed as UTF-8, and the key is entered as text.
Compare signatures with a constant-time check in your own code, not a plain equality test. Everything here runs in your browser, and the key never leaves it. For plain hashes without a key, use the Hash Generator on the same page with HMAC switched off.
Frequently asked questions
What is the difference between a hash and an HMAC?
A hash needs no secret, so anyone can compute it. An HMAC mixes in a secret key, so only holders of the key can produce or check it.
Which HMAC algorithm should I use?
HMAC-SHA256 is the common choice and what most webhook and API providers use. HMAC-SHA512 is also fine. HMAC with MD5 or SHA-1 is still not broken by collisions, but only use it when an existing system requires it.
Why does my HMAC not match the one from the provider?
Usually the signed bytes differ, for example a trailing newline, reformatted JSON or a different encoding. Also check the key and whether the provider expects hex or Base64.
Is the secret key sent anywhere?
No. The HMAC is computed in your browser with the Web Crypto API, and the key stays on your device.
Read the guide
- JWTs explained: what is inside a token and what decoding provesHow a JSON Web Token is built, what its claims mean, how HS256 and RS256 signatures differ, and why decoding a JWT is not the same as trusting it.
- Should password hashing be fast or slow? bcrypt, salt and pepper explainedWhy good password hashes are slow on purpose, how bcrypt stores and checks a password, what salt and pepper add, and how to stay safe if your database leaks.