API Key Generator
Generate cryptographically secure API keys, tokens, and secrets in your browser. Hex, Base62, Base64URL, UUID, custom charset, prefixes, and bulk export.
Updated
What is the API Key Generator?
Generate cryptographically secure API keys, bearer tokens, and access secrets entirely in your browser. This free API Key Generator produces high-entropy random tokens suitable for REST authentication, webhook signing, OAuth client secrets, CI/CD credentials, and service-to-service auth.
Choose from hex, Base62, Base64URL, alphanumeric, UUID v4, or a fully custom character set. Add realistic prefixes such as sk_live_, pk_test_, ghp_, or AKIA, set length from 8 to 256 characters, and generate up to 50 keys at once. Every key is created with the Web Crypto API (crypto.getRandomValues)—nothing is sent to a server, logged, or stored.
Entropy and strength estimates help you pick production-ready lengths (128+ bits recommended). Export results as plain text, JSON, or CSV, or copy individual keys with one click. Ideal for developers who need disposable test keys, production secrets, or consistent token formats without installing extra tools.
How it works
Pick a format
Select hex (lower or upper), Base62, Base64URL, alphanumeric variants, UUID v4 (with or without hyphens), or define your own custom charset. Each format maps to a fixed alphabet used for random selection.Set length and quantity
Choose body length (8–256 characters; fixed for UUIDs) and how many independent keys to produce (1–50). Longer keys and larger alphabets increase entropy.Add optional prefix or suffix
Use presets (sk_live_,pk_test_,ghp_,AKIA, Slack-style, Bearer, etc.) or type any custom string. Prefixes help identify environment and key type at a glance without reducing randomness of the body.Optional hex grouping
For hex formats you can split the body into fixed-size groups separated by a chosen delimiter (e.g.a1b2-c3d4-…) for readability.Generate
Click Generate. The tool draws uniform random values viacrypto.getRandomValues, maps them onto the selected alphabet with rejection sampling (no modulo bias), and assembles each key. Entropy is calculated asbodyLength × log₂(charsetSize).Copy or export
Copy any single key, or export the whole batch as plain text (one key per line), JSON array, or CSV. Download as a file if needed. Regenerate at any time with the same settings for a fresh set of tokens.
All processing stays inside your browser. Keys never leave the page.
Examples
Stripe-style live secret key
32-character hex body with a sk_live_ prefix for production API secrets.
UUID v4 access token
RFC 4122 version-4 UUID for session or resource identifiers.
Base64URL JWT-style secret
URL-safe 43-character token suitable for HMAC signing secrets.
Bulk test keys with GitHub-style prefix
Five alphanumeric keys for local development, each prefixed ghp_.
Frequently asked questions
Are the generated API keys cryptographically secure?
Are the generated API keys cryptographically secure?
Yes. Keys are produced with the browser’s Web Crypto API (crypto.getRandomValues), the same CSPRNG used for TLS and other security-sensitive operations. Rejection sampling avoids modulo bias so every character is uniformly distributed over the chosen alphabet.
Do the keys leave my browser or get stored?
Do the keys leave my browser or get stored?
No. Generation is 100% client-side. Nothing is transmitted, logged, or saved on any server. Closing the tab discards the values unless you copy or download them yourself.
How long should an API key be?
How long should an API key be?
128 bits of entropy is the practical minimum for production; 256 bits is a common modern default. Roughly, 32 hex characters ≈ 128 bits, 32 alphanumeric characters ≈ 190 bits, and 43 Base64URL characters ≈ 256 bits. Prefer longer keys for long-lived secrets.
What is the difference between hex, Base62, and Base64URL?
What is the difference between hex, Base62, and Base64URL?
Hex uses only 0-9a-f (or A-F)—maximum compatibility, longer for the same entropy. Base62 (0-9A-Za-z) is compact and URL-safe without special characters. Base64URL (A-Za-z0-9-_) is the standard for JWT and many token formats and yields slightly higher entropy per character.
Can I use these keys in production?
Can I use these keys in production?
Yes, provided you treat them like passwords: store them in a secrets manager or environment variables, never commit them to source control, rotate them periodically, and scope permissions tightly. The generator only creates the random material; access control and rotation remain your responsibility.
Why add a prefix such as sklive or ghp_?
Why add a prefix such as sklive or ghp_?
Prefixes identify the key type and environment (live vs test, secret vs publishable) at a glance and reduce the risk of accidentally using a secret key in a client-side context. The random body after the prefix still supplies the full entropy.
What does the entropy number mean?
What does the entropy number mean?
Entropy (in bits) estimates how hard the key is to guess by brute force. It is calculated as body length × log₂(number of distinct characters in the alphabet). Values under 64 bits are weak; 128+ bits are suitable for most API secrets; 256+ bits are excellent for long-lived or high-value tokens.
Can I generate multiple keys at once?
Can I generate multiple keys at once?
Yes. Set the count from 1 to 50. Each key is generated independently. You can copy them individually or export the whole batch as text, JSON, or CSV.
Is UUID v4 suitable as an API key?
Is UUID v4 suitable as an API key?
UUID v4 provides 122 bits of random entropy and is convenient when you need a standardized 36-character (or 32-character hyphen-free) identifier. For high-security secrets many teams prefer longer custom-format tokens with 256 bits of entropy.
What character sets are supported for custom keys?
What character sets are supported for custom keys?
Any Unicode characters you supply. Duplicates are removed automatically; the alphabet must contain at least two distinct characters. Entropy is computed from the unique character count.
Related tools
More utilities you might find handy.
Bcrypt Hash Generator
Generate and inspect bcrypt password hashes locally in your browser.
CRC32 Generator
Instantly generate CRC32, CRC32C, BZIP2, MPEG-2 and other checksums for text, files, hex or Base64 – 100% client-side.
File Hash Checker
Compute MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of files or text entirely in your browser with no upload.