Skip to content
Zesona
HMAC GeneratorLocal

HMAC Generator

Compute an HMAC with SHA-1, SHA-256, SHA-384 or SHA-512 using a text or hex key, in your browser.

  • Free
  • No sign-up
  • Runs in your browser

Input

Runs in your browser

0 characters

Processed entirely in your browser. Nothing is uploaded.

The usual choice

Fill in Message and Secret key to continue.

Enter your input to see the result

Everything happens on this device. No upload, no account, no network request.

How to use this tool

  1. 1

    Enter the message and the secret key. Choose hexadecimal if your key is binary rather than text.

  2. 2

    The tag is shown in hex, Base64 and Base64URL, which covers what most APIs expect.

Questions about HMAC Generator

What does HMAC give me that a hash does not?

Authenticity. A plain hash proves the message has not changed, but anyone can compute one, so an attacker can alter the message and recompute it. An HMAC requires the secret key, so a valid tag proves the message came from someone holding that key. It is what webhook signatures and API request signing use.

Why not just hash the key and the message together?

Because the obvious construction, `hash(key + message)`, is vulnerable to a length-extension attack against SHA-256 and SHA-1: an attacker who has one valid tag can produce a valid tag for a longer message without knowing the key. HMAC’s nested structure exists specifically to prevent that.

How should I compare HMACs when verifying?

With a constant-time comparison - `crypto.timingSafeEqual` in Node, `hmac.compare_digest` in Python. A normal `==` returns as soon as two bytes differ, and that timing difference is enough to recover a valid tag one byte at a time.

Is it safe to paste a real secret here?

The computation happens in your browser and nothing is transmitted, so the secret does not leave your device. Two caveats worth knowing anyway: anything you paste may be captured by a browser extension with page access, and it may linger in your clipboard. For a production credential, a local command-line tool is still the better habit.

Does the HMAC Generator work offline?

Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the HMAC Generator keeps working with the network switched off and nothing is ever sent to a server.

Other tools you might reach for next.