Generate cryptographically strong random tokens, API keys, secrets and nonces in your browser. Choose length, charset and how many to produce.
Random, unpredictable tokens. All randomness comes from the browser's crypto.getRandomValues, the same source browsers use for TLS keys. Nothing leaves your device.
What makes a token safe to use
Random is not the same as unpredictable
Most languages ship two very different random number generators. Math.random(), rand() and friends are fast pseudo-random generators seeded from something cheap like the clock. They are fine for shuffling a playlist and disastrous for a token, because an attacker who observes a few outputs can often recover the internal state and reproduce every value the generator will ever emit.
A cryptographically secure generator is built so that seeing past output tells you nothing about future output. In the browser that is crypto.getRandomValues(), which draws from the operating system's entropy pool. This tool uses it exclusively. If you are generating tokens in your own code, the equivalents are secrets in Python, crypto/rand in Go and java.security.SecureRandom in Java — never the plain random module or Math.random().
Avoiding modulo bias
Having good random bytes is only half the job. The naive way to pick a character is bytes[i] % alphabet.length, which quietly skews the result whenever the alphabet size does not divide 256 evenly. With a 62-character alphabet, the first 8 characters come up slightly more often than the rest — a small bias, but it reduces real entropy and it is entirely avoidable.
The fix is rejection sampling: discard any byte that falls in the incomplete final block and draw again. This tool does that, so every character in the chosen alphabet is equally likely.
Choosing a length
Entropy is log2(alphabet_size) * length bits. A 62-character alphabet gives about 5.95 bits per character, so a 22-character token carries roughly 131 bits — comfortably beyond brute force. For anything guarding real access, 128 bits is the usual floor; below about 64 bits a determined attacker with a fast endpoint becomes a genuine concern.
Alphabet choice is mostly about where the token will travel. Base64url and hex survive URLs, filenames and headers untouched. The no-ambiguous alphabet drops characters like 0/O and 1/l/I and is worth using for anything a human will read aloud or retype from a screen.
FAQ
Is the token generated on my device?
Yes, entirely in your browser using crypto.getRandomValues(). Nothing is sent to a server and nothing is logged, so the value you see is only ever known to you.
How long should a token be?
For anything guarding access, aim for at least 128 bits of entropy: 22 characters on a 62-character alphabet, or 32 hex characters. Shorter values are fine for non-security identifiers.
Why not use Math.random() for this?
It is a fast pseudo-random generator seeded from something cheap like the clock. Observing a handful of outputs can be enough to recover its state and predict every future value.
What is the no-ambiguous-characters option for?
It removes 0/O and 1/l/I so the token survives being read aloud, written on paper or retyped from a screen without transcription errors.
Can I use this for password reset links?
Yes, provided you store only a hash of the token, set a short expiry and invalidate it after a single use. The randomness here is suitable; the lifecycle is your application's job.
Could the same token ever come back?
With 128 bits of entropy a repeat is astronomically unlikely, but the tool keeps no history, so it cannot verify uniqueness across generations on your behalf.