Toolstia / Prime number generator

Prime number generator and checker

List every prime number between two numbers, find the prime at a given position, or test a single number and see the next and previous primes. Ranges can reach five million.

How it works

  1. Choose list, nth prime or check.
  2. Enter the numbers.
  3. Read the results or copy the list.

Listing a range

The tool uses the sieve of Eratosthenes, which crosses out multiples of each prime. It gives the count, the smallest and largest primes and the list.

The nth prime

The first prime is 2, the tenth is 29 and the 1,000th is 7,919. Positions up to 300,000 are supported.

Checking a number

Numbers up to nine trillion are tested by trial division, and the nearest primes on either side are shown.

Long lists

Only the first 2,000 primes are shown in the list. The count always covers the whole range.

Questions

Is 1 a prime?

No. A prime has exactly two divisors, and 1 has only one. Everything happens in your browser, and nothing you enter is sent anywhere.

Is 2 a prime?

Yes, and it is the only even prime.

How is this different from prime factorization?

Factorization splits one number into primes. This tool lists and tests primes.