Token Generator
Generate secure tokens, API keys, UUIDs, passwords, and Nano IDs using cryptographic randomness — entirely in your browser.
Click "Generate" to create tokens
About Token Generator
Token Generator creates cryptographically secure random strings in six formats: Random String, Hex Token, UUID v4, API Key, Password, and Nano ID. Each format is purpose-built — UUID v4 follows the RFC 4122 standard for database primary keys, Hex tokens output pure hexadecimal characters used in authentication headers, Nano IDs produce URL-safe compact identifiers, and API keys use an alphanumeric character set common in third-party integrations.
You can generate up to 50 tokens in one click, configure token length from 8 to 128 characters, choose which character sets to include (uppercase, lowercase, digits, symbols), and attach a custom prefix or suffix to every result. The prefix field is especially practical for service-scoped keys: type "sk-" to produce strings like OpenAI-style secret keys, or "ghp_" to match the shape of GitHub personal access tokens.
All generation runs entirely in your browser using the Web Crypto API (crypto.getRandomValues), which provides cryptographically strong entropy — the same source used by professional security libraries. No token is ever transmitted to a server, stored, or logged. The tool is completely free with no account required, making it safe for generating production secrets, CSRF tokens, and database IDs even in sensitive environments.
Key Features
Six distinct token formats
Switch between Random String, Hex Token, UUID v4, API Key, Password, and Nano ID from a single dropdown. Each format uses the correct character alphabet and length defaults for its intended purpose.
Web Crypto API entropy
Every token is built with crypto.getRandomValues, which draws from the operating system's cryptographically strong random number generator — not Math.random() or any seeded algorithm.
Bulk generation up to 50 tokens
Set the count slider to generate a batch in one click. Copy all results to the clipboard at once, or copy individual tokens line by line as you use them.
Configurable prefix and suffix
Add a fixed string before and after every generated token. Useful for service-specific key formats such as "sk-", "Bearer ", or a project namespace suffix.
Adjustable length and character sets
For Random String and Password types, choose any length from 8 to 128 and toggle uppercase, lowercase, digits, and symbols independently to match the exact requirements of the target system.
Fully offline, zero data exposure
Nothing leaves the browser tab. There are no API calls, no logging, and no third-party scripts involved in generation, so you can safely create production credentials without network access.
How to Use
Select Token Type
Choose the format you need from the dropdown: Random String, Hex Token, UUID v4, API Key, Password, or Nano ID.
Configure Options
Adjust the length, character sets, optional prefix/suffix, and how many tokens to generate at once.
Generate & Copy
Click "Generate" to create your tokens, then copy individual tokens or all of them at once.
Example
Generating 3 UUID v4 tokens with no prefix or suffix. Each output is a standard 36-character identifier in the xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx format, ready to use as a database primary key.
Type: UUID v4
Count: 3
Length: 36 (fixed)
Prefix: (none)
Suffix: (none) a3f8c2d1-7b45-4e9f-8c0a-1d2e3f4a5b6c
91e5d4c3-2a67-4f80-b1c2-3d4e5f6a7b8c
5c7b9a0e-1f23-4d56-e789-0a1b2c3d4e5f Common Use Cases
- arrow_circle_right
API key provisioning for developer tools
When building a SaaS product or internal service, generate a batch of pre-formatted API keys before your key-issuance backend is built. The prefix field lets you match your own key schema (e.g., "myapp_live_") so placeholders look identical to real keys.
- arrow_circle_right
Database primary key seeding
UUID v4 tokens are the standard choice for distributed system primary keys because they do not require a central counter. Generate a set during schema design or data migration to populate test rows without collisions.
- arrow_circle_right
CSRF and session token generation
Web frameworks require per-session random strings for CSRF protection and session identifiers. Use the Hex Token format at 64 characters — the format most web security libraries expect — to generate values you can hard-code in test fixtures or seed files.
- arrow_circle_right
Nano IDs for URL slugs and short links
Nano ID produces compact, URL-safe identifiers (A-Za-z0-9_-) that are shorter than UUIDs. Use them to create unique short-link slugs, shareable resource IDs, or invite codes that do not expose sequential integers.
- arrow_circle_right
Seeding environment variables during local setup
New project contributors need secure values for JWT_SECRET, ENCRYPTION_KEY, and similar environment variables before the app runs locally. Generate several tokens at once, copy all, and paste directly into a .env.local file.