Prime Number Checker
Check integers with deterministic primality testing and bounded factorization.
Your result
About this tool
Check one whole number or a list up to 2^64 − 1 with exact integer arithmetic. Optionally obtain bounded prime factorization and see any composite cofactor that remains unresolved.
Check a number and verify its classification
- Paste one nonnegative whole integer per line, then calculate. Leave factorization enabled to attempt a factor list.
- Read the classification table, then open the reasoning for each input. Integers up to 10,000 include a square-root-bound explanation and prime-divisor remainders.
- A zero remainder demonstrates a factor pair. For a prime result, every prime divisor through the square-root bound has been ruled out.
- Download the CSV to retain the input, classification, division rows and complete or partial factorization. A large-number result does not include a full Miller–Rabin trace.
How the calculation works
Small-prime division is followed by Miller–Rabin using bases 2, 325, 9375, 28178, 450775, 9780504 and 1795265022, deterministic for integers below 2^64. Factorization uses trial division up to 100,000, then checks the remaining cofactor.
Worked example
97 is prime. 100 is composite with factors 2 × 2 × 5 × 5. Zero and one are neither prime nor composite.
Prime and composite practice: six questions with worked answers
Try the questions on paper before opening the answers. Explain the classification with a factor pair or the square-root test, then check the same integers in the calculator above. Follow your course rules on calculator use.
Download the PDF pack for two A4 pages: questions first, then worked answers. Keep the answer page separate when practising.
Each SVG download is one A4 sheet. Open the SVG in a browser to print; use fit-to-page if your printer needs margins. The same questions and worked answers are available as text below.
Neither prime nor composite
Classify 0 and 1. Explain why neither belongs in the prime or composite group.
Show worked answer: neither prime nor composite
Prime and composite numbers are whole integers greater than 1. Neither 0 nor 1 meets that definition.
The smallest primes
Classify 2 and 3. List the positive divisors of each. Does every even number have to be composite?
Show worked answer: the smallest primes
The positive divisors of 2 are 1 and 2; those of 3 are 1 and 3. Each has exactly two positive divisors, so both are prime. The even prime 2 is an exception to the even-number shortcut.
Perfect squares
Classify 49 and 121. Give a factor pair greater than 1 for each. Does being odd guarantee that a number is prime?
Show worked answer: perfect squares
49 = 7 x 7 and 121 = 11 x 11. Both are composite because each has factors greater than 1. Being odd does not guarantee primality.
Prove a small prime
Is 97 prime? Find floor(sqrt(97)), then test every prime divisor through that bound. Record each remainder.
Show worked answer: prove a small prime
floor(sqrt(97)) = 9. Test 2, 3, 5 and 7: the remainders are 1, 1, 2 and 6. None divides 97. Any composite must have a prime divisor at or below its square root, so 97 is prime.
A shortcut is not a proof
91 is odd, does not end in 5 and has digit sum 10. Is that enough to call it prime? Find a factor pair or rule out every prime through its square-root bound.
Show worked answer: a shortcut is not a proof
Those shortcuts rule out 2, 3 and 5, but not every possible prime divisor. 91 = 7 x 13, so 91 is composite. Its square-root bound is 9; testing 7 finds the factor pair.
Do not stop before the bound
Classify 143. What is floor(sqrt(143))? Test the primes through that bound until you find a divisor or rule them all out.
Show worked answer: do not stop before the bound
floor(sqrt(143)) = 11. The prime candidates are 2, 3, 5, 7 and 11. The first four do not divide 143, but 143 = 11 x 13, so it is composite. Stopping at 7 would miss the divisor.
Three different answers to check
| Integer | Classification | Reason |
|---|---|---|
| 97 | Prime | Prime divisors 2, 3, 5 and 7 all leave nonzero remainders; floor(sqrt(97)) = 9. |
| 49 | Composite | 7 divides 49 exactly: 49 = 7 × 7. |
| 1 | Neither | The definition of prime and composite applies to integers greater than 1. |
List prime numbers between two numbers
Choose List primes in a range and enter the lower and upper bounds. The calculator includes both bounds and lists every prime in ascending order. You can download the same list as a CSV.
There are 10 prime numbers from 100 through 150: 101, 103, 107, 109, 113, 127, 131, 137, 139 and 149. You can check a small candidate by testing prime divisors up to its square root. The calculator uses the same exact primality test as its individual checker.
Use up to 10,000 consecutive nonnegative integers per range. A range containing only 0 and 1 has no primes.
Find the previous and next prime
Select Show previous and next primes to find the nearest prime strictly below and strictly above each entered number. Around 100, the adjacent primes are 97 and 101. If you enter 97 itself, the results are 89 and 101.
There is no previous prime for 0, 1 or 2. The search stays below 2^64 and checks up to 2,048 odd candidates in each direction. Results also appear in the CSV when this option is selected.
Why checking through the square root is enough
If n = a × b and both factors were larger than the square root of n, their product would exceed n. A composite integer therefore has a factor at or below its square root; one of that factor’s prime divisors is also at or below the bound. Checking only prime divisors is sufficient.
The displayed division rows stop at the first exact divisor for a composite input. For a small prime they include every prime through the bound. A whole quotient and remainder satisfy n = divisor × quotient + remainder. This teaching view is separate from the faster primality engine.
A composite result can have incomplete factors
Proving that a number is composite and finding all its prime factors are different tasks. The primality test can reject a large composite even when bounded trial division has not found its factors.
An unresolved composite cofactor stays explicitly labelled in the result and worksheet. It is not a prime factor. Disabling factorization leaves primality classification available and does not imply that factorization has been completed.
What is the square root of 143?
The square root of 143 is approximately 11.95826. It lies between 11 and 12 because 11² = 121 and 12² = 144. That makes 11 the largest integer at or below the square root.
To check whether 143 is prime, test the prime divisors 2, 3, 5, 7 and 11. The first four leave remainders. Dividing by 11 gives 13 exactly, so 143 = 11 × 13 and is composite.
Assumptions and limitations
Maximum 50 integers per batch. A primality result is deterministic within the supported range. Factorization is deliberately bounded: a remaining composite cofactor is shown as unresolved, never reported as a prime factor.
Paste one ordinary decimal integer per line. This tool is for arithmetic exploration and does not generate cryptographic keys or establish that an input is suitable for cryptographic use.
Sources and editorial responsibility
Maintained by Renvoro Pty Ltd. Sources inform the methods and assumptions shown here; outputs have the limitations described on this page.
Guide updated 2026-11-21. Calculation method and source dates remain separate.
Method reviewed 2026-10-09. Calculation standards · Report an issue