API Key Generator

中

Loading...

API Key Generator — Random Tokens with Custom Prefix and Charset

Generate random API keys and tokens with a custom prefix (like sk_live_ or myapp-), your choice of length, and a configurable character set — matching the exact key format your system or product expects.

Keys are produced by your browser's cryptographic random source and never leave your device. Generate service tokens, integration keys, and secrets for local development or provisioning scripts without trusting a web form with them.

How to generate an API key

  1. Set a prefix if your convention uses one (e.g. prod-).
  2. Choose the key length — 32+ characters of base62 is typical.
  3. Pick the character set: alphanumeric, or include symbols.
  4. Generate and copy; generate in batches when provisioning.

Frequently asked questions

How long should an API key be?

32 characters of alphanumeric output (≈190 bits of entropy) is far beyond brute-force reach while staying URL- and header-safe. Longer mainly helps future-proofing; shorter than 22 characters starts to look thin for keys valid for years.

Why add a prefix to keys?

Prefixes like sk_live_ or ghp_ let you identify a key's purpose at a glance, enable secret-scanning tools to recognize leaks, and allow safe rotation schemes. The random part after the prefix is what provides security.

Is a random API key the same as a secure one?

Security comes from entropy and how you store it, not from pronounceability. Generate randomly, store hashed on the server (like passwords), transmit only over HTTPS, and rotate on schedule.

Related tools

PureKit · apikey · Free online tool — files processed locally in your browser, no upload.