HMAC Generator
Software · 3 inputs · Free
HMAC Generator
Parameters
What is this tool?
HMAC Generator helps developers with encoding, encryption and text processing. Computes the HMAC signature (RFC 2104) of a message and secret key with SHA-256, SHA-1, SHA-384 or SHA-512 and returns it as hex and Base64. Everything runs in your browser and the key is never sent anywhere; message and key are read as UTF-8.
📘 Common mistakes · Worked exampleComputes the HMAC signature (RFC 2104) of a message and secret key with SHA-256, SHA-1, SHA-384 or SHA-512 and returns it as hex and Base64. Everything runs in your browser and the key is never sent anywhere; message and key are read as UTF-8.
The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.
Last reviewed: · Methodology and sources
How is it calculated?
Computes the HMAC signature (RFC 2104) of a message and secret key with SHA-256, SHA-1, SHA-384 or SHA-512 and returns it as hex and Base64. Everything runs in your browser and the key is never sent anywhere; message and key are read as UTF-8.
Inputs
| Value | Unit | Example |
|---|---|---|
| Message | — | The quick brown fox jumps over the lazy dog |
| Secret key | — | key |
| Algorithm | — | HMAC-SHA-256 |
What is this tool?
HMAC Generator helps developers with encoding, encryption and text processing. Computes the HMAC signature (RFC 2104) of a message and secret key with SHA-256, SHA-1, SHA-384 or SHA-512 and returns it as hex and Base64. Everything runs in your browser and the key is never sent anywhere; message and key are read as UTF-8.
Common mistakes
- Using SHA-256(key + message) instead of HMAC. With SHA-1, SHA-256 and SHA-512, anyone who knows the digest and the length can append data and compute a valid digest without the key (a length-extension attack). The nested structure of HMAC prevents this.
- Signing re-serialised JSON. Once a framework has parsed the body and written it out again, whitespace, key order or escaping may differ and the signature no longer matches. Always use the raw body as received.
- Comparing signatures with ==. An ordinary comparison stops at the first differing byte and can leak timing information; use crypto.timingSafeEqual in Node.js, hmac.compare_digest in Python or hash_equals in PHP.
- Assuming a hex or Base64 key is decoded. Some providers sign with the decoded bytes of the secret; this tool reads the key as plain text, so the result will differ in that case.
- Missing an invisible trailing newline or space. The input is not trimmed, and a single line break picked up while copying produces a completely different tag.
- Mixing up hex and Base64, or forgetting a prefix such as sha256=. Make sure both values are in the same notation before comparing.
- Choosing a short or guessable key. An attacker who captures one message and its tag can test weak keys offline.
📘 How HMAC Works: HMAC-SHA256, Keys and Webhook Signatures →
Sources
- RFC 2104 — HMAC: Keyed-Hashing for Message Authentication ↗
- RFC 4231 — Identifiers and Test Vectors for HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 ↗
- NIST FIPS 198-1 — The Keyed-Hash Message Authentication Code (HMAC) ↗
- W3C — Web Cryptography API (sign method and HMAC) ↗
Key terms
Frequently Asked Questions
+HMAC Generator — how is it calculated?
Computes the HMAC signature (RFC 2104) of a message and secret key with SHA-256, SHA-1, SHA-384 or SHA-512 and returns it as hex and Base64. Everything runs in your browser and the key is never sent anywhere; message and key are read as UTF-8.
+Which values are required?
Message, Secret key, Algorithm.
+Is my data stored?
No. All calculations run in your browser; the values you enter are never sent to or stored on a server. If you press “Save”, the calculation stays only in your own browser and you can delete it at any time.
+Is it free?
Yes, all tools are free and require no sign-up.
Similar tools
Popular Tools
Free Calculators in One Place
Tax, finance, health, math and more — 500+ tools, all in one place.