Random String Generator
Generate random strings and tokens.
Use on any page (bookmarklet)
Want Random String Generator without leaving the page you're on? Drag the button below to your bookmarks bar, then click it on any website to open Random String Generator right there — it runs entirely in your browser.
Use responsibly: a bookmarklet runs on whatever page you click it on. Avoid sensitive sites such as online banking, payment, or healthcare pages — you run it at your own risk. Everything is processed locally and no data is sent anywhere. See our Terms.
- Show your bookmarks bar if it's hidden — Ctrl+Shift+B (⌘+Shift+B on Mac).
- Drag the button above onto the bookmarks bar.
- Open any website and click the bookmark — the Random String Generator panel appears in the top-right corner. Use ✛ to move it between corners, or ›/‹ to tuck it against the edge and pull it back out.
- Click the bookmark again (or the ✕) to close it.
Note: a few sites with strict security policies may block bookmarklets.
Examples
16-char alphanumeric token
Output
f3Kq9XmZ2aLpV7Rt
API-key style, no look-alikes
Output
h8Tn4kRpY6wQs2Vx
About this tool
This free online random string generator creates random strings and tokens of any length, using a cryptographically strong source. Choose which character sets to include — lowercase, uppercase, digits, and symbols — optionally drop confusing look-alike characters, and generate many at once. Everything runs in your browser with no upload.
How to use
- Set the length and how many strings you need.
- Toggle the character sets (a–z, A–Z, 0–9, symbols).
- Optionally exclude look-alikes, then click Generate and copy.
How long is long enough
Length only means something in combination with the alphabet you drew from. What actually matters is entropy — the number of possibilities an attacker would have to work through — and the working target for anything acting as a secret is 128 bits.
- Full alphanumeric (62 symbols): about 5.95 bits per character, so 22 characters reaches 131 bits.
- Lowercase and digits only (36 symbols): about 5.17 bits, so you need 25 characters.
- Excluding look-alikes (57 symbols): 5.83 bits, so 22 characters still clears 128.
Below roughly 16 characters, a token stops being meaningfully unguessable no matter which alphabet it uses. Above about 32 there is no practical gain — you are protecting against an attack that already cannot finish.
Random for machines versus random for people
These are different requirements and the difference is worth being deliberate about. A token that only ever moves between systems should use the widest alphabet available, because nobody will ever mistype it. A code that a human reads aloud, copies off a screen, or types from a printed card should drop the look-alike characters — i, l, 1, O and 0 — since a single misread turns a valid code into a support ticket.
The entropy cost of that choice is smaller than people expect: removing five ambiguous symbols costs about 0.12 bits per character, so a 22-character token falls from roughly 131 bits to 128. That is a trade worth making for invite codes, licence keys, and voucher numbers, and a pointless one for machine-to-machine credentials.
Where the randomness comes from
Strings are generated with the browser's Web Crypto API — a cryptographically secure source, unlike Math.random(), which is predictable and unsuitable for anything secret. Characters are selected using rejection sampling so every symbol in your chosen alphabet is equally likely; the naive modulo approach quietly biases the first few characters of the set, weakening the token in a way nothing visible would reveal.
There is a Math.random() fallback for environments with no Web Crypto at all, which in practice means none — every browser released in the last decade provides it. If you are generating a real credential in an unusual environment and cannot confirm which path ran, generate it with a server-side tool instead.
Generation happens entirely on your device and nothing is transmitted or stored. Even so, a secret that has been displayed in a browser window is best treated as a value to rotate later rather than a permanent credential.
Common uses
Creating API keys and access tokens, generating test data and unique identifiers in bulk, seeding coupon and invite codes, and producing one-off secrets for development configuration. For a single memorable human password the password generator is the better fit, and where you need a standardised globally unique identifier rather than an arbitrary string, use the UUID generator.
Frequently asked questions
How long should a token be?
For anything acting as a secret, aim for at least 128 bits of entropy. With the full 62-character alphanumeric set that means about 22 characters; with lowercase and digits only it means about 25. Shorter values are fine for non-secret identifiers, but a token someone could guess by brute force should never be under 16 characters regardless of alphabet.
What does excluding look-alike characters cost me?
A little entropy per character, in exchange for far fewer transcription errors. Dropping i, l, 1, O, and 0 takes the alphabet from 62 to 57 symbols, which costs roughly 0.12 bits per character — so a 22-character token drops from about 131 bits to 128. That is a negligible price for codes people read aloud, copy off a screen, or type from a printed card, and a pointless one for tokens only machines will ever handle.
How random are the strings?
They use the browser's Web Crypto API (with rejection sampling for an unbiased pick), so the output is suitable for API keys, tokens, and other sensitive identifiers.
Can I choose which characters are used?
Yes. Toggle lowercase, uppercase, digits, and symbols, and optionally exclude look-alike characters like i, l, 1, O, and 0.
Can it generate many strings at once?
Yes. Set how many you want and each line in the output is a separate random string of your chosen length.
What's the difference from the password generator?
They're similar; this tool is geared toward bulk tokens and IDs with flexible length and count, while the Password Generator focuses on single memorable-strength passwords.
Is anything sent to a server?
No. Strings are generated entirely in your browser with no upload, so nothing leaves your device.
Learn more
Related tools