API Key Generator
Generate random API keys, tokens and secrets in hex, Base62, Base64url or Base32, with an optional prefix such as sk_live_ and the bits of randomness shown.
How to generate an API key
Choose the characters and length
Hex, Base62, URL-safe Base64 or Base32, from 8 to 256 characters.
Add a prefix if you like
A prefix such as sk_live_ makes keys easy to recognise and to scan for leaks.
Copy or download
Store the key in a secrets manager, not in your code.
When to use API Key Generator
You are issuing keys, tokens or secrets for an API and want them random and recognisable.
A service needs a 32-byte hex secret for signing.
Tips for a better API Key Generator result
Choose hex, Base62, URL-safe Base64 or Base32 and a length, and add a prefix such as sk_live_ so leaked keys are easy to spot.
Aim for at least 128 bits of randomness, which is about 22 Base62 characters or 32 hex characters.
API Key Generator: limits and what to check
Store keys in a secrets manager or environment variable, and never in code or a public repository.
Each result shows its bits of randomness, and keys are made on your device and not stored.
About API Key Generator
Generate random keys, tokens and secrets with a secure random generator. Each result shows its bits of randomness. A 32 byte hex secret is also given for signing keys. Keys are made on your device and are not sent or stored.
FAQs
How long should a key be?
At least 128 bits of randomness, which is about 22 characters of Base62 or 32 of hex. More is fine.
Is the key truly random?
Yes. It uses the browser's cryptographic generator, and every character is equally likely.
Where should I keep it?
In a secrets manager or an environment variable, never in your code or a public repository.