Random Secret Key Generator
Generate high-entropy random keys for APP_KEY, JWT secrets, and secure application credentials.
Runs in your browser Your input never leaves your device.
About this tool
Generate a random secret key of a chosen length in hex or Base64. Pick the number of bytes (8 to 256, default 32) and the format, then press Generate. The key is made in your browser with the Web Crypto random number generator and is never sent to a server. Hex output has two characters per byte, so 32 bytes gives 64 characters. Base64 output is the standard alphabet with padding. Use it for application keys, signing secrets and similar values.
How to use it
- Choose the number of bytes (32 is a common choice).
- Select Hex or Base64.
- Press Generate and copy the key.
- Store it in a secrets manager or environment variable, not in source control.
Common problems
- Key length differs from what you asked
- The length is in bytes, not characters. 32 bytes is 64 hex characters or 44 Base64 characters. Values outside 8-256 are clamped.
- Your framework rejects the key
- Some frameworks expect a specific format or prefix, such as Laravel's "base64:" prefix for APP_KEY. Add the prefix yourself if required.
- Key was shared by accident
- Generated keys are not stored anywhere. If a key leaks, generate a new one and rotate it everywhere it is used.