API Key Generator
Generate high-entropy alphanumeric keys for APIs, service tokens, and application secrets, up to 64 characters, cryptographically random, and never transmitted anywhere.
An API key is a credential no human ever types, which frees it from every constraint that shapes a password. It does not need to be memorable, pronounceable, or short, and it gains nothing from symbols that break shell quoting and URL encoding. What it needs is enough randomness that guessing is hopeless, and a shape that makes it obvious what the string is when it inevitably turns up somewhere it should not be.
What a good API key looks like
The convention that Stripe, GitHub, and Envless all converged on: a readable prefix that identifies the credential, then a block of pure entropy. Only the second part is secret; the first part is what saves you when the key leaks.
- Prefix
- Tells a human, a log scrubber, and a secret scanner what this string is before anyone has to guess.
- Separator
- A single unambiguous delimiter so the prefix can be parsed off without a regex that also matches the body.
- Random body
- The only part that carries security. Every character is drawn uniformly from 62 alphanumerics, worth 5.95 bits each.
This generator produces the random body. Put your own prefix in front of it before you issue the key. That one convention is what lets GitHub's secret scanning, your log redaction, and your on-call engineer all recognise the credential the moment it shows up somewhere it should not be.
How to generate an API key
Generate the entropy, then wrap it in the conventions that make a leaked key survivable.
- 1
Choose a length
Set the character count. 32 is a solid default and 40 or more is appropriate for anything with production access, because no human has to type it, so length costs you nothing.
- 2
Generate the random body
The tool fills the whole length with uniformly random alphanumerics. This is the part that carries the entropy; everything else is labelling.
- 3
Add your own prefix
Paste the value behind a prefix that identifies the service and environment, such as acme_live_ or acme_test_. Secret scanners and log filters key off that prefix, and so will you at 3am.
- 4
Store the hash, not the key
Show the key once at creation, then persist only a hash of it. If your own database cannot reveal a key, neither can anyone who steals your database.
Why use the Envless API key generator?
From a team that issues, hashes, scopes, and rotates API keys as a core part of its product.
High-entropy by construction
Characters are drawn uniformly from a 62-character alphanumeric set at 5.95 bits each, so a 40-character key carries roughly 238 bits, far beyond anything brute force can reach.
Safe in every context
Alphanumeric output means no shell escaping, no URL encoding, no YAML quoting rules, and no support ticket because a $ in the key got expanded by a Dockerfile. The key you copy is the key that arrives.
Generated locally
The key is produced by crypto.getRandomValues() in your browser and never leaves the page. No request is made, so there is no server that could log the credential you are about to trust.
Up to 64 characters
Machines do not mind long credentials, so pick a length by the value of what the key protects rather than by what is comfortable to read. Anything from 32 upwards is comfortably out of reach.
Ready to store encrypted
A generated key still has to live somewhere. Envless keeps application secrets encrypted client-side and injects them into your process at runtime, so the key never lands in a committed .env file.
After you generate the key
The credential is the easy part. Where it lives afterwards is what decides whether it leaks.
Issue a scoped Envless API key
Create keys with per-resource read and write scopes, rotate them, and see why an issued key can never be revealed again.
Read the guide FeatureStop committing keys to .env files
Keep generated credentials encrypted client-side and inject them into any process, framework, or CI job at runtime.
See how it works Free toolSigning tokens instead?
If you need a signed, verifiable credential that carries claims rather than an opaque random string, build a JWT.
Open the JWT generatorAPI key FAQ
Lengths, prefixes, storage, rotation, and how keys differ from JWTs.
Long enough that guessing is pointless, which happens well before it becomes inconvenient. At 5.95 bits per alphanumeric character, a 32-character key carries about 191 bits and a 40-character key about 238. Both are far past the point where brute force is a realistic threat, so choose 32 as a floor and go longer for production credentials.
Because they cost more than they add. Moving from 62 alphanumerics to roughly 90 printable characters buys about half a bit per character, which one extra character replaces entirely, while symbols reliably break shell quoting, URL parameters, YAML files, and .env parsing. Machine credentials should be boring to transport.
Yes. A prefix such as acme_live_ or acme_test_ makes the credential self-identifying, which is what lets automated secret scanners spot it in a public repository, lets log scrubbers redact it, and lets you tell a production key from a sandbox key at a glance. It costs no entropy because it was never secret.
Store a hash, not the key. Show the value once at creation, persist only its hash, and compare hashes at authentication time. Envless does exactly this with its own keys, which is why a key can be rotated but never revealed a second time. A database dump then yields nothing usable.
Not in the repository, and not in a plaintext .env file copied between machines. Keep third-party keys in a secrets manager that encrypts them and hands them to your process at runtime. Envless encrypts values client-side before upload and injects them into any command, so the key never touches disk in plaintext.
No. It is produced in your browser with crypto.getRandomValues() and never transmitted, logged, or stored. There is no network request at any point, which is the only arrangement under which a generated credential is trustworthy.
On a schedule you can actually keep, and immediately on any suspicion of exposure: a key pasted in a chat, committed to a branch, or held by someone who has left the team. Rotation only works if it is cheap, so favour a setup where the key lives in one place and every consumer reads it from there rather than holding its own copy.
An API key is an opaque random string that means nothing on its own, because the server looks it up to learn who is calling. A JWT is a signed, self-describing token carrying claims that any holder of the key can verify without a lookup. Use an API key for long-lived service credentials, and a JWT for short-lived sessions where you want the token to carry its own context.
More free tools
Other free, 100% client-side tools from the Envless team.
Ship secrets, not chaos.
Start free today and discover why developers trust Envless for end-to-end encrypted, versioned secrets across every environment.