Secret Key Generator
Generate cryptographically secure secret keys for JWT signing, API authentication, webhook validation, session secrets, and encryption. All keys are generated locally in your browser โ nothing is sent to any server.
QUICK PRESETS
Character Set
.env) or a secrets manager (like Vercel Secrets, AWS Secrets Manager, or HashiCorp Vault).How It Works
This tool generates random keys using crypto.getRandomValues() โ the same Web Crypto API used by browsers for TLS, HTTPS handshakes, and cryptographic operations. This is a CSPRNG (Cryptographically Secure Pseudo-Random Number Generator), fundamentally different from Math.random() which is not suitable for security-sensitive values.
To prevent modulo bias (where some characters would appear more frequently than others), the tool uses rejection sampling: if a random value falls outside the largest multiple of the charset length that fits in a 32-bit integer, it discards that value and generates a new one. This guarantees a uniform distribution across all characters.
Why Use a Dedicated Secret Key Generator?
Many developers make the mistake of using weak or predictable values as secret keys โ short strings, project names, or passwords. A compromised JWT secret allows attackers to forge valid tokens and impersonate any user. A compromised API key exposes your backend. A compromised webhook secret allows request forgery.
This generator creates keys with sufficient entropy (minimum 128 bits recommended, 256+ bits for long-term secrets) using a vetted cryptographic source. The entropy meter shows you exactly how strong your key is in bits, making it easy to meet security compliance requirements.