HMAC Calculator

Compute or verify HMAC with explicit expected-signature encoding and legacy SHA-1 compatibility.

On-device No sign-up Free to use

Sign message controls

?

The exact bytes are signed, so a trailing space or a different line ending changes the signature.

?

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.

?

Text suits a passphrase. Hexadecimal suits a key shown as bytes, such as 0b0b0b0b, and spaces or colons between the pairs are ignored.

?

The other side must use the same hash. SHA-256 is the usual choice.

?

Choose explicitly when an all-letter/digit Base64 value could also be hexadecimal. Explicit Base64 modes require canonical spelling.

?

Paste a signature another system published. It is checked with the browser verify function, and the result says whether the two agree.

Processed in your browser. Your inputs stay on this device.

Showing an example. Change the fields, then use sign message to update it.

Result

Showing an example.

Compute the RFC 4231 Hi There example, without adding punctuation or a trailing newline to the message.

The page reports an HMAC-SHA-256 signature of b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7, a 32 byte signature, and a table naming the hash, the key source and the message length.

Loading the tool. Your result will appear here.

https://usefreetools.net/hmac-calculator · 20 November 2026

Was this helpful?

How to use HMAC Calculator

  1. Enter the message exactly as the other system encodes it. Spaces and line endings change the UTF-8 bytes.
  2. 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.
  3. 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.
  4. 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.

You add
Message to sign: Hi There Secret key: 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b How the key is written: Hexadecimal bytes Hash for the HMAC: SHA-256 Signature written as: Hexadecimal Expected signature encoding: Automatic (hex takes precedence) Signature to verify (optional): (blank)
You get
The page reports an HMAC-SHA-256 signature of b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7, a 32 byte signature, and a table naming the hash, the key source and the message length.

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.

Page updated · Project managed by Tony Hines · Report a problem with HMAC Calculator