Make Up Secure API Keys, Tokens and Secrets

A free key generator that runs in your browser with crypto.getRandomValues(), plus a calculator that tells you how much entropy a key format really has and how long it should be.

Keys are generated locally in your browser

Create Your Key

Pick a format and a length, or use a quick preset. Click the output to copy it.

Click Generate or pick a quick format below click to copy

API Key Entropy Calculator

Bits of entropy, the length you need, and the time a brute-force search would take.

Entropy
-
Length for 128 bits
-
Length for 256 bits
-
Average time to guess
-
-

Method: entropy = length × log2(set size), valid when a secure generator picks every character uniformly. Count only the random part, not a fixed prefix. Average time = 2bits−1 ÷ guesses per second. Verdicts follow NIST SP 800-57 Part 1: 112 bits minimum, 128 bits beyond 2030.

Bar chart of entropy by API key format: UUID v4 has 122 bits, 32 hex characters 128 bits, 24 base62 characters 143 bits, and 64 hex characters 256 bits
A 24-character base62 secret, the size of a Stripe-style key body, clears the 128-bit target that a UUID v4 just misses.

How keys.makeup Makes Up a Key

Every key on this page comes from crypto.getRandomValues(), which browsers back with the operating system's secure random number generator. The script runs in your tab and sends the key nowhere; View Source shows all of it.

Turning bytes into characters is where many generators go wrong. 256 is not a multiple of 62, so the shortcut byte % 62 makes the first eight characters slightly more likely. This page uses rejection sampling: it discards any byte of 248 or more and draws again, so every character has the same chance. Hex and Base64 need no correction, because 16 and 64 divide 256 evenly.

Entropy, not length, is what protects a key

Entropy is the number of bits an attacker has to guess. A 32-character hex key and a 22-character base62 key both carry about 128 bits. A UUID v4 is 36 characters but only 122 bits are random, because its version and variant fields are fixed. Prefixes such as sk_live_ or ghp_ help secret scanners spot a key, but add no entropy.

How long should your key be?

For an API key or bearer token, 128 bits is a sound minimum and 256 bits a common choice for long-lived secrets: 32 or 64 hex characters, or 22 or 43 base62 or base64url characters. Short codes a person types, such as an 8-character invite code, rely on rate limits and expiry instead.

Generate in the right place

A browser tool suits test keys and one-off secrets. For production keys your service issues to customers, generate them on the server with crypto.randomBytes (Node.js), secrets.token_urlsafe (Python) or crypto/rand (Go), store only a hash, and show the key once. This page loads Google Analytics and Microsoft Clarity to count visits; the output box is masked from Clarity recordings, but run those commands locally for your most sensitive secrets.

Common Key Formats

Patterns that well-known APIs use.

Stripe

sk_live_...

Type and mode prefix before a base62 random part.

GitHub

ghp_...

Prefix per token type, easy for secret scanners to spot.

AWS

AKIA...

20-character key ID plus a 40-character secret.

OpenAI

sk-proj-...

Project-scoped secret keys with a readable prefix.

UUID v4

xxxxxxxx-xxxx-4xxx-...

36 characters, 122 random bits. Fine as an ID, long for a secret.

Hex Token

a1b2c3d4...

4 bits per character. 64 hex characters give 256 bits.

Guides to Key Length, Entropy and Randomness

Frequently Asked Questions

Are the keys sent to a server?

No. The generator runs in your browser and the page makes no request with the key. The page loads Google Analytics and Microsoft Clarity for visit statistics; the key output is masked from Clarity recordings.

How long should an API key be?

Aim for at least 128 bits of entropy: 32 hex characters, or 22 base62 or base64url characters. 256 bits (64 hex or 43 base64url characters) is a common choice for long-lived secrets.

Is a UUID v4 a good API key?

A UUID v4 from a secure generator has 122 random bits, enough to resist guessing. It is long for that entropy, and not every UUID library uses a secure source, so a purpose-built random key is usually better.

Why not use Math.random() to make keys?

Math.random() is not built for security: its output can be predicted from earlier output. Use crypto.getRandomValues in the browser, crypto.randomBytes in Node.js or the secrets module in Python.

Copied to clipboard

SPUNK13 Network

API Sites

Key Management

More from SPUNK13