Hmac generator
Computes a hash-based message authentication code (HMAC) using a secret key and your favorite hashing function.
Plain text to compute the hash
Secret key
Hashing function
Output encoding
HMAC of your text
Usage Guide & Notes
- Enter your message text in the plain text area
- Provide a strong secret key
- Select your hashing algorithm (SHA256 is recommended for most uses)
- Choose your preferred output encoding format
- The HMAC will be generated automatically
- Use the copy button to copy the result to your clipboard
HMAC (Hash-based Message Authentication Code) is a mechanism for calculating a message authentication code using a cryptographic hash function combined with a secret key. It simultaneously verifies both data integrity and authenticity.
HMAC security depends on:
- The cryptographic strength of the underlying hash function
- The length and entropy (randomness) of the secret key
- The proper implementation of the HMAC algorithm
Unlike standard hashing, HMAC requires a shared secret key between the sender and receiver.
- Use a strong, random secret key with at least 32 bytes of entropy
- While an empty key is allowed, it significantly reduces security - only use for testing
- Choose SHA256 or stronger algorithms for security-sensitive applications
- Avoid MD5 and SHA1 for new security implementations (they're cryptographically weak)
- All computation happens locally in your browser - no data is transmitted
- Keep your secret key secure - anyone with the key can generate or validate HMACs
- For web APIs, consider adding timestamp and nonce values to prevent replay attacks
- API Authentication: Verifying that API requests are authentic and unaltered
- Message Integrity: Ensuring data hasn't been tampered with during transmission
- Webhook Verification: Validating that webhook payloads come from trusted sources
- Cookie/Token Security: Adding tamper-proof signatures to session tokens
- File Integrity: Verifying downloaded files haven't been modified
- Challenge-Response Systems: Creating one-time authentication challenges
- HMAC vs Plain Hashing: HMAC adds a secret key, providing authentication in addition to integrity
- HMAC vs Digital Signatures: HMAC uses symmetric keys (faster but requires secure key exchange), while digital signatures use asymmetric keys (slower but easier key distribution)
- HMAC vs Encryption: HMAC verifies authenticity and integrity but doesn't hide the original message
Related Tools
Useful tools selected for this workflow

Password Generator
Generate strong, secure, random passwords with customizable length, characters, and options. Free online password generator with entropy calculation.

BIP39 Generator
Generate secure BIP39 mnemonic phrases for cryptocurrency wallets. Create passphrases with different entropy levels and in multiple languages.

QRCode Generator
Generate QR codes for URLs, text, or any data with custom colors and settings.

JSON XML Converter
Convert JSON to XML format easily. Transform data between these popular formats with this free online tool.

JSON TOML Converter
Convert JSON to TOML format easily. Transform data between these popular formats with this free online tool.

JSON Formatter
Format and beautify JSON with customizable indentation. Supports JSON5, comments, trailing commas and advanced formatting options.