Home/Random Prime Number

Random Prime

A number with no divisors but itself and one, drawn evenly from every prime in your range. For the classroom, for a puzzle, for a test case that needs a number that will not factor.

The prime

Press Draw

The draw

Options

Recent primes

  1. Nothing yet.

Every prime, equally likely

The primes in the range are found first, then one is drawn from that list. That matters because primes thin out as numbers grow: drawing a number and testing it would favour nothing, but would take far longer near the top of a large range.

Two is the only even prime, and it is in the list like any other — the range starts there for that reason.

Not for keys

These are small primes for teaching and puzzles. The primes behind real encryption are hundreds of digits long and are generated very differently; nothing here is a substitute for that.

The draw itself uses the browser’s cryptographic random source and runs entirely on your device.

More generators