Create random API keys with a prefix, as Base62, Base64, hex, digits or a UUID, or key and secret pairs, up to 1,000 at once
Create API keys with a prefix such as myapp_live_, or hex and Base64url tokens for signing secrets, sessions and webhooks.
How to use it
Pick API key, Hex or Base64url. For an API key, type a prefix, pick the characters (Base62, Base64, hex, capitals, digits or a UUID) and the length, up to 256; turn on Key + secret for an id:secret pair. For a token, set the number of random bytes. Copy the key into your secret store or .env file, or download a batch for seeding test data.
Examples
A key with a prefix
API key · prefix myapp_ · length 32
myapp_KTUC0DxEN08RBgkzr3WSR9qNuGR8K4qg
190 bits: 32 letters and digits after the prefix; the prefix adds none.
A 32-byte hex secret
Hex · 32 bytes
182313a7fc75c5ff3e5321cafae40939f324615016bf580e7526615a849392d8
256 bits, the size of an HMAC-SHA256 key.
A key id and secret pair
API key · prefix ak_ · Base62 · length 40 · Key + secret
ak_Q7M2ZK4XH1P9TB0C6RWD:x3Lr9TQe0uVb2HkWm7NzPa5sYc8JdF1gRo4iKtEw
The id before the colon is public, like an AWS access key id, and the 238 bits are in the secret after it. Send it as Basic auth, or split it at the colon.
Why keys have a prefix
Which format
| Format | Per character | Use it for |
|---|---|---|
Base62 key | 5.95 bits | API keys people copy and paste |
Base64 key (+ /) | 6 bits | Systems that expect standard Base64 characters; escape + and / in URLs |
Capitals and digits | 5.17 bits | Keys read aloud or typed, license-style codes |
Digits only | 3.32 bits | Numeric-only fields; make it long (39 digits for 128 bits) |
UUID v4 key | 122 bits in all | Systems that store keys in a UUID column |
Hex | 4 bits | Signing secrets, HMAC keys, config that expects hex |
Base64url | 6 bits | Short tokens in URLs and cookies (RFC 4648 §5, no padding) |
Sources: RFC 4648 §5
How much randomness
Sources: NIST SP 800-57 Part 1 Rev. 5
Questions
- Can I use these keys in production?
Yes: they come from your browser’s cryptographic generator (crypto.getRandomValues), with no bias between characters. They are made on your device and this page does not send or store them. Many teams still generate production keys on the server that checks them, so the key is never on a laptop. - Hex or Base64url for a secret?
Both carry the same random bytes. Hex is longer but easier to read and is what many config files expect; Base64url is a third shorter and fits in URLs and headers without escaping. - What is Key + secret?
Each line is a pair: a public id of 20 capitals and digits after your prefix, a colon, then the secret. The id can be stored and logged in plain text to find the key; only the secret is hashed and checked. AWS access keys and many APIs work this way. - Are an API key and an encryption key the same?
No. An API key identifies and authorizes a caller and is compared, not used to encrypt. An encryption key is raw bytes for a cipher: generate those with your crypto library, or take hex bytes from here and decode them.