HMAC Generator
Enter a message and a key to get an HMAC with SHA-256, SHA-384, SHA-512, SHA-1, or MD5. The key can be text, hex, or Base64.
Enter a message and the HMAC appears here.
Everything runs in your browser. Neither the message nor the key is uploaded. Only the algorithm and format choices are saved on this device, never the message or key.
How to Use
- Type or paste the content to sign into “Message”. It's used as UTF-8, so accented letters and emoji work too.
- Pick an “Algorithm”. SHA-256 is the usual choice; choose SHA-384 or SHA-512 to match the other system, and MD5 or SHA-1 only for older systems.
- Choose the “Key format” first, then paste the key: UTF-8 text for a readable secret, Hex for a hexadecimal string (spaces and a 0x prefix are fine), Base64 for Base64 (missing = and line breaks are fine, and the URL-safe alphabet works too). If the format is invalid, you're told which character is wrong.
- Switch the output between Hex and Base64 to match the other side, then press “Copy” to paste it into code or a request header.
- Only the algorithm and format choices are saved on this device, never your message or key.
FAQ
What is HMAC and how is it different from a plain hash?
HMAC is a message authentication code computed from a secret key and a hash function. A plain hash depends only on the content, so anyone can compute it. An HMAC needs both the message and the key, so the receiver recomputes it with the same key: a match shows the message wasn't changed and really came from someone holding the key. That's what API signatures and webhook verification rely on.
Can an HMAC be decrypted? Is it encryption?
No, and no. Like a hash, it's one-way: the output is just an authentication code that doesn't contain the original data. Encryption uses a key to turn data into something unreadable that the key can later turn back; HMAC has no such step. To keep content secret use encryption such as AES. HMAC only proves content wasn't altered and came from a trusted source.
How do I choose the key format?
Look at what your key looks like. A readable string such as my-secret-key is UTF-8 text; a long string of 0-9 and a-f is Hex; letters, digits, + and /, or a trailing =, is Base64. A wrong choice usually shows an error right away pointing at the first character that doesn't fit, with a hint to try UTF-8 text. Note that the same characters read in different formats are completely different keys.
Why does my result differ from the other system's?
Most often the key or message really differs: the wrong key format, extra spaces or a line break around the key, a trailing newline in the message, or the other side signs something different, such as a normalized request or one with a timestamp added. A different algorithm or output format (hex versus Base64) also looks completely different. A single changed bit gives a totally different HMAC, so check each item.
Are HMAC-MD5 and HMAC-SHA1 still OK to use?
Yes. HMAC doesn't depend on collision resistance the way a plain hash does, and there's currently no practical attack on HMAC-MD5 or HMAC-SHA1, so older systems still use them. For anything new, prefer SHA-256 or stronger to avoid being asked to migrate later. They're included here to match legacy setups.
Are my message and key uploaded?
No. The calculation runs only in your browser and neither the message nor the key is sent to a server, so even a production signing key never passes through this site. Only your algorithm and format choices are saved on this device, never the message or key, so the next person on a shared computer won't see them.
Related Tools
Hash Generator
Enter text or choose a file to get MD5, SHA-1, SHA-256, SHA-384, and SHA-512 at once. Paste an expected value to see which algorithm matches.
AES Encryption and Decryption
Encrypt or decrypt text with AES-128, 192, or 256 in CBC, GCM, CTR, or ECB mode. Enter the key and IV as text, hex, or Base64.
Base64 Encoder & Decoder
Type in either box to encode text as Base64 or decode Base64 back into text. UTF-8 safe, with a URL-safe alphabet option.
Text to Binary & Hex Converter
Type in either box to turn text into the binary, octal, decimal, and hex of each UTF-8 byte, or decode those bytes back into text.
URL Encoder & Decoder
Type in either box to percent-encode text for a URL, or decode %20-style sequences back into readable text.
Base Converter
Type in any field to convert between bases 2, 8, 10, 16, and any base from 2 to 36, with big numbers, negatives, repeating fractions, and two's complement.