Skip to main content

HMAC Generator

Generate HMAC authentication codes using HMAC-SHA256, HMAC-SHA512, or HMAC-SHA1. Enter your message and secret key to get the hex or base64 HMAC instantly. Used for JWT signatures, webhook verification (GitHub, Stripe), and API request signing.

✓ HMAC-SHA256 / SHA512 / SHA1 ✓ Hex + Base64 output ✓ Web Crypto API — 100% in-browser

Frequently Asked Questions

What is HMAC and how is it different from a regular hash?▼

A regular hash (SHA-256, MD5) is a one-way transformation of data — anyone with the data can reproduce the hash. HMAC (Hash-based Message Authentication Code) adds a secret key to the process. Only someone with both the message and the key can produce the correct HMAC, so it proves both integrity (message not tampered) and authenticity (sender has the key).

What is HMAC-SHA256 used for?▼

HMAC-SHA256 is the standard for: JWT HS256 signatures (the third segment), webhook verification (GitHub, Stripe, Slack all sign payloads with HMAC-SHA256), API request signing (AWS Signature v4, Shopify webhooks), and session token validation. It's the de facto standard for proving message authenticity in web APIs.

Which algorithm should I use?▼

Use HMAC-SHA256 for most cases — it's the industry standard with 256 bits of security and near-universal library support. Use HMAC-SHA512 for extra security or when dealing with very sensitive data. Avoid HMAC-SHA1 for new systems — it's considered weak and should only be used for compatibility with legacy services.

What is the difference between hex and base64 output?▼

Both represent the same HMAC bytes in different encodings. Hex uses 0-9 and a-f characters — always 64 chars for HMAC-SHA256. Base64 uses A-Z, a-z, 0-9, +, / characters — 44 chars for HMAC-SHA256. Use hex for debugging and logging. Use base64 when transmitting in HTTP headers or URLs.

How do I verify a GitHub webhook signature?▼

GitHub sends X-Hub-Signature-256: sha256=<HMAC> in the webhook header. To verify: compute HMAC-SHA256 of the raw request body using your webhook secret as the key, encode as hex, and compare the result to the value after sha256= in the header. Use a constant-time comparison to prevent timing attacks.

Is it safe to generate HMACs in the browser?▼

This tool uses the Web Crypto API (crypto.subtle.sign) which runs entirely in your browser — the message and key never leave your machine. However, do not use real production secrets in any online tool as a general security practice. Use this tool to understand HMAC or verify implementations with known test vectors.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

OpenAPI Validator API Response Mock Generator API Response Time Tester OpenAPI Schema Validator OpenAPI Mock Generator API Test Case Generator API Request Builder HTTP Security Headers Generator API Mock Server Config Generator HTTP Security Headers Checker API Rate Limit Calculator API Response Formatter & Analyzer HTTP API Tester LLM Cost Calculator AI Prompt Cost Calculator REST API Request Builder Content Security Policy Builder LLM Prompt Cost Calculator API Response Mocker HTTP Header Inspector AI Rate Limit Calculator Prompt Injection Tester GCP Service Account Key Auditor HTTP Headers Analyzer API Key Generator AI Doc Generator — Pro Tool AI System Guardian .htaccess Generator HTTP Methods Reference HTTP Code Snippet Generator HTTP Status Code Reference HTTP Status Code Reference JSON Diff Viewer JSON Diff nginx Config Generator Password Strength Checker Rate Limiter Tester API Changelog Generator HTTP Mock Response Builder CSP Header Builder Rate Limit Calculator CORS Policy Builder AWS IAM Policy Validator HTTP Cookie Parser SBOM Generator HTTP Status Code Lookup HTTP Status Code Lookup Vue Component Generator HTTP Status Code Reference LLM Context Window Calculator HTTP Header Analyzer LLM Token Counter Dockerfile Linter mTLS Certificate Chain Builder Prompt Token Estimator Mock Service Worker (MSW) API Mocking Guide Pulumi Modern IaC Guide Casdoor Docker Layer Optimizer HTML5 Canvas API Playground Token Context Calculator GraphQL Client Configurator OpenAI Function Calling Generator Token Counter & Cost Estimator AI API Rate Limit Calculator Password Strength Analyzer React Component Generator

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →