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.
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.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
API Response Mock Generator
Generate realistic mock API responses with custom status codes, headers, and JSON body. Quick templates for 200, 401, 404, 429, 500 and more. Runs in your browser.
Open free tool →
API Response Time Tester
Test API endpoint response times directly from your browser. Run multiple requests, see average/min/max times, status codes, and response sizes. GET, POST, PUT, DELETE support. Free.
Open free tool →
More Free Tools
Related Articles
JWT Authentication Best Practices 2026: Secure Your API Tokens
Complete JWT security guide for 2026. Covers RS256 vs HS256 signing, token storage strategies, expiry and refresh token patterns, revocation, common vulnerabilities, and a production security checklist.
JWT Token Decoder: How to Debug Authentication Issues
Learn how to use a JWT token decoder to diagnose 401 errors, expired tokens, missing claims, and auth misconfiguration. Practical debugging guide with code examples.
JWT Tokens Explained: How to Decode and Debug Them
Understand JSON Web Tokens from header to signature. Learn how to decode JWTs, read their claims, debug authentication issues, and use free online JWT tools.
JWT Decoder: How to Read Token Payloads
Learn how to decode JWT tokens and read their payloads. A practical guide to JWT structure, claims, expiry checking, and debugging auth issues with a free online decoder.
How to Generate Secure Passwords: Entropy, Strength, and Best Practices
Learn how to generate truly secure passwords, understand password entropy, evaluate password strength, and implement password policies. Includes code examples and security guidelines.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →