We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Securely calculate message authentication codes (MAC). Supports SHA256, SHA512, and other algorithms to verify data integrity and sender identity.
Configure parameters to start calculation
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
HMAC combines a message with a shared secret key and a selected hash function to produce a message authentication code. A verifier who has the same key can calculate the expected code and compare it with the received value. HMAC does not conceal the message, and the output cannot be reversed to recover it.
HMAC(K, m) = H((K′ ⊕ opad) ∥ H((K′ ⊕ ipad) ∥ m))Here, K is the secret key, m is the message, and H is the chosen hash function. The result changes if the message, key or algorithm changes. This page requires both message and key fields to be nonempty and displays the result as lowercase hexadecimal.
The available choices are SHA-1, SHA-256, SHA-384 and SHA-512, with SHA-256 selected by default. Standard HMAC outputs have 160, 256, 384 and 512 bits respectively, corresponding to 40, 64, 96 and 128 hexadecimal characters. The algorithm name must match the other system exactly; a longer digest is not automatically a compatible replacement.
Do not use this page’s SHA-384 option for interoperability or security work. Its implementation truncates an HMAC-SHA-512 result rather than computing HMAC with SHA-384. It therefore does not match standard HMAC-SHA-384 test vectors. Use a trusted implementation that computes the exact algorithm named in your protocol.
For a quick manual check, use a harmless test message and non-production key, then reproduce the same HMAC with the software that will verify it. Confirm the precise message bytes, text encoding, whitespace, line endings, key bytes, algorithm and output encoding. Two strings that look alike can produce different codes if their underlying bytes differ.
For new integrations, select SHA-256 or another explicitly required SHA-2 option and follow the protocol specification. NIST advises transition away from SHA-1 where possible and encourages SHA-256 at minimum for interoperability in new applications. Existing integrations may require another algorithm, so follow their documented requirements.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Choose the same HMAC-SHA algorithm specified by the receiving API, webhook or application.
Use a test fixture while checking behavior. Match capitalization, spaces, line breaks and encoding with the real protocol’s canonical message format.
The output is lowercase hexadecimal. Compare it with a known test vector or an independent trusted implementation.
Recalculate with the same secret and exact message bytes. A mismatch can come from the key, algorithm, canonicalization, encoding or output format.
Q&A
Find concise answers to common questions and confusing cases.
No. HMAC authenticates data with a shared key; it does not encrypt or encode the original message.
The SHA-384 choice on this page truncates HMAC-SHA-512 instead of computing standard HMAC-SHA-384. Do not use that option for compatibility checks or security work.
Check the exact bytes, including whitespace, line endings and text encoding, then confirm the algorithm and any protocol-specific canonicalization.
Follow the protocol’s requirement. NIST recommends transitioning away from SHA-1 where possible and encourages at least SHA-256 for interoperability in new applications.
Notes
Review scope, result limitations, and important precautions before use.
SHA-384 on this page is not standard HMAC-SHA-384. The result is formed by truncating HMAC-SHA-512 and can fail verification by conforming systems. Do not use it in production, for signatures, or for interoperability. Treat other outputs as manual checks only; use a vetted cryptographic library in applications and follow the relevant protocol’s key handling, encoding and verification requirements. Do not enter production secrets into a browser tool.
Related
Discover related tools, collections, and available API capabilities.