HMAC-SHA1 Generator
Signing happens locally. Prefer throwaway keys for testing; rotate anything used in production.
About this tool
Compute HMAC-SHA1 signatures over any message using a secret key, entirely in your browser. The 160-bit signature is shown as 40 hex characters, in lowercase, uppercase, or Base64. Neither the message nor the key is uploaded, and the key is never written to localStorage.
How to use
- Type or paste the message into Message — the signature updates as you type.
- Enter the secret key and choose whether it is plain text (UTF-8) or hex bytes.
- Pick hex or Base64 for the 20-byte signature.
- Copy the signature, or paste an expected signature to verify it.
Example
Algorithm: HMAC-SHA-1 Message: hello Key: secret (plain text) Signature: 5112055c05f944f85755efc5cd8970e194e9f45b
Encoding the same key as hex bytes (736563726574) produces the same signature, because both describe the identical bytes.
HMAC-SHA-1 parameters
| Property | Value |
|---|---|
| Underlying hash | SHA-1 |
| Digest size | 160 bits (20 bytes) |
| Hex length | 40 characters |
| Block size | 64 bytes |
| Web Crypto name | HMAC with hash "SHA-1" |
Why HMAC-SHA-1?
HMAC-SHA1 is still the mandatory signature for a lot of existing protocols: OAuth 1.0 request signing, AWS Signature Version 2, many webhook providers, and older TOTP/HOTP implementations. You reach for it when you must interoperate with a system that already specifies SHA-1. For new designs prefer HMAC-SHA256 — the digest is longer and the construction avoids the collision weaknesses that affect plain SHA-1.
FAQ
What is HMAC-SHA1?
HMAC-SHA1 is a keyed message authentication code that uses SHA-1 as its underlying hash. It produces a 160-bit signature that only someone holding the secret key can generate or verify.
Is HMAC-SHA1 still safe?
HMAC-SHA1 is stronger than plain SHA-1 and has no practical forgery attack, so it remains acceptable in legacy protocols. New designs should use HMAC-SHA256, and TLS certificates should not rely on SHA-1 at all.
What is the difference between SHA-1 and HMAC-SHA1?
A plain SHA-1 hash takes no key, so anyone can compute it. HMAC-SHA1 mixes a secret key into the digest, which is what makes it suitable for authenticating requests and webhooks.
How long is an HMAC-SHA1 signature?
160 bits — 20 bytes, written as 40 hexadecimal characters or 28 Base64 characters with padding.
Why does my signature not match the server's?
It is almost always an encoding difference: the key as raw UTF-8 bytes versus hex, extra whitespace or a trailing newline in the message, or hex versus Base64 output. Compare the exact bytes, not the visible text.
Is my key stored anywhere?
No. The key stays in the input field for the current view and is deliberately excluded from localStorage, so it is gone when you reload or navigate away.