HMAC Generator

Sign a message with a secret key using SHA-1, SHA-256, SHA-384 or SHA-512. Hex and Base64 output.

Hash algorithm
Secret key
Message

The key and the message stay in this tab. Nothing is uploaded and nothing is logged.

Hex

Enter a key and a message

Base64

Enter a key and a message

How to Generate an HMAC

1

Pick the hash algorithm

SHA-256 is the standard choice and is what Stripe, GitHub and most webhook providers use. SHA-1 is here for older integrations that still require it.

2

Enter the secret and the message

The secret is the shared key both sides hold. The message must be the exact bytes the other side signed, usually the raw request body before any JSON parsing.

3

Compare the result

Copy the hex or Base64 digest and compare it with the signature header you received. If they match, the payload is authentic and untouched.

Features

SHA-1, SHA-256, SHA-384 and SHA-512
Hex and Base64 output at the same time
Full Unicode support, so Turkish characters sign correctly
Recalculates as you type, with no submit button
Uses the browser's own Web Crypto implementation
The key and the message never leave your machine
Copy either format with one click
Free, no sign-up, no request limit

Frequently Asked Questions

A plain hash proves nothing about who produced it, because anyone can hash the same text. HMAC mixes a secret key into the hash, so a matching digest proves the sender knew the key. That is why webhooks are signed with HMAC and not with a bare SHA-256.

Almost always because the message is not byte identical. The most common cause is signing a re-serialized JSON object instead of the raw request body. Whitespace, key order and a trailing newline all change the digest. Some providers also sign a timestamp and the body joined with a separator, so check their documentation for the exact string.

Whatever the other side uses. Stripe and GitHub send hex, AWS and many older SOAP style APIs use Base64. They are two encodings of the same bytes, so if the hex matches after conversion, the signature is valid.

HMAC-SHA1 has not been broken the way plain SHA-1 collisions were, and TOTP still uses it. Even so, there is no reason to choose it for something new. Use SHA-256 unless you are talking to a system that only speaks SHA-1.

No. The digest is computed by the Web Crypto API inside this tab. There is no upload, no logging and no analytics on the values you type.

At least as long as the hash output, so 32 bytes for SHA-256. Shorter keys are padded internally and add no security. Generate one with our API key generator rather than picking a memorable phrase.

Yes. Verification is just generating the HMAC yourself and comparing it with the one you received. In your own code, compare with a timing safe function such as crypto.timingSafeEqual rather than a plain equality check.

Yes. Both the key and the message are encoded as UTF-8 before hashing, so ş, ğ, ı and the rest produce the same digest they would in any correct implementation.

Need a Custom Tool or Application?

We build production-grade web applications, SaaS platforms, and developer tools. Let's talk about your project.

or book a free call