🔑

Random Token Generator

Generate cryptographically secure random tokens in hex, Base64, alphanumeric or custom character sets. Set any length. Free, runs entirely in your browser.

🔒 Security Tools Free Browser-based
Tool

Why Use Cryptographically Secure Tokens?

Random tokens are used as API keys, session secrets, CSRF tokens, password reset links and OAuth client secrets. They must be generated using a cryptographically secure random number generator (CSPRNG) — not Math.random() — to prevent attackers from predicting token values. This tool uses the browser's built-in crypto.getRandomValues(), which is a CSPRNG.

Recommended Token Lengths

Use CaseRecommended LengthFormat
API key32–64 charsHex or alphanumeric
Session secret32 bytes (64 hex chars)Hex
Password reset token32 charsAlphanumeric
JWT signing secret32 bytes (43 base64url)Base64 URL-safe
CSRF token16–32 charsHex

Tips

Never reuse tokens. Always store tokens hashed (bcrypt or SHA-256) in your database and compare hashes, not plaintext values. Tokens generated here are completely random and are never logged or transmitted.

Frequently Asked Questions