Prime numbers list generator (primes in a range)

Set the start and end of a range to see its primes, such as the primes from 1 to 100. Useful for homework and coding exercises.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter from and to.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Segmented sieve of Eratosthenes: cross out multiples of every prime p ≤ √b starting at p² inside the range; the numbers left are prime.

Example

Inputs: From = 1, To = 100. Result: Number of primes: 25; Largest prime in the range: 97.

Limits and caveats

  • The end can reach one billion and the range can be up to 10 million wide.
  • The list shows the first 2000 primes; the total count is always exact.

Questions about this tool

How many primes are there from 1 to 100?

25 primes, from 2 up to 97.

How many primes are below one million?

78498 primes, the largest being 999983.

What is the sieve of Eratosthenes?

An ancient method that finds primes by crossing out the multiples of each prime; whatever stays uncrossed is prime.