API Key Generator

Generate secure random API keys in hex, base62 or base64url, with an optional prefix.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

The API Key Generator creates cryptographically secure random keys and secret tokens for use in APIs, webhooks, services and config files. Whether you need a Stripe-style sk_live_ secret, a webhook signing key, or a generic access token, this tool produces high-entropy values that are safe to use in production — generated entirely in your browser.

How it works

The generator draws raw random bytes from the browser’s crypto.getRandomValues CSPRNG (the Web Crypto API), which is suitable for cryptographic secrets. You choose how many bytes of entropy to use (16 to 64) and how to encode them:

  • Hex — two characters per byte, using 0-9 and a-f.
  • Base62 — alphanumeric (0-9, A-Z, a-z), rejection-sampled per character so no bias is introduced and full entropy is preserved.
  • Base64url — URL-safe base64 (no +, / or padding), the most compact.

An optional prefix such as sk_live_ is prepended verbatim. The encoding changes only the appearance, never the underlying randomness.

Example

Generating a 32-byte key (256 bits of entropy) with the prefix sk_live_ and hex encoding produces something like:

sk_live_3f9a1c...d2b7 (64 hex characters after the prefix).

EntropyHex lengthBase62 length (approx)Strength
16 bytes32 chars~22 chars128-bit
32 bytes64 chars~43 chars256-bit
64 bytes128 chars~86 chars512-bit

It is privacy-first: nothing is transmitted or logged. Copy and store your key securely — this tool keeps no record of it.

Ad placeholder (rectangle)