Developer Tools

HMAC Generator

Live

Generate a keyed message authentication code with a selected SHA algorithm.

About HMAC Generator

Generate a keyed message authentication code with a selected SHA algorithm. Enter message, secret key, hash algorithm, key encoding in a purpose-built developer workspace with explicit units and relevant controls. The Web Crypto API imports the entered secret as an HMAC key and signs the UTF-8 message locally in the browser. The result panel reports hex hmac, base64 hmac, message bytes, digest bytes with supporting context. Results depend on the entered assumptions and should be checked against the real terms, measurements, or source data. Processing stays in your browser and entered values are not sent to UtilityPages.

Set up HMAC Generator

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

This workspace updates as you edit.

Enter the message used by this tool.

Enter the secret key used by this tool.

Enter the hash algorithm used by this tool.

Enter the key encoding used by this tool.

HMAC Generator results

Enter the values above, then generate hmac to see the result.

HMAC Generator method

The Web Crypto API imports the entered secret as an HMAC key and signs the UTF-8 message locally in the browser.

How it works

The Web Crypto API imports the entered secret as an HMAC key and signs the UTF-8 message locally in the browser. Results depend on the entered assumptions and should be checked against the real terms, measurements, or source data.

Examples

HMAC Generator example

Example input
{
    "message": "UtilityPages signed message",
    "secret_key": "change-this-secret",
    "algorithm": "SHA-256",
    "key_encoding": "utf8"
}
Expected result
{
    "hex_digest": "f9ac85a5e9f69cb026c8287161c2817a335d1817a1069ca0c11de3e792881f48",
    "base64_digest": "+ayFpen2nLAmyChxYcKBejNdGBehBpygwR3j55KIH0g=",
    "message_bytes": 27,
    "digest_bytes": 32
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Frequently asked questions

How does the HMAC Generator work?

The Web Crypto API imports the entered secret as an HMAC key and signs the UTF-8 message locally in the browser.

What should I enter in the HMAC Generator?

Enter message, secret key, hash algorithm, key encoding. Keep units consistent with the labels and use values from the same scenario.

What does the HMAC Generator return?

The result includes hex hmac, base64 hmac, message bytes, digest bytes. Supporting values are included to make the headline result easier to check.

How exact is the HMAC Generator?

Results depend on the entered assumptions and should be checked against the real terms, measurements, or source data.