01What is Token Generator?
Sooner or later every project needs a random string. It might be an API key for a test service, a session secret for staging, or a batch of invite codes. Token Generator makes those strings from an alphabet you choose and tells you how much entropy you are getting. Under the hood, each character is picked on its own with crypto.getRandomValues, the browser's cryptographically secure generator. The pick uses rejection sampling. Random values that would make some characters slightly more common are thrown away and drawn again, so every character in the set has exactly the same chance. You build the alphabet in a few ways. Toggle Uppercase, Lowercase, Digits and Symbols in any mix, or switch on Hex for the 16 lowercase hex digits. Or press a preset. Alphanumeric gives 62 characters and Hex gives 16. Base64-safe gives the 64 characters of standard Base64, including + and /. URL-safe gives the Base64URL alphabet from RFC 4648, with - and _ instead. You can also type a Custom Characters set. Duplicates are removed, so typing aab gives a and b equal odds. The presets only pick characters from an alphabet. They do not encode random bytes, so there is no padding and nothing to decode. Length runs from 8 to 256. The panel shows the charset size and the entropy, worked out as length times log2 of the charset size and rounded to whole bits. A worked example makes the maths concrete. The Hex preset at length 32 shows a charset size of 16 and exactly 128 bits, giving something like ca16f5c83d26a5c1c5996d5136bf7312. URL-safe at length 22 reaches 132 bits. Tokens regenerate when you change a setting, and the refresh button draws a fresh set. Bulk Generate makes 1, 5, 10, 25 or 50 at once, and you can copy one or all, one per line. A few limits are worth knowing. The entropy figure assumes every token is generated here and kept secret. It says nothing about how you store or send it. Tokens are made and held only in this browser tab. They are not sent to our server or saved, so copy them before you leave the page.
Backend and DevOps developers who need random API keys, secrets or invite codes with a known alphabet and a visible entropy figure. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Token Generator
- Press a preset under Presets (Alphanumeric, Hex, Base64-safe or URL-safe), toggle the character groups, or type into Custom Characters
- Set Length with the number box or the slider, from 8 to 256
- Check the Entropy and Charset size figures under the token
- Under Bulk Generate, pick 1, 5, 10, 25 or 50 tokens
- Copy a single token with its copy icon, or copy all of them, one per line, with the copy-all button
- Press the refresh button to draw a new set with the same settings
03Worked examples
- Input:
Hex preset, length 32 - Result:
ca16f5c83d26a5c1c5996d5136bf7312 Charset size: 16 | Entropy: 128 bits - Random output, so yours will differ. 32 × log2(16) is exactly 128.
- Input:
URL-safe preset, length 22 - Result:
n4RtipH97EOpwPalof5LZi Charset size: 64 | Entropy: 132 bits - Random output. Only A-Z, a-z, 0-9, - and _ can appear.
- Input:
Default settings (Uppercase, Lowercase, Digits), length 32 - Result:
TlwiepnTOLnz5K8GY7ijsveNqNhy3k70 Charset size: 62 | Entropy: 191 bits - Random output. 32 × log2(62) is about 190.5, shown rounded to 191.
- Input:
All four groups including Symbols, length 16 - Result:
mshmM>83-K!:SpTz Charset size: 91 | Entropy: 104 bits - Random output. The symbol group adds 29 characters to the 62 alphanumerics.
- Input:
Custom Characters: aab, length 12 - Result:
aabbbababbbb Charset size: 2 | Entropy: 12 bits - Random output. The repeated a is counted once, so each letter has a 50% chance.
04Common use cases
- Creating a 32-character hex API key for a local or staging service
- Generating a 64-character session or cookie-signing secret for a development .env file
- Making 50 short uppercase-and-digit invite codes for a beta signup list
- Producing URL-safe tokens for password-reset or email-verification links in test data
- Checking how many characters a custom alphabet needs to reach 128 bits of entropy
- Filling fixture files with realistic random identifiers for load or integration tests
05Tips
- 128 bits is a common floor for secrets. That is 32 hex characters, or 22 characters from the URL-safe set.
- Pick URL-safe over Base64-safe for anything that goes in a URL or a file name. The + and / characters need escaping there.
- Symbols raise entropy per character but can break shell quoting and .env parsers. A few extra alphanumeric characters is often the easier trade.
- For short human-typed codes, type a custom set without look-alikes such as 0, O, 1 and I. Then raise the length to keep the entropy up.
- You can type any length into the number box. A value outside 8 to 256 snaps to the nearest limit when you leave the box.
06Related concepts
CSPRNG, Entropy, Rejection sampling, Base64URL.
Frequently Asked Questions
What is Token Generator?
Token Generator is a free, browser-based developer tool on AIDToolStack. Generate random strings and tokens with configurable length and character sets. It requires no installation or sign-up and works entirely in your browser.
Is Token Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Token Generator store my data?
No. It runs in your browser; nothing is uploaded.