Generate random API-key style strings locally in your browser using Web Crypto. These strings do not grant access to any service.
How to generate API-key style strings
- Choose 16–128 characters for the random portion.
- Optionally add a prefix of up to 20 letters, digits, underscores or hyphens, such as
demo_. - Select 1–50 results, generate, then copy the output. Each line is a separate candidate.
The prefix is added to the random portion. For example, a 32-character setting with demo_ produces 37 characters in total. A fixed prefix helps label a key but adds no randomness. The alphabet contains 57 letters and digits, excluding some easily confused characters.
A generated string is not an issued credential
This tool cannot create working keys for OpenAI, Google, payment processors, or other services. Obtain those credentials from the service’s own dashboard. For an application you operate, your backend must register and validate keys, assign permissions, and provide revocation. Use this page for prototypes and format experiments; generate production credentials inside a trusted application or secrets-management workflow.
Do not put secrets in public repositories, client-side application code, screenshots, or URLs. Give keys only the permissions they need and support rotation and revocation. See the OWASP secrets-management guidance.
Length, randomness and limits
The displayed random-space estimate is length × log₂(alphabet size). With 57 equally likely characters, a 32-character random portion represents about 186.7 bits of possible choices. This is a theoretical space estimate, not a guarantee about the browser, device, storage, or the security of an API.
Are keys guaranteed unique?
No. Independent random selection can repeat. A real credential system should check for collisions when issuing a key and generate another if needed.
Why does generation stop without Web Crypto?
The generator requires the browser’s cryptographic random source and does not fall back to Math.random. If it is unavailable or fails, no output is produced.
Related tools
Use the Random String Generator to choose character classes, or explore Security Tools.