Free HMAC Generator Online
Generate HMAC signatures for API authentication using multiple hashing algorithms. Free, fast, and works entirely in your browser with no sign-up required.
Updated
HMAC Generator
Generate and verify HMAC (Hash-based Message Authentication Code) signatures for API authentication, webhooks, and data integrity.
HMAC Generator
Frequently Asked Questions
What is the HMAC Generator?
The HMAC Generator is a free online tool that creates Hash-based Message Authentication Code signatures for API authentication and data integrity verification.
Is the HMAC Generator free?
Yes, it is completely free with no registration required. All HMAC generation happens client-side in your browser.
What is HMAC used for?
HMAC is used to verify both the integrity and authenticity of messages, commonly used in API authentication, webhooks, and secure communication protocols.
Is my data safe with this tool?
Absolutely. The HMAC Generator processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.
Does the HMAC Generator work on mobile devices?
Yes, the HMAC Generator is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.
Do I need to create an account to use this tool?
No account or registration is needed. Simply open the HMAC Generator in your browser and start using it immediately. There are no sign-up walls or usage restrictions.
How do I use the HMAC Generator?
Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.
Which browsers are supported?
The HMAC Generator works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.
What is the difference between HMAC and a plain hash like SHA-256?
A plain hash such as SHA-256 takes a message and produces a fixed-length digest, but anyone can recompute it because no secret is involved. That proves a message hasn't changed only if you already trust the digest. HMAC mixes a secret key into the hashing process, so it proves both integrity and authenticity: the signature could only have been produced by someone holding the shared key. An attacker who sees your message still cannot forge a valid HMAC without that key, which is why webhooks and API signing rely on HMAC rather than a bare hash. The name even reflects this -- HMAC stands for Hash-based Message Authentication Code, a hash wrapped around a secret. This tool builds the HMAC for you: enter a message, supply your key, pick an algorithm, and copy the signature in hex or Base64.
Which HMAC algorithm should I use, and why avoid HMAC-SHA1?
For new work, HMAC-SHA256 is the recommended default and the most widely used algorithm in API signing -- Stripe, GitHub, and most modern providers use it. HMAC-SHA384 and HMAC-SHA512 give you larger digests (SHA-512 returns a 64-byte output) if your design calls for a wider security margin. HMAC-SHA1 is included only for legacy compatibility with older systems such as OAuth 1.0; you should not pick it for new designs, because SHA-1's collision weaknesses make it a poor foundation even though HMAC-SHA1 isn't broken in the same way a raw SHA-1 hash is. If you're unsure, start with HMAC-SHA256 and only change to match a provider that demands something else. This tool offers all four algorithms and instantly regenerates the signature when you switch, so you can compare outputs side by side.
Why does my HMAC signature not match the one from my API provider?
Mismatches almost always come from a difference in inputs rather than a broken algorithm, because HMAC is deterministic -- the same message and key always produce the same signature. Check four things. First, the exact message bytes: signing over a parsed or reformatted JSON body instead of the raw payload is the most common cause. Second, the key format: providers issue secrets as plain text, hex, or Base64, and decoding it wrong changes every byte. Third, the output encoding: confirm whether they expect hex or Base64. Fourth, the algorithm and any appended timestamp. This tool lets you control all of these explicitly -- enter the key as text, hex, or Base64, choose the algorithm, and select hex or Base64 output -- then use the Verify tab to paste the expected signature and confirm whether it matches before you debug your own code.
How does adding a timestamp to an HMAC prevent replay attacks?
A replay attack is when someone captures a validly signed request and re-sends it later to trigger the action again. Because HMAC is deterministic, the captured signature stays valid forever unless something in the signed data changes over time. The standard defense is to append a timestamp to the message before signing it, so the signature covers when the request was made. Your server then rejects any request whose timestamp falls outside a short window -- often a few minutes -- which makes a replayed signature stale and useless. This is exactly how providers like Stripe protect their webhooks. This tool can append a Unix epoch or ISO 8601 timestamp to your message before computing the HMAC, letting you reproduce a provider's signed string precisely or build your own replay-resistant signing scheme and test it against your verification logic.
How long should my HMAC secret key be?
A solid rule of thumb is to use a cryptographically random key of at least 256 bits, which is 32 bytes, and a key the same length as the hash output is a sound default -- 32 bytes for HMAC-SHA256, 64 bytes for HMAC-SHA512. Length matters less than randomness: a short, guessable, or human-chosen passphrase undermines HMAC no matter which algorithm you pair it with, because the whole security guarantee rests on the attacker not being able to find the key. Keys much longer than the hash's internal block size are hashed down first and give no extra strength. This tool includes one-click buttons to generate a random key of 16, 32, or 64 bytes using your browser's secure random number generator, so you can mint a properly sized secret without reaching for the command line, then sign with it immediately.
Embed This Tool
Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.
<iframe src="https://getthetoolbox.com/embed/hmac-generator" title="Free HMAC Generator Online — The Toolbox" width="100%" height="280" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/security-tools/hmac-generator?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free HMAC Generator Online</a> by The Toolbox</p>Related Tools
Free Hash Verifier Online
Verify file integrity by comparing hash checksums. Free, fast, and works entirely in your browser with no sign-up required.
Free Security Headers Analyzer
Check website security headers and get improvement suggestions. Free, fast, and works entirely in your browser with no sign-up required.
Free Encryption/Decryption Tool
Encrypt and decrypt text using AES, DES, and other algorithms. Free, fast, and works entirely in your browser with no sign-up required.
Free CSP Header Generator
Create Content Security Policy headers for your website. Free, fast, and works entirely in your browser with no sign-up required.
About the HMAC Generator
The HMAC Generator is a free online tool for creating and verifying HMAC signatures — the short cryptographic codes that prove a message came from someone holding the right secret key and arrived without being altered. You supply a message and a secret key, pick a hash algorithm, and the tool returns the signature in hexadecimal or Base64. It is built for developers and DevOps engineers who sign API requests, validate incoming webhooks from services like Stripe or GitHub, or check that a payload has not been tampered with in transit.
HMAC stands for Hash-based Message Authentication Code. Unlike a plain hash, it mixes a secret key into the hashing process, so an attacker who can see the message still cannot forge a valid signature without the key. That dual guarantee — integrity and authenticity — is why HMAC underpins so much of modern web security.
What you can generate and verify
The tool is organized into four tabs, each covering a real task:
- Generate — sign a typed message or an uploaded file (drag and drop is supported) and read back the signature.
- Verify — paste the original message, the key, and an expected signature; the tool recomputes the HMAC and tells you whether it matches, flagging a mismatch as possible tampering.
- Batch — sign many messages at once under a single shared key, handy when re-signing a list of payloads.
- Code Examples — copy ready-to-run snippets for Node.js, Python, PHP, Go, Ruby, and cURL, auto-generated for the exact algorithm and output format you selected.
Algorithms, keys, and output
Four hash algorithms are available: HMAC-SHA256 (the recommended default and the most widely used in API signing), HMAC-SHA384, HMAC-SHA512 for a larger 64-byte digest, and HMAC-SHA1, which is kept for legacy compatibility with older systems such as OAuth 1.0 and should not be used for new designs.
You can enter the secret key as plain text, hexadecimal, or Base64, matching whatever format your API provider issues. If you need a fresh key, one-click buttons generate a cryptographically random key of 16, 32, or 64 bytes using the browser's secure random number generator. A good rule of thumb is to use a random key of at least 256 bits (32 bytes); a key the same length as the hash output is a sound default. Signatures are returned in hex or Base64, and an optional timestamp (Unix epoch or ISO 8601) can be appended to the message before signing — a common pattern for preventing replay attacks on signed requests.
Why HMAC matters in practice
The most common use case is webhook verification. When a provider sends your endpoint an event, it includes an HMAC signature in a header computed over the raw payload. Your server recomputes the HMAC with the shared secret and compares the two; if they differ, the request is rejected. The same mechanism signs outbound API calls so the server can confirm the caller's identity. Because HMAC is deterministic, the same message and key always produce the same signature, which is exactly what makes verification possible.
One implementation note worth carrying back to your own code: in production, compare signatures with a constant-time function (such as Node's crypto.timingSafeEqual or Python's hmac.compare_digest) to avoid leaking information through timing differences.
Privacy and how it runs
Everything happens in your browser. The HMAC Generator uses the native Web Crypto API to compute signatures locally, so your messages, files, and — most importantly — your secret keys are never uploaded to or stored on any server. There is no sign-up and nothing to install. That client-side design is what makes it safe to paste a live API secret here while building or debugging an integration: it never leaves your device.