Random String / API Key Generator
Generate random strings for API keys, tokens, session secrets, and identifiers with full control over character sets and formatting. All randomness comes from the Web Crypto API. Nothing is sent to a server.
How to Use
- Select a character set preset or choose Custom to type your own characters
- Set the length and how many strings to generate (up to 100)
- Optionally set a prefix (e.g., sk-), suffix (e.g., ==), or API key format preset
- Use grouping to insert separators every N characters for readability
- Click Generate or press Enter
- Copy individual strings or all at once
Common Use Cases
API Keys for Development
Generate test API keys with realistic prefixes. OpenAI uses sk- followed by 51 alphanumeric characters. GitHub PATs start with ghp_. Stripe live keys start with sk_live_. The presets handle these automatically.
Session Tokens
Use the Base64 URL-safe charset for tokens that need to work in URLs and HTTP headers without encoding issues. The charset avoids characters that cause problems in different contexts.
Hex Strings for IDs
Hex strings are useful for database IDs, color codes, and cryptographic nonces. Use hex-lower for case-insensitive contexts or hex-upper for density (no lowercase extends character recognition).
Technical Identifiers
Custom charsets let you exclude easily confused characters. For example, if you want only consonants (no vowels to avoid accidental words), type them directly into the custom field.
Why Character Set Size Matters
The number of possible strings grows exponentially with both length and character set size. A 32-character alphanumeric string (62 characters) has roughly 190 bits of entropy, equivalent to a 192-bit key. A 32-character hex string (16 characters) has 128 bits, still well above current brute force thresholds.