Generate a 32-byte URL-safe token
{
"bytes": 32,
"encoding": "base64url"
}
{
"token": "4vNQ-Km1oE7zL2xYpR8uC5aW0sT9dH3bJ6fGqI2nMkc",
"bytes": 32,
"format": "base64url",
"entropy_bits": 256
}
Security
Generate a fresh random token from 8–128 browser-created bytes and encode it as hex, Base64, or Base64URL.
Published Last reviewed
Create a random token locally for session identifiers, webhook secrets, test credentials, and other systems that accept opaque random values. Choose the byte count and required text encoding, then copy the result directly to its destination.
Workspace
Shape the options below, then create a fresh output from the selected ingredients.
Complete the fields to prepare a result.
Choose the values that apply, then generate random token.
Generate the requested bytes with Web Crypto, encode without truncation, and report nominal entropy as bytes × 8 bits.
The browser fills a Uint8Array with crypto.getRandomValues, then encodes those bytes without reducing them. Hex uses two characters per byte; Base64 uses four characters per three bytes; Base64URL replaces URL-sensitive characters and removes padding.
{
"bytes": 32,
"encoding": "base64url"
}
{
"token": "4vNQ-Km1oE7zL2xYpR8uC5aW0sT9dH3bJ6fGqI2nMkc",
"bytes": 32,
"format": "base64url",
"entropy_bits": 256
}
Sensitive inputs stay on your device. Results are generated locally and are not stored by UtilityPages.org.
It is generated inside your browser with crypto.getRandomValues. The custom page marks the result as sensitive and does not send it to UtilityPages for generation or storage.
Follow the receiving system’s documented requirement. When none is provided, 32 random bytes gives a nominal 256-bit space and is a common general-purpose choice, but format and rotation requirements still matter.
Use the exact encoding expected by the destination. Hex is widely compatible but longer; Base64 is shorter and may contain +, /, and =; Base64URL substitutes URL-safe characters and removes trailing padding.
Use the key-generation facility specified by your cryptographic system instead. The Web Crypto specification explicitly distinguishes getRandomValues from generateKey, and key formats often require additional structure or handling.