Skip to content
ToolsLeb ToolsLeb

Secret Key Generator

Generate a cryptographically random secret key in hex, Base64, or Base32 format.

Share on Social Media:

Generate a random secret key of a chosen byte length (16-128 bytes), output in your choice of hex, Base64, or Base32 format. Useful for application secrets, signing keys, encryption keys, or any purpose that requires a high-entropy random value.

Frequently Asked Questions

The key is generated using random_bytes(), a cryptographically secure random source, then encoded into your chosen output format. The underlying randomness is identical across formats — only the representation changes.

Hex and Base64 are the most widely supported formats for application secrets and keys. Base32 is useful when you need to avoid case-sensitivity or ambiguous-looking characters.

Common uses include a Laravel/Django application secret, a JWT signing key, an encryption key for a config file, or a webhook signing secret.

32 bytes (256 bits) is a common, strong default for most application secrets and signing keys.