Random API key generator FREE

Cryptographically secure API keys with customizable length, character set and prefix. Optional key/secret pairs (e.g. publishable_key + secret_key) for OAuth-style flows. Browser-only — your keys never leave your device.

API key generator

Settings

Tip: prefixes like sk_live_, pk_test_, ak_ help you identify a key's environment at a glance and let log scanners auto-redact secrets. Stripe, GitHub and OpenAI all use this convention.

  

How keys are generated

Each character is sampled from your chosen alphabet using crypto.getRandomValues() with rejection sampling (so the distribution is truly uniform, no modulo bias). A 32-character alphanumeric key has ≈190 bits of entropy — well above the 128-bit floor recommended for production secrets.

Prefixes

  • sk_live_ / sk_test_ — Stripe convention for secret keys vs. test environment.
  • pk_live_ / pk_test_ — Stripe publishable keys (safe to embed in frontend).
  • ghp_ — GitHub personal access tokens.
  • sk- — OpenAI-style API keys.

Pick a convention that works for your service and stick to it — predictable shapes make code-review and log-scanning much easier.

Key/secret pairs

Toggle "key/secret pairs" to generate a publishable key (safe to ship to frontend) plus a paired secret (server-only). Use the publishable key for client-side initialization (e.g. Stripe.js, Supabase anon key) and validate requests server-side using the matching secret.

Related tools

Copied!