About the Secret Key Generator
Create strong random secrets for applications: API keys, JWT and session signing secrets, and encryption keys, at 128, 256 or 512 bits, in the format you need.
Key features
- 128, 256 or 512-bit keys
- Hex, Base64, Base64URL or alphanumeric
- Cryptographically secure randomness
- Five keys at a time
- One-click copy
- Never sent anywhere
Generate secure keys for your apps
Applications need random secrets for signing tokens, encrypting data and securing sessions. Choose the strength and format, then copy a key.
Common uses
| Use | Recommended |
|---|---|
| JWT secret (HS256) | 256 bits |
| Session or cookie secret | 256 bits |
| AES-256 key | 256 bits (hex: 64 characters) |
| API key | 128–256 bits, Base64URL |
| NextAuth / Auth.js AUTH_SECRET | 256 bits, Base64 |
Key lengths by format
| Strength | Hex | Base64 | Base64URL |
|---|---|---|---|
| 128 bits | 32 chars | 24 chars | 22 chars |
| 256 bits | 64 chars | 44 chars | 43 chars |
| 512 bits | 128 chars | 88 chars | 86 chars |
Related tools
UUID generator, password generator, and bcrypt generator.
How to use the Secret Key Generator
- Enter your text, password or settings in the tool above.
- Results appear instantly and are calculated in your browser.
- Read the explanation and warnings under the result.
- Copy what you need. Nothing is uploaded or stored.