Random String & API Key Generator
Create random API keys, secrets and tokens from the browser’s secure random generator, one at a time or in bulk.
Keys are made on your device with crypto.getRandomValues. Random values that would make some characters more likely are discarded (rejection sampling), so every character is equally likely. Nothing is sent or stored. Store secrets in a secrets manager or environment variables, never in code.
How to generate an API key
- Pick a character set and length.
- Add a prefix such as sk_live_ and choose how many keys you need.
- Copy them or download them as a text file.
Features
- Letters, digits, symbols, hex, base64url or your own characters
- Optional prefix such as sk_live_ or pk_test_
- Up to 1,000 keys at once
- Rejection sampling, no modulo bias
- Entropy in bits
- Copy all or download as .txt or JSON
Frequently asked questions
How long should an API key be?
Aim for at least 128 bits of entropy, which is 32 hex characters or 22 base64url characters. 256 bits (64 hex or 43 base64url characters) is a comfortable choice for long-lived secrets.
What does “unbiased” mean here?
Simply taking a random byte modulo the alphabet size makes some characters slightly more likely. This tool throws away random values that would cause that skew (rejection sampling), so every character is exactly equally likely.
Does the prefix add security?
No. A prefix like sk_live_ only helps people and secret scanners recognise the key. The entropy shown counts only the random part.
Are the keys stored anywhere?
No. They are generated on your device with crypto.getRandomValues and are never sent or saved.
Related tools
All Security & Privacy →- Password Generator Create strong, unique passwords for every account.
- UUID Generator Create unique identifiers for databases, APIs and test data.
- Hash Generator Calculate cryptographic hashes of text or any file and compare them with a published checksum.
- Bcrypt Generator Hash a password with bcrypt, test whether a password matches an existing hash, or break a hash into its parts.
- Passphrase Generator Make a password you can actually remember, like “Crafty-Lemon-Uphill7-Banjo-Mystic”, that is still extremely hard to guess.
- Password Strength Checker See whether a password would survive a real attack.