Token & API Key Generator
Generate cryptographically secure UUIDs, hex tokens, Base64 keys, alphanumeric strings, and custom format tokens
X = random hex A = random letter N = random number S = random symbol Other characters kept as-is. Generate cryptographically secure tokens — UUID v4, hex, Base64, alphanumeric, or your own custom pattern — using the Web Crypto API built into your browser. Pick a format, set the length, batch up to 50 at once, and copy them all with one click. And everything runs in your browser. Nothing gets uploaded.
How It Works
Your browser calls crypto.getRandomValues() to fill a byte array with truly unpredictable data from your OS entropy pool. Those raw bytes then get encoded — as hex digits, Base64 characters, UUID format, or whatever pattern you chose. The result is a token that’s safe to use for authentication, encryption keys, or any scenario where guessability would be a problem.
Examples
API Key for a SaaS Dashboard
You’re building an admin panel and need a 256-bit hex key for each new tenant.
Type: Hex
Length: 256-bit
Count: 1
a4f8c1d903e27b5f6e1d094a83bc47f2d6e5a0193fb84c72e91d30af58b267c4
Batch of UUIDs for Database Seeding
Populating a test database with 5 user records. Each one needs a unique v4 UUID as its primary key.
Type: UUID v4
Count: 5
3f2504e0-4f89-41d3-9a0c-0305e82c3301
7c9e6679-7425-40de-944b-e07fc1f90ae7
550e8400-e29b-41d4-a716-446655440000
f47ac10b-58cc-4372-a567-0e02b2c3d479
9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
Custom License Key Format
Your software uses license keys like XXXX-XXXX-XXXX-XXXX where X is an uppercase letter or digit. The custom format template handles this.
Type: Custom
Pattern: XXXX-XXXX-XXXX-XXXX
Count: 3
K9F2-R7M4-B3X8-P1W6
T5L0-J8N3-V2D7-Q4H9
W6C1-Y0G5-A8E2-M3S7
Who Uses This
Generating API keys, session tokens, and webhook secrets during development and testing.
Creating secrets for environment variables, CI/CD pipeline tokens, and service-to-service auth.
Seeding test databases with realistic UUIDs and generating mock API credentials.
Understanding token formats for coursework — comparing UUID structure, hex encoding, and Base64 output.
Common Mistakes
Math.random() is not cryptographically secure. Its output can be predicted if an attacker observes enough values. Always use crypto.getRandomValues() — which is what this tool does — for anything auth-related.
Generating a strong token is only half the job. If you store it as-is in your database, a breach exposes every key. Hash them with SHA-256 or bcrypt. Only show the full key once — at creation time.
A 32-bit hex token is only 8 characters — about 4 billion possibilities. Sounds like a lot, but a modern GPU can brute-force it in seconds. For API keys, 128 bits minimum. For encryption secrets, go 256.
Technical Details
- Processing: 100% client-side
- Browser Support: Chrome, Firefox, Safari, Edge
- Entropy Source: Web Crypto API (crypto.getRandomValues)
- Token Formats: UUID v4, Hex (32–512 bit), Base64 / Base64URL, Alphanumeric, Custom template
- Batch Limit: 50 tokens per generation
Frequently Asked Questions
What is a UUID v4 and when should I use one?
A UUID v4 is a 128-bit identifier written as 32 hex characters with hyphens (like 550e8400-e29b-41d4-a716-446655440000). The "v4" part means it’s randomly generated, not based on timestamps or MAC addresses. Use them as database primary keys, correlation IDs in logs, or anywhere you need a unique identifier that won’t collide across distributed systems.
Is this token generator safe for production API keys?
Yes. The tokens come from your browser’s Web Crypto API, the same source used by password managers and TLS implementations. The randomness is cryptographically secure, meaning no one can predict the next value. Just make sure you hash the key before storing it in your database and transmit it over HTTPS only.
What’s the difference between hex, Base64, and alphanumeric tokens?
Hex uses 16 characters (0-9, a-f) so a 128-bit key is 32 characters long. Base64 uses 64 characters, packing the same entropy into 22 characters — shorter but includes +, /, and = which can cause URL issues (use Base64URL to avoid that). Alphanumeric uses A-Z, a-z, 0-9 — 62 characters — and is URL-safe by default. Pick whichever fits your system’s constraints.
How long should my token or API key be?
128 bits is the minimum for most security applications — that gives you around 3.4 x 10^38 possible values. For high-security use (encryption keys, long-lived secrets), go with 256 bits. A 64-bit token might look fine but it’s brute-forceable with enough compute power. When in doubt, longer is better and costs you almost nothing.
Can someone see the tokens I generate here?
No. Everything runs in your browser tab. There are no server requests, no logging, and no network calls when you hit Generate. The tokens exist in your browser’s memory and nowhere else. Close the tab and they’re gone — unless you copied them somewhere first.