Choosing a length and encoding
16–32 random bytes (128–256 bits) is the common range for API keys and session secrets. Hex is the most compatible; Base64 is more compact; Base64URL is safe to use directly in a URL path or query string.
Generate cryptographically random secrets and API keys as hex, Base64, or Base64URL directly in your browser. Nothing is uploaded, and generated values are never stored.
16–32 random bytes (128–256 bits) is the common range for API keys and session secrets. Hex is the most compatible; Base64 is more compact; Base64URL is safe to use directly in a URL path or query string.
A secret here has no character-class structure to remember — it is meant to be copied once into a configuration file or secret manager, not typed or memorized.
Every byte is drawn from the Web Crypto API's cryptographically secure random number generator — the same source used by this site's AES key and IV generation.