HMAC Generator

Keyed-hash message authentication codes — SHA-256, SHA-384, SHA-512.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

HMAC generator — SHA-256, SHA-384 and SHA-512

A HMAC (Hash-based Message Authentication Code, RFC 2104) combines a secret key with your message to produce a keyed hash. Anyone who knows the key can recompute the same value, which proves the message was not tampered with and came from someone holding the key. It is the standard way to sign API requests and verify webhook payloads.

How it works

The tool uses the browser’s Web Crypto API. It UTF-8 encodes your secret key and imports it as an HMAC key bound to the chosen hash (SHA-256, SHA-384 or SHA-512), UTF-8 encodes your message, then calls crypto.subtle.sign to produce the authentication code. The resulting bytes are rendered as a lowercase hex string. Internally HMAC hashes the key combined with the message twice with inner and outer padding, which is what makes it resistant to length-extension attacks that affect a naive key-plus-message hash. The output updates live as you type.

Example

With key topsecret and message hello, HMAC-SHA-256 produces a fixed 64-character hex string. Re-running with the same inputs always gives the same value; changing a single character of either input changes the entire output.

AlgorithmOutput bitsHex length
HMAC-SHA-25625664
HMAC-SHA-38438496
HMAC-SHA-512512128

Everything runs locally in your browser via the Web Crypto API — your key and payload are never sent over the network.

Ad placeholder (rectangle)