Prime number calculator

Enter a number to test, and optionally a range to list primes.

Your answer

Is 97 prime?Yes
Next prime101
Previous prime89
Primes from 1 to 10025
Primes2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

Worked out in your browser. Nothing you type is sent to a server.

How we worked it out

Updated as you change the numbers.

  1. Trial division up to the square root tests one number; the sieve of Eratosthenes lists all primes in a range.

Method and assumptions

A prime has exactly two divisors, 1 and itself. There are 25 primes below 100 and 664,579 below ten million.

Questions

How many primes are there below 100?

25.

Sources

Method and figures checked on . Every worked answer on this page is covered by an automated test. Found a mistake? Tell us.

Embed this calculator on your site

Free to use. Paste this where you want the calculator; it runs in your visitors’ browsers, sets no cookies and sends nothing to us.

Related calculators