HMAC stands for Hash-based Message Authentication Code. It combines a cryptographic hash function with a secret key so the recipient can check both message integrity and knowledge of the shared secret.

HMAC is not just a hash

A normal SHA-256 hash does not require a secret. Anyone can calculate it. HMAC-SHA-256 incorporates a key, so producing the expected result requires that secret key.

Common uses

HMAC appears in API request signing, webhook verification, message authentication and other protocols. The exact input format matters: changing whitespace, encoding, field order or timestamps changes the signature.

Security notes

  • Use strong secret keys generated for the application.
  • Do not expose production secrets in screenshots, logs or shared test pages.
  • Follow the exact signing format documented by the provider.
  • Compare signatures using an appropriate constant-time method in production code.

Generate a test HMAC

The HMAC Generator uses the browser Web Crypto API and supports SHA-256, SHA-384 and SHA-512. It is useful for testing, but production implementations should follow the security guidance of the platform you are integrating with.