Random Base64 String Generator

Generate cryptographically secure random Base64 strings online with custom byte counts, URL-safe variants, and optional padding removal.

Generate Random Base64 Strings

5
16
128
Bits of Entropy
24
Chars per String
Command-line equivalent
openssl rand -base64 16
Generated Strings (0)
Your random Base64 strings will be displayed here
Click the Generate button to create them
  1. Set how many strings to generate (1–500) and how many random bytes each one should contain (1–1024).
  2. Optionally enable "URL Safe" to use - and _ instead of + and /, or "No Padding" to remove trailing = characters.
  3. Click "Generate Base64 Strings".
  4. Copy individual strings, copy them all, or download them as a .txt file.
  • Uses Web Crypto API (crypto.getRandomValues)
  • Custom byte counts from 1 to 1024 with entropy display
  • URL-safe alphabet and no-padding options
  • Bulk generation with copy and .txt download

Are these random strings secure enough for tokens and keys?

Yes. They are generated with the Web Crypto API (crypto.getRandomValues), a cryptographically secure random number generator built into your browser. 16 bytes (128 bits) is a common choice for tokens and IDs, and 32 bytes (256 bits) for secret keys.

How long will each Base64 string be?

Base64 uses 4 characters for every 3 bytes. With padding, the length is rounded up to a multiple of 4, so 16 bytes becomes 24 characters. Without padding, 16 bytes becomes 22 characters. The tool shows the exact length for your settings.

When should I use URL-safe Base64?

Use URL-safe Base64 (RFC 4648 base64url) whenever the string will appear in a URL, filename, cookie, or JWT. It replaces + and /, which have special meanings in URLs, with - and _, and padding is often dropped as well.