How to use HMAC Calculator
- Enter the message exactly as the other system encodes it. Spaces and line endings change the UTF-8 bytes.
- Enter the shared key and choose UTF-8 text or hexadecimal bytes to match the source. Text mode encodes the key directly; it does not derive a key from a password.
- Choose the required hash and output encoding. To compare a supplied HMAC, paste it in Signature to verify and choose its encoding explicitly if it could be ambiguous.
- Run Sign message and read the HMAC, byte counts and optional comparison result. Copy only the output needed and clear the private key when finished.
Example: HMAC Calculator
Compute the RFC 4231 Hi There example, without adding punctuation or a trailing newline to the message.
Options
- Message to sign
- The exact bytes are signed, so a trailing space or a different line ending changes the signature.
- Secret key
- The key stays in this page. It is never written into the result, the summary or an error message, and it is never sent anywhere.
- How the key is written
- Text suits a passphrase. Hexadecimal suits a key shown as bytes, such as 0b0b0b0b, and spaces or colons between the pairs are ignored.
- Hash for the HMAC
- The other side must use the same hash. SHA-256 is the usual choice.
- Signature written as
- Choose Hexadecimal, Base64, Base64url (no padding).
- Expected signature encoding
- Choose explicitly when an all-letter/digit Base64 value could also be hexadecimal. Explicit Base64 modes require canonical spelling.
- Signature to verify (optional)
- Paste a signature another system published. It is checked with the browser verify function, and the result says whether the two agree.
Supported inputs and limits
- SHA-256, SHA-384 and SHA-512, plus SHA-1 for legacy HMAC compatibility.
- Web Crypto requires HTTPS or localhost.
- Message input is limited to 5,000,000 UTF-16 code units and the key to 4,096 decoded bytes; the key has no default.
- Verification accepts hex, canonical padded Base64 or unpadded Base64url; automatic mode gives hex precedence for ambiguous text.
- The key and message are not uploaded, and the key is not included in the result.
More details
No storage, key management, rotation or public-key signature verification is provided.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
What verification actually proves
A matching HMAC means the supplied message bytes and shared key produce the supplied authentication code. Both parties holding that key can generate the same code, so it does not distinguish them or establish a public-key signer identity. Agree on the byte encoding, hash and signature encoding as well as the key. A matching code also does not establish that the message content is correct.
Questions about HMAC Calculator
Is HMAC the same as a hash?
No. A plain hash of a message can be computed by anyone. An HMAC mixes the message with a secret key, so only a party that holds the key can produce the same signature.
Which hash should I choose?
Match the algorithm required by the other system. SHA-256 is the default; SHA-384 and SHA-512 are supported, with SHA-1 retained for legacy HMAC compatibility.
Why does a signature check fail when the key looks right?
The exact message bytes, key bytes and algorithm must match. Text and hexadecimal keys can represent different bytes. Select the expected signature encoding explicitly when Base64 text could also look hexadecimal.
Where does my key go?
It stays in the page as you type and is used by the browser crypto call. The field is never filled from a default, and the key is not echoed back in the signature, the table or any error.