API Key Generator
An API key is a secret token used to authenticate requests between services, applications, and APIs. This generator uses the Web Crypto API (crypto.getRandomValues) to produce cryptographically secure random keys — meaning they are generated from a high-entropy source and are practically impossible to guess or brute-force.
You can customize the key length (8–128 characters), choose between hexadecimal (0–9, a–f) or Base62 (0–9, A–Z, a–z) encoding, add an optional prefix such as 'sk_' or 'pk_live_', and generate multiple keys at once. Keys are never sent to any server — everything runs locally in your browser.
How it works
Each key character is derived from a random byte produced by crypto.getRandomValues(). For hex output, each byte maps to two hex digits (00–ff). For Base62, each byte is taken modulo 62 and mapped to a character from the set [0-9A-Za-z], giving approximately 5.95 bits of entropy per character.
Use cases
- Generating API keys for SaaS products and backend services
- Creating secret tokens for webhook signatures and HMAC authentication
- Provisioning temporary access tokens for testing and development environments
- Producing secure random identifiers for database records or session IDs
- Generating multiple keys in bulk for seeding staging or QA environments