K

HMAC-SHA-256 Calculator

HMAC-SHA-256 (RFC 2104)

Client-side computation for analysis, verification, and learning. Do not paste production secrets into untrusted sites; prefer local tooling for key material.

Educational / engineering use. RSA mode uses tiny primes for illustration only—not for real key generation.

Secret key (UTF-8)
Message (UTF-8)

Add HMAC-SHA-256 Calculator Free On Your Website

Paste this HTML on your site.

What is HMAC-SHA-256 Calculator?

HMAC combines a secret key with SHA-256 hashing to produce a message authentication code. Used to verify both data integrity and authenticity ensuring the message wasn't tampered with and came from a trusted source.

HMAC Formula

HMAC(K,M)=H((Kopad)H((Kipad)M))HMAC(K,M) = H((K' ⊕ opad) || H((K' ⊕ ipad) || M))

Where K' is key padded/hashed to 64 bytes, ipad = 0x36 repeated, opad = 0x5C repeated, || is concatenation, H = SHA-256.

HMAC Step-by-Step

  1. Enter secret key and message.
  2. Normalize key length.
  3. Build inner and outer padded keys.
  4. Compute inner hash then outer hash.
  5. Return HMAC tag.

HMAC Worked Example

Key: "secret", Message: "hello"

Step 1: Pad key to block size (64 bytes).

Step 2: Compute inner hash H((K XOR ipad) || message).

Step 3: Compute outer hash H((K XOR opad) || inner_hash).

Final HMAC:

88aab3ede8d3adf94d26ab90d3bafd4a

2083070c3bcce9c014ee04a443847c0b

Where HMAC-SHA-256 Calculator Is Applied

  • AWS request signing (Signature Version 4)
  • JWT token authentication (HS256)
  • Webhook payload verification (GitHub, Stripe, Shopify all use it)
  • OAuth 2.0 token validation
  • API request integrity checks
  • Cookie tamper detection in web applications
  • Two-factor authentication (TOTP) — RFC 6238

Related Cryptography Calculators

Explore similar calculators to streamline your workflow.

View all
Calculator By Adil Balti, Content Proofread and Verify by Muhammad Kumail & Gulzar Abbas.

About Calculators.is

At Calculators.is our sole focus is to provide 100% accurate, fast, comprehensive, convenient, easy-to-use free online calculators to everyone to use without spending a single $ on any online Calculators.

All the calculators on our website are designed and developed by our own team, and each one is put through strict, comprehensive testing before being made live on our website.

About, Founder and calculator.is.