API Key Generator
Choose a prefix, a length and an alphabet, and get up to 20 random keys. They are made in your browser with its secure random generator, so the keys never leave your device.
Runs in your browser. Nothing you type is uploaded.
Result
Strong. Well past what anyone can guess. Keys are made in your browser with its secure random generator and never sent anywhere.
- Alphabet
- 62 characters
- Random part
- 32 characters
- Full key length
- 40 characters including sk_live_
- Keys
- 5
- Show each key onceDisplay the key when it is created, then store only a hash of it (for example SHA-256) so a database leak does not leak keys.
- Use a prefixsk_live_ tells people and secret scanners what the key is for.
- Keep keys out of codeStore keys in environment variables or a secrets manager, not in your repository.
How it works
- Strength
- Each character adds log2(alphabet size) bits. 32 characters from 62 letters and digits give about 190 bits, far beyond guessing range. 128 bits is a common minimum for secrets.
- Secure randomness
- Keys come from your browser's cryptographic random generator. Bytes that would make some characters more likely than others are thrown away and drawn again, so every character is equally likely.
- Storing keys
- Show a new key to its owner once, then keep only a hash of it. When a request comes in, hash the key it sends and compare.
Questions
Are these keys safe to use in production?
Yes. They are made in your browser with a cryptographic random generator and are not sent anywhere. For keys you issue to customers, generate them on your server with the same kind of generator.
How long should an API key be?
Aim for at least 128 bits of randomness. That is 22 characters of letters and digits, 32 hex characters, or 22 base64url characters.
Why add a prefix like sk_live_?
A prefix shows what the key is and which environment it belongs to. Secret scanners also use prefixes to find keys pushed to public code by mistake.
Get CapyLaunch Weekly
New indie launches and the week in AI tools and models, every Monday. Free, and you can unsubscribe anytime.
Your launch, this week. Free.
A reviewed listing, a permanent page with a link to your site, and feedback from makers who actually care.