Random Token Generator
🔒 Drawn with crypto.getRandomValues, 100% in your browser. Nothing is sent anywhere — refresh the page and the token is gone. Copy it into your secret store before you leave.
⚠️ Entropy is not safety after a leak. A leaked token is compromised in zero guesses, no matter how many bits it has — rotate it immediately (see FAQ).
Copied to clipboard.
Model. Entropy = length × log₂(alphabet size): hex 4.0 bits per character, base64url 6.0, alphanumeric 5.95. Crack time = combinations ÷ 10 billion guesses/sec — an optimistic upper bound, since real attackers exploit leaks, not brute force.
How this estimate works
Each character is a uniform pick from its format's alphabet, drawn with
crypto.getRandomValues and rejection sampling (no modulo bias). Entropy is
length × log₂(alphabet size); combinations are alphabet size to the power of length.
Quick reference
- Hex, 32 characters — 128.0 bits, 3.4 × 10^38 combinations. The standard target: a 128-bit secret.
- Base64url, 32 characters — 192.0 bits, 6.3 × 10^57 combinations. Most entropy per character; URL-safe with no escaping.
- Alphanumeric, 32 characters — 190.5 bits. For systems that reject symbols like
-and_. - Hex, 16 characters — 64.0 bits. Below the modern bar: an offline attacker exhausts it in about 58.5 years at 10 billion guesses/sec — a real budget for a valuable target.
- Base64url, 22 characters — 132.0 bits. The shortest base64url token that clears 128 bits.
Tokens are for machines, not memory: if a system makes a human type the secret, use a password or a passphrase instead. And never use a token as a password you type daily — a copied secret belongs in a password manager or secret store, not in your head.
FAQ
What is a token, and how is it different from a password?
A token is a random string a machine checks, not a human: an API key, a session token, or a password-reset link. It is never meant to be memorized, so it can be long and drawn from a restricted alphabet. A password must survive human memory; a token only has to survive guessing.
Which format should I pick?
Hex if the receiving system expects hexadecimal (32 hex characters = 128 bits). Base64url if the token travels in a URL or header and must never need escaping (32 characters = 192 bits). Alphanumeric if symbols are disallowed (32 characters = 190.5 bits). At 32 characters all three clear the 128-bit bar.
How long should a token be?
Aim for at least 128 bits: 32 hex characters, or 22 base64url characters (132 bits). A 16-character hex token has only 64 bits and an offline attacker exhausts it in about 58.5 years at 10 billion guesses/sec — a real budget for a valuable target.
How random is the generated token?
Each character comes from crypto.getRandomValues with rejection sampling
(no modulo bias), entirely on your device. There is no server, no analytics, no network
request.
What if a token leaks?
Rotate it immediately. Entropy measures how hard a token is to guess, not how safe it is once known: a leaked 256-bit token is compromised in zero guesses. Revoke the old token, issue a new one, and check logs for use of the leaked value.
Does this site see my token?
No. Generation and all math happen inside this page. Refreshing destroys the token, so copy it into your secret store before you leave.