HMAC Generator
Create a keyed-hash message authentication code from text and a key.
Result
How it is calculated
HMAC mixes a secret key into a hash so that only someone who knows the key can produce or check the value: HMAC(K, m) = H((K ⊕ opad) ‖ H((K ⊕ ipad) ‖ m)), where H is the chosen hash, m the message text and K the key. The tool supports SHA-256 (the default), SHA-1, MD5 and SHA-512, and any other value falls back to SHA-256. Both the text and the key must be filled in. The output is lowercase hexadecimal: 64 characters for SHA-256, 128 for SHA-512, 40 for SHA-1 and 32 for MD5. The same text, key and algorithm always give the same value, and even a one-character change gives a completely different one.
Worked example
The message is order=1042&amount=59.90, the key is s3cret-key and the algorithm is SHA-1. The tool applies the HMAC construction to the text bytes and returns 40 hex characters: 7b77ae021175ae405bff9d1e83b136dde61744ff. A server that holds the same key recomputes this value from the received message and compares it with the one sent; if one character of the message changes, the values no longer match.
Common mistakes
- Adding a trailing space or line break to the text or key. It is part of the input, so the result changes completely.
- Comparing HMACs produced with different algorithms. SHA-1 and SHA-256 outputs for the same input will never match.
- Treating HMAC as encryption. The message is not hidden and cannot be recovered from the value; it only proves integrity and knowledge of the key.
- Using a short or guessable key. Security rests on the key, so a weak key can be found by guessing.
- Pasting a real production secret into any online tool; use a test key.
About this calculator
This tool generates an HMAC (Hash-based Message Authentication Code) — a cryptographic construction that combines a secret key with a hash function (SHA256, SHA1, MD5, or SHA512) to verify both the integrity and authenticity of a message. Unlike a plain hash, an HMAC can't be reproduced without knowing the secret key, so it proves the message wasn't tampered with and came from someone who holds that key.
Developers use HMACs to sign API requests (many REST APIs authenticate calls this way), verify webhook payloads, protect JWTs, and secure session tokens. SHA256 is the current standard for most security-sensitive uses, since MD5 and SHA1 are considered cryptographically weak.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The output is a hexadecimal tag, and the same text and key always give the same tag, so it is handy for checking a webhook signature or API request. Both sides must use identical bytes, including spaces and line endings, or the tags will differ. Avoid pasting a real production secret into any web page, and prefer SHA-256 or SHA-512 over MD5 or SHA-1 for new work. If your tag does not match a server, which algorithm does it use?