What is Hash and HMAC Generator?
A browser-based hash and HMAC generator that provides ready-to-use JavaScript code snippets for computing cryptographic hashes with the Web Crypto API. Supports SHA-256, SHA-384, SHA-512, SHA-1, and MD5. For HMAC (keyed hash), provide a secret key. The tool generates copy-paste JavaScript code that works in any modern browser.
quickAnswer
Generate JavaScript code to compute SHA-256, SHA-384, SHA-512, SHA-1, or MD5 hashes. HMAC mode available with a secret key. Uses the Web Crypto API — runs in all modern browsers.
Last updated: 2026-06-08
limitations
- The Web Crypto API (crypto.subtle) is asynchronous — the generated code uses Promises, which may add complexity for simple use cases.
- MD5 is not supported by crypto.subtle.digest in modern browsers. For MD5, you need a third-party library or manual implementation.
- This tool generates code snippets, not direct hash output — it is an educational and code-generation tool, not an instant hash calculator.
Sources:MDN Web Docs · W3C Specifications · jquery.app on GitHub
How to use this tool
- Choose a hash algorithm (SHA-256 recommended for security).
- Enter the text you want to hash.
- Enable HMAC mode if you need a keyed hash and provide a secret key.
- Copy the generated JavaScript code and use it in your project.
What you can use it for
- Generate a SHA-256 hash of a password before storing it (with a salt in production).
- Create an HMAC signature for API request authentication using a shared secret key.
- Verify file integrity by comparing a SHA-256 hash against a known checksum value.