Random Base64 Generator

Generate random bytes and see them as Base64, Base64URL or hex, the way openssl rand -base64 32 does on the command line. Pick 16, 24, 32, 48 or 64 bytes, make one value or a list, and copy them into your config. The bytes come from your browser's secure random generator and nothing is sent anywhere.

What to make
Format
Randomness
256 bits
Length
44 chars
Bytes
32
Generated
0

Generating runs in your browser. What you type never leaves this device.

Features

  • 16, 24, 32, 48 or 64 random bytes (128 to 512 bits)

  • Base64 with padding, URL-safe Base64URL without padding, or hex

  • Up to 500 values at once, one per line, to copy or download

  • A ready .env line for a single value

  • Shows the length of the encoded text and the bits of randomness

  • Secure randomness from crypto.getRandomValues

  • Runs in your browser: nothing is uploaded or saved

Where random Base64 is used

Encryption keys

Libraries that take a 32-byte key as Base64, such as Laravel's APP_KEY (base64:...) or many AES examples.

Salts and nonces

A 16-byte random salt or a 12-byte nonce for a test, written as Base64.

Tokens in URLs

Base64URL has no + / or = characters, so it can go in a link or a cookie without escaping.

Replacing openssl rand

When you are on a machine without OpenSSL, such as a Windows laptop or a phone.

Base64, Base64URL and lengths

Which variant?

  • Base64 uses A-Z, a-z, 0-9, + and /, and pads with = to a multiple of 4 characters. Most config files and libraries expect this.
  • Base64URL swaps + for - and / for _ and drops the padding, so it is safe in URLs, file names and JWTs.
  • Hex uses two characters per byte; it is longer but has no special characters at all.

Lengths

16 bytes become 24 Base64 characters, 32 bytes become 44 (with one = at the end), 64 bytes become 88. In Base64URL without padding, 32 bytes are 43 characters.

Random Base64 Generator - FAQ