Random Token Generator
Generate cryptographically secure random tokens for API keys, secrets, session IDs and webhooks, as hex, Base64, Base64URL or letters and digits.
· bits of randomness
Runs only in your browser: nothing you enter here is stored or sent to us.
How to use the Random Token Generator
- 1 Choose the format and the length.
- 2 Add a prefix if your system uses one.
- 3 Copy a token; every change makes new ones, or press Generate.
About the Random Token Generator
Tokens are the random secrets software uses to recognise itself: API keys, session IDs, password reset links, webhook secrets, encryption keys and Laravel's APP_KEY. They must be unpredictable, so this generator uses the browser's cryptographic random number generator (crypto.getRandomValues), never Math.random().
For hex and Base64 the length is in random bytes: 32 bytes is 256 bits, written as 64 hex or 44 Base64 characters. Base64URL replaces + and / with - and _ and drops the = padding, so it is safe in URLs and file names. Letters-and-digits tokens are length in characters, at about 5.95 bits each.
128 bits is enough for any identifier that must not be guessed; use 256 bits for keys and long-lived secrets. Tokens are generated in your browser and never sent or stored: this tool only records that it was used.
Frequently asked questions
How long should an API key be?
At least 128 bits of randomness (16 bytes); 256 bits (32 bytes) is the common choice and leaves a wide margin.
Hex or Base64?
Same randomness, different spelling. Hex uses only 0–9 and a–f and is twice as long; Base64 is shorter; Base64URL is Base64 that is safe in URLs.
Can I use this for Laravel's APP_KEY?
Yes: generate 32 bytes as Base64 and put base64: in front, e.g. APP_KEY=base64:…. php artisan key:generate does the same.
Are the tokens stored?
No. They are created in your browser and never leave it; Toolgrid only logs that the tool was used.