Sieve of Eratosthenes

About this tool

A number grid up to 400 with adjustable columns lets the class see how the sieve finds the primes. Each step takes the next free number, which must be prime, and crosses out its multiples in the prime's own colour, starting at its square or, if you switch it, at twice the prime. Run it step by step or automatically at your speed, and the lab explains why it stops once the next prime squared is larger than the last number. Counters show how many primes were found, and a switch highlights the twin primes. Change the number of columns to reveal patterns in the multiples.

Classroom ideas

  • Sieve to 100 one prime at a time and ask students to predict which numbers the next prime will cross out.
  • Switch between starting at p² and at 2p and let students explain why the crossed-out numbers end up the same.
  • Use six columns and ask what they notice about where the primes sit, then find the twin prime pairs.

Related tools