CalSolve

Prime Number Checker

Check whether a number up to one trillion is prime, and get its prime factorization, its divisors and the nearest primes.

97 is a prime number

Number of divisors
2
Previous prime
89
Next prime
101

Divisors

1, 97

Prime numbers from 1 to 1,000

RangePrime numbers
1–1002, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
101–200101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
201–300211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293
301–400307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397
401–500401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499
501–600503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599
601–700601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691
701–800701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797
801–900809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887
901–1000907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997

About this tool

A prime number is a whole number greater than 1 whose only divisors are 1 and itself: 2, 3, 5, 7, 11, 13… A number with other divisors is composite, like 91 = 7 × 13. The numbers 0 and 1 are neither prime nor composite, and 2 is the only even prime. There are 25 primes below 100, and Euclid proved more than 2,000 years ago that there are infinitely many.

To test a number, it's enough to try dividing it by the primes up to its square root: if n had a divisor larger than √n, it would also have one smaller than √n. For 97, √97 ≈ 9.85, so testing 2, 3, 5 and 7 is enough; none of them divides 97, so 97 is prime. The calculator uses this method with a few optimizations and answers instantly up to 1,000,000,000,000.

Every whole number greater than 1 can be written in exactly one way as a product of primes, a result known as the fundamental theorem of arithmetic: 360 = 2³ × 3² × 5. The factorization also gives the number of divisors, by multiplying the exponents plus one: (3 + 1) × (2 + 1) × (1 + 1) = 24 divisors. Very large primes are at the heart of the encryption that secures online payments.

Worked example

  1. 1Enter a whole number from 0 to 1,000,000,000,000.
  2. 2See instantly whether it's prime.
  3. 3Read its prime factorization, its number of divisors, the list of divisors and the previous and next primes. Example: 2026 = 2 × 1013; the previous prime is 2017 and the next is 2027.

Formula

n is prime ⇔ n > 1 and no prime p ≤ √n divides n ; n = p₁^a₁ × p₂^a₂ × … ⇒ number of divisors = (a₁ + 1)(a₂ + 1)…

Related tools

Frequently asked questions

Is 1 a prime number?
No. By definition, a prime has exactly two different divisors, 1 and itself, and 1 has only one. Excluding 1 also keeps prime factorizations unique.
Why is 2 the only even prime?
Every other even number is divisible by 2, so it has at least three divisors: 1, 2 and itself. All primes after 2 are therefore odd.
How can I tell quickly whether a number is divisible by 2, 3 or 5?
A number is divisible by 2 if it ends in an even digit, by 5 if it ends in 0 or 5, and by 3 if the sum of its digits is (2025: 2 + 0 + 2 + 5 = 9). These tests rule out most composite numbers in seconds.
What are twin primes?
Two primes that differ by 2, such as 11 and 13, 41 and 43, or 2027 and 2029. Nobody has proved yet whether there are infinitely many of them: it's one of the most famous open problems in mathematics.