How it works
This tool produces a random string in the format you need: hex, Base64url, alphanumeric, lowercase alphanumeric, or a UUID v4. Use it for API keys, session tokens, salts, webhook secrets, database IDs and one-off identifiers โ anything that must be unguessable but is never typed by a human.
Every character comes from crypto.getRandomValues(), the browser's cryptographically secure generator, and nothing is sent anywhere. For a secret that protects real access, use at least 128 bits of entropy โ for example 32 hex characters or 22 Base64url characters.
How long should it be?
- Salt โ 16 bytes (32 hex characters). Uniqueness matters more than length.
- Session token or API key โ 128 bits: 32 hex, 22 Base64url or 24 alphanumeric characters.
- Signing key or long-lived secret โ 256 bits: 64 hex or 43 Base64url characters.
- One-time code in a URL โ 128 bits minimum; treat it like a password.
Beyond 256 bits there is nothing an attacker could ever exhaust. Keep secrets out of source control and logs, and rotate one the moment it is exposed.