Prime Number Checker

Enter a whole number to classify it as prime, composite, or an exceptional value.

Whole number n

Number “97”:

prime

Read explanation below

How the prime number checker works

Dots tested in equal groups while one arrangement remains indivisible

Enter a non-negative integer. The checker determines whether it is prime, composite, or one of the exceptional values 0 and 1; for a composite number it also lists the first non-trivial divisors found.

Why checking through the square root is enough

2dn2\le d\le\lfloor\sqrt{n}\rfloor

If n = a × b, at least one factor cannot exceed √n. The calculation tests every whole-number candidate from 2 through that boundary, so an exact division cannot be missed.

A prime result means no divisor was found in that complete range. A composite result includes up to three non-trivial divisors as evidence, without presenting them as a full prime factorization.

Useful checks

2 is prime. Its only positive divisors are 1 and 2, so it is also the sole even prime.

49 is composite. The boundary matters here: √49 = 7 and 49 = 7 × 7.

91 is composite. The first matching divisor is 7, giving 91 = 7 × 13.

97 is prime. Testing 2, 3, 5 and 7 is enough because √97 is below 10.

Definitions and limits

Zero and one are neither prime nor composite. Prime numbers are integers greater than 1 with exactly two positive divisors.

Input limit. The checker accepts whole numbers from 0 through 1,000,000,000,000. The result is exact within this range and uses trial division rather than a probabilistic test.

Questions about primality

These short answers cover the boundary cases that most often cause a wrong manual check.

Why is 1 not prime?

A prime number has exactly two positive divisors. One has only one positive divisor, itself.

Is 0 composite?

No. Zero is divisible by every nonzero integer, so it does not fit the definition of a composite integer greater than 1.

Why is 2 prime?

Its positive divisors are exactly 1 and 2. Every other even integer greater than 2 also has 2 as a proper divisor.

Does the checker include the square-root boundary?

Yes. That is essential for perfect squares such as 49, where the factor pair is 7 × 7.

Can I enter a decimal or negative number?

No. This tool classifies non-negative whole numbers from 0 through 1,000,000,000,000.

Does the result show a full prime factorization?

No. It lists only the first non-trivial divisors found; that is enough to prove the number is composite, but it is not a complete factorization.

Similar calculators

You may find the following calculators on the same topic useful:

Share on social media

If you liked it, please share the calculator on your social media platforms. It`s easy for you and beneficial for the project`s promotion. Thank you!