Prime Number Generator

Generate a list of prime numbers up to a limit.

The primes in a range

This generates all the prime numbers up to a limit you set — the numbers divisible only by one and themselves. It is useful for reference, for exploring patterns, or as a starting point for other number-theory work.

Enter a limit to generate the primes up to it.

The strange distribution of primes

Listing primes reveals their genuinely mysterious distribution. They thin out as numbers grow — primes become rarer among larger numbers — yet they never stop entirely, a fact proved beautifully in ancient times: there is no largest prime. They appear in no simple predictable pattern, sometimes clustering close together as twin primes, sometimes leaving long gaps, and the deep question of exactly how they are distributed is tied to some of the most famous unsolved problems in mathematics. The classic efficient way to generate them, sieving out multiples, dates back over two thousand years and still works. For all their simple definition, primes remain one of the most studied and least fully understood objects in maths.

Questions & answers

Do prime numbers ever run out?

No — it was proved in ancient times that there is no largest prime, so they continue forever, even as they thin out among larger numbers.

Do primes follow a pattern?

No simple predictable one — they sometimes cluster as twin primes and sometimes leave long gaps, and their exact distribution is a famous open problem.

Is anything uploaded?

No. The calculation happens in your browser.

More Math tools