Number theory, made clear

Prime number checker.
Small question. Exact answer.

Is it prime or composite? Check a number, get its prime factorization, and follow the steps. Or explore a whole list of numbers at once.

Free to useExact results up to 1 trillionWorks in your browser

A little curiosity. An exact answer.

Is your number prime?

Whole numbers from 0 to 1 trillion. No rounding, no guesswork.

Try one

Calculated on your device. No sign-up.

The verdict
Prime number

29

Exactly two positive divisors. One and itself.

Positive divisors1 and 29
Prime factorization29

Understand the answer

See the prime check, step by step.

You only need to test divisors up to the square root. If a larger factor exists, its smaller partner must be below that boundary.

  1. Only divisors up to √29 ≈ 5.385 need to be tested.
  2. 2 does not divide 29; no odd divisor from 3 through 5 divides it evenly.
  3. The only positive divisors are 1 and 29, so 29 is prime.

The building blocks of numbers

The first 20 prime numbers

Tap a number to explore its result.

The two-divisor rule

What is a prime number?

A prime number is a whole number greater than 1 with exactly two positive divisors: 1 and itself. For example, 29 is prime because only 1 and 29 divide it evenly.

A composite number has more than two positive divisors. For example, 91 = 7 × 13, so 91 is composite. 0 and 1 are neither prime nor composite.

Check it yourself

How to check if a number is prime

01

Start with the basics

Numbers below 2 are not prime. The number 2 is the only even prime; every larger even number is composite.

02

Use quick divisibility checks

If the digit sum is divisible by 3, the number is too. Numbers greater than 5 ending in 0 or 5 are composite. Passing these checks alone does not prove primality.

03

Stop at the square root

Test prime divisors up to √n. For 29, √29 ≈ 5.385: test 2, 3 and 5. None divides 29 evenly, so it is prime.

From curiosity to code

Prime number checker in Python

Use integer arithmetic to avoid rounding the square root. This trial division example handles small integers; very large numbers need more advanced primality tests.

def is_prime(n):
    if n < 2:
        return False
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    divisor = 3
    while divisor * divisor <= n:
        if n % divisor == 0:
            return False
        divisor += 2
    return True

print(is_prime(29))  # True
print(is_prime(91))  # False

Frequently Asked Questions

Clear answers about primality, factors and the limits of this checker.

What is a prime number?

A prime number is a whole number greater than 1 with exactly two positive divisors: 1 and itself. The first primes are 2, 3, 5, 7, 11 and 13. A composite number, such as 4 or 91, has more than two positive divisors.

How do I identify a prime number?

First check that the number is a whole number greater than 1. Then test divisibility by prime numbers up to its square root. If none divides it evenly, it is prime. For 29, only 2, 3 and 5 need testing, and none divides it evenly.

Is 1 a prime number?

No. The number 1 has only one positive divisor, itself. A prime needs exactly two positive divisors. Both 0 and 1 are neither prime nor composite.

Is 4.5 a prime number?

No. Prime numbers are whole numbers greater than 1. Decimal numbers such as 4.5 are neither prime nor composite, and this checker rejects decimal inputs instead of rounding them.

What is a quick trick to check prime numbers?

Every even number greater than 2 is composite. Numbers greater than 5 ending in 0 or 5 are composite. If the digit sum is divisible by 3, the number is divisible by 3. Passing these checks does not prove a number is prime; also test possible divisors up to its square root.

What is the prime number check formula?

The trial division rule is to test whether n modulo d equals zero for any divisor d from 2 through the floor of the square root of n. If no divisor is found and n is greater than 1, n is prime. There is no simple last-digit rule that proves primality.

Can I check 1000000000000066600000000000001?

That number is above this checker’s supported limit of 1,000,000,000,000. The tool rejects it to avoid rounding or giving an unreliable verdict. Use an arbitrary-precision primality tool for numbers this large.

How do batch testing and the prime finder work?

Batch mode checks up to 50 numbers separated by commas, spaces or new lines. Each number can be up to 1 trillion. The range finder lists all primes in an inclusive interval up to 1 million, with a maximum interval span of 10,000.

Are these results exact or probable?

Single and batch checks use exact integer trial division and prime factorization within the supported limit. The range finder uses the sieve of Eratosthenes. Results are exact within these limits, rather than probabilistic primality estimates.

Do my numbers stay private?

All primality checks run locally in your browser. Your entered numbers are not sent to a server by this calculator. No account is needed.