Skip to content
ToolsLeb ToolsLeb

Prime Number Checker

Check whether a number is prime.

Simple Math

Calculator Inputs

Your Result

Enter your details and press Calculate to see your result.

Formula

Prime Number Checker = Prime Check(Number)
Number

How it works

  1. Enter a whole number.
  2. View whether it's a prime number.

Share on Social Media:

A prime number is a whole number greater than 1 whose only divisors are 1 and itself. Enter any whole number up to 1,000,000,000,000 (one trillion) and this checker tells you whether it is prime. If it isn't, it shows the smallest number that divides it, so you can see why.

How the check works

The checker uses trial division:

  1. Numbers below 2 are not prime. 2 is prime.
  2. Any other even number is divisible by 2, so it isn't prime.
  3. Odd numbers are tested against 3, 5, 7, 9… up to the square root of the number. If none divides it, it's prime.

Stopping at the square root works because if n = a × b, at least one of a or b must be ≤ √n. For one trillion, that's at most 500,000 divisions, which takes a fraction of a second.

Examples

  • 97: prime. √97 ≈ 9.8, and none of 3, 5, 7 or 9 divides it.
  • 91: not prime. Smallest factor 7 (91 = 7 × 13). It looks prime but isn't.
  • 1: not prime. Primes need exactly two distinct divisors.
  • 2: the only even prime.

Prime number facts

  • The primes below 50 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47.
  • There are infinitely many primes; Euclid proved it around 300 BC.
  • There are 25 primes below 100 and 168 below 1,000.
  • Every whole number above 1 is either prime or a unique product of primes (the fundamental theorem of arithmetic).
  • Large primes underpin RSA encryption, which relies on how hard it is to factor the product of two huge primes.

Quick divisibility tests

Divisible by 3 if its digits add up to a multiple of 3; by 5 if it ends in 0 or 5; by 11 if the alternating sum of its digits is a multiple of 11.

Related: GCD Calculator, LCM Calculator, Factorial Calculator.

Frequently Asked Questions

A prime number is a whole number greater than 1 that has no positive divisors other than 1 and itself. The first few primes are 2, 3, 5, 7, 11, 13...

No — by definition, prime numbers must be greater than 1 and have exactly two distinct positive divisors (1 and itself). The number 1 has only one divisor, so it's classified as neither prime nor composite.

Yes — every other even number is divisible by 2 in addition to 1 and itself, which disqualifies it from being prime, making 2 the only even number on the list of primes.