Cipher Utility

Random Generator

U-04

Secure random numbers, strings and UUIDs, made on your device. Nothing is sent or stored.

1. Options

Make:
Repeats:
How many:

Common uses

  1. Draw a winner from numbered entries.
  2. Pick numbers without repeats for a raffle.
  3. Make test IDs and sample data.
  4. Create tokens and UUIDs for code.

Worked example

16 characters, A1

62 possible characters each:

16 × log2(62) ≈ 95

≈ 95 bits

Cipher Utility reference card Catalog no. U-04

How the generator works

Every value comes from crypto.getRandomValues, the cryptographic random number generator built into your browser and seeded by the operating system. Ordinary JavaScript random numbers (Math.random) are fine for games but are not meant for anything secret; this page does not use them.

Numbers in a range are drawn so that each one is equally likely. A naive approach that takes a random value modulo the range size makes small numbers slightly more common; the generator throws away the few values that would cause that bias and draws again.

About UUIDs

A version 4 UUID is 128 bits, of which 6 are fixed to mark the version and variant and 122 are random. Written out it is 32 hex digits in groups of 8, 4, 4, 4 and 12. With 2122 possibilities, the chance of making the same UUID twice is negligible even across billions of them, which is why they are used as database keys and request IDs.

Questions about random values

Are the numbers truly random?

They come from your browser's cryptographic random number generator (crypto.getRandomValues), which is seeded by the operating system and is suitable for keys and tokens. Every number in the range is equally likely.

Can I get numbers without repeats?

Yes. Set Repeats to Leave out and every number in the list will be different. The range has to contain at least as many numbers as you ask for.

What is a UUID?

A universally unique identifier: 128 bits written as 32 hex digits in five groups, such as 3f1c2a9e-8b7d-4c1e-9a2f-6d5e4b3a2c1f. Version 4 UUIDs, made here, have 122 random bits, so two of them are practically never the same.

Can I use these strings as passwords or API tokens?

The randomness is good enough for that. For passwords with symbols and a strength estimate, use the password generator.

Is anything sent to a server?

No. Everything is generated in your browser, and nothing is sent or stored.