Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

Random String Generator

strings
Ready
Runs in your browser. Nothing you paste is uploaded unless you share it.

Generate random strings of letters and digits, 4 to 128 long, up to 1,000 at a time, with the entropy in bits

Generate random strings from the characters you pick, for test data, invite codes, file names, salts and IDs.

How to use it

  1. Set the length and pick the characters: lowercase, capitals, digits, symbols.
  2. Set How many, up to 1,000.
  3. Copy the list or download it as a text file, one string per line.

Examples

Letters and digits

Input
Length 32 · a–z A–Z 0–9
Result
8PZhMkGAYlE8550G9iGtzDEAUAGoxLL1

190 bits: each of 62 characters, with at least one of each kind.

A short URL-safe token

Input
Base64url · 16 bytes
Result
eM-J16R3pi_-HU0trUj4Vw

128 bits in 22 characters, safe in a URL as it is.

Readable codes

For codes people read aloud or type from paper, such as invite or recovery codes, turn on No look-alikes: I, l, 1, O, 0 and o are left out. Turn off symbols too, so a code is one word when double-clicked.

Each kind you pick appears at least once, and every string that meets that is equally likely, so the entropy shown is exact.

Random enough for what

  • Test data and file names: any length; uniqueness is what matters, and 16 characters of letters and digits give 95 bits.
  • Salts and nonces: 16 random bytes (128 bits) is the common size; Hex or Base64url give exactly that.
  • Secrets and tokens: at least 128 bits, as on the API key generator .

Questions

Is this better than Math.random() in my code?
For anything secret, yes: Math.random is not a cryptographic generator and its output can be predicted. This page uses crypto.getRandomValues; in your own code use crypto.getRandomValues or crypto.randomUUID in the browser and Node.js, or secrets in Python.
Can two strings come out the same?
With 32 letters and digits there are about 2^190 possible strings, so a repeat is not a practical concern. Short strings repeat sooner: turn on No repeats and each list holds every string once (it says so when the settings allow fewer different strings than you asked for), and check uniqueness in your database if you use them as IDs.
How long should a random string be?
It depends on the job. For test data and file names only uniqueness matters: 16 letters and digits give 95 bits. Salts and nonces are usually 16 random bytes (128 bits), which Hex or Base64url give exactly. Secrets and tokens need at least 128 bits.

Related tools