Free HMAC generator — compute HMAC-SHA256/384/512 and SHA-1 from a message and key in your browser

0 characters

HMAC-SHA-256 (hex)

Your HMAC will appear here...

Computed locally with the Web Crypto API — your message and secret never leave your browser.

🔑 HMAC Generator — Free Online Tool

Generate HMAC-SHA256, SHA-384, SHA-512 & SHA-1 online, free. HMAC (Hash-based Message Authentication Code, defined by RFC 2104 and FIPS 198-1) combines a secret key with a hash function to prove both the integrity and the authenticity of a message — only someone who knows the key can produce or verify the code. This tool computes the HMAC of your message with SHA-256, SHA-384, SHA-512 or SHA-1 using the browser's Web Crypto API, output as hex or Base64, entirely on your device.

🚀 Why use this HMAC Generator tool?

HMACs are computed with the browser's standards-based Web Crypto API (SubtleCrypto.sign), so the message and the secret key are never uploaded, logged, or stored — safe for production signing keys. 100% free, no registration, and complete privacy — everything runs locally in your browser, so your data never touches a server.

Key Features

🧮Four hash algorithms

Compute HMAC with SHA-256 (the common default), SHA-384, SHA-512 or SHA-1 — pick the one your API or webhook expects.

🔁Hex or Base64 output

Switch the digest encoding between lowercase hex and Base64 to match exactly what your verifier compares against.

Live as you type

The HMAC recomputes instantly via the Web Crypto API whenever the message, key, algorithm or encoding changes.

🔒100% private

Both the message and the secret key are processed locally; nothing is transmitted, so it is safe for real signing keys.

Popular Use Cases

Webhook verification

  • Reproduce a provider's X-Signature header
  • Verify Stripe/GitHub webhook signatures
  • Debug a failing signature check

API authentication

  • Sign request payloads (AWS SigV4-style)
  • Build a message authentication tag
  • Compare client vs server HMAC

Learning & testing

  • See how key changes alter the digest
  • Compare SHA-256 vs SHA-512 length
  • Generate fixtures for unit tests

What It Handles

Algorithms

  • HMAC-SHA256
  • HMAC-SHA384
  • HMAC-SHA512
  • HMAC-SHA1

Output

  • Hex digest
  • Base64 digest
  • Copy to clipboard

Privacy

  • Web Crypto API
  • No network calls
  • Runs offline

Sources & References

Frequently Asked Questions

What is an HMAC and how is it different from a plain hash?

An HMAC mixes a secret key into the hashing process (per RFC 2104), so unlike a plain SHA-256 digest — which anyone can recompute — only parties who hold the key can generate or verify the code. That is what lets webhooks and APIs prove a message is authentic and untampered.

Which algorithm should I use — SHA-256, SHA-384 or SHA-512?

HMAC-SHA256 is the de-facto standard and what most APIs (Stripe, GitHub, AWS) expect. Use SHA-384 or SHA-512 when a service explicitly requires a longer digest. HMAC-SHA1 is still secure as an HMAC for legacy compatibility, but prefer SHA-256 for new systems.

Is there a free alternative to FreeFormatter's HMAC generator?

Yes — this HMAC generator is free with no signup and runs entirely in your browser, so your message and secret never reach a server. It supports SHA-256/384/512/SHA-1 with hex or Base64 output, covering the same cases as FreeFormatter's tool while keeping your key private.

Should the output be hex or Base64?

It depends on what your verifier compares against. Many webhook signatures (GitHub, Stripe) use lowercase hex; others (some AWS and OAuth flows) use Base64. The HMAC bytes are identical — only the text encoding differs — so switch to whichever your system expects.

Is it safe to paste my secret key here?

Yes. The HMAC is computed with the browser's Web Crypto API entirely on your device; the key and message are never uploaded, logged, or stored. Still, treat production keys carefully and only use tools whose privacy you can verify.

Why does my HMAC not match the server's?

The most common causes are a different output encoding (hex vs Base64), trailing whitespace or a newline in the message, a key with extra characters, or the wrong hash algorithm. Match the exact bytes the server signs, including any line endings, and pick the same algorithm.

🎓 Pro Tips

  • Tip 1: Match the server's exact message bytes — a stray trailing newline is the most common reason an HMAC fails to verify.
  • Tip 2: Compare HMACs in constant time on the server (e.g. crypto.timingSafeEqual) to avoid timing side-channels; this tool is for generation and debugging.
  • Tip 3: HMAC-SHA256 with hex output covers the majority of webhook providers — start there unless the docs say otherwise.