Decode a JWT header and payload, explain every claim, and state plainly that the signature is NOT verified.
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
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
Enter the message and the secret key. Choose hexadecimal if your key is binary rather than text.
- 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.
Related tools
Other tools you might reach for next.
Check whether a JWT has expired or is not yet valid, with the exact exp, nbf and iat times.
Sign a JWT with HS256 using your own secret, in your browser, for testing against an API you control.
Compute a SHA-256 hash with the Web Crypto API, in hexadecimal, Base64 and colon-separated forms.
Compute a SHA-512 hash with the Web Crypto API, producing a 64-byte digest.
Compute a SHA-1 hash for legacy compatibility, with a clear statement of why SHA-1 is deprecated.
Format and indent JSON, with optional alphabetical key sorting and a precise syntax error when it will not parse.
Strip every byte of insignificant whitespace from JSON and report the saving.