How to tell if a number is prime and find its factors
Reviewed 29 November 2026 · 6 min read · Written and maintained by Toolnexo
A prime number has exactly two divisors: 1 and itself. That one sentence settles most questions, but it still leaves practical ones: is 91 prime, how do you check a large number without a calculator, and what is the quickest way to find the factors of 360. This guide covers the hand tests, the idea behind trial division, and what a prime checker does with a number such as 1,000,000,007. The Prime Number Checker applies all of it in your browser, up to 1,000,000,000,000,000 (10 to the power 15).
What counts as prime
The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. A number with more than two divisors is composite, such as 12, which divides by 1, 2, 3, 4, 6 and 12.
Two cases cause most of the confusion. The number 1 is not prime, because it has only one divisor, and the number 2 is prime, and it is the only even prime, since every other even number divides by 2. Zero is neither prime nor composite, and negative numbers are not prime.
Testing by hand with trial division
To see whether a number n is prime, try dividing it by the primes up to its square root. If none of them divides it exactly, it is prime. The square root is enough because factors come in pairs, and in each pair one factor is at most the square root.
For 97, the square root is about 9.85, so only 2, 3, 5 and 7 need testing. None of them divides 97, so it is prime. For 91, the square root is about 9.5, and 7 × 13 = 91, so it is composite. Numbers such as 91 look prime because they pass the easy tests for 2, 3 and 5, which is why 7 is worth checking by hand.
The Prime Number Checker uses the same idea. It tests 2 and 3 first, then steps through numbers of the form 6k − 1 and 6k + 1, since every prime above 3 has that shape. The result is exact for whole numbers up to 10 to the power 15.
Quick divisibility tests
- By 2: the last digit is even.
- By 3: the digits add up to a multiple of 3. For 91, 9 + 1 = 10, so it does not divide by 3.
- By 5: the last digit is 0 or 5.
- By 11: take the digits and alternate the signs. For 1001, 1 − 0 + 0 − 1 = 0, so it divides by 11.
- By 7 and 13: no short rule, so divide and look for a remainder of 0. For 1001, 7 × 11 × 13 = 1001.
Prime factorisation and divisors
Every whole number above 1 is either prime or a product of primes in exactly one way, apart from the order. This is why the prime factors of a number are useful: they describe it completely. The number 360 is 2 × 2 × 2 × 3 × 3 × 5, written 2³ × 3² × 5.
The factorisation also gives the number of divisors without listing them. Add 1 to each exponent and multiply: (3 + 1) × (2 + 1) × (1 + 1) = 24, so 360 has 24 divisors. They are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180 and 360, and the checker shows the full list.
Prime factors are also how the greatest common divisor and the least common multiple are found, and the GCD and LCM Calculator uses them for sets of numbers.
How many primes are there
There are 25 primes up to 100, 168 up to 1,000 and 78,498 up to 1,000,000. They thin out slowly: about one number in four is prime below 100, but about one in thirteen below a million. They never stop, because there are infinitely many primes, which Euclid proved over two thousand years ago.
Some primes come in pairs that differ by 2, such as 11 and 13, or 17 and 19, known as twin primes. The number 101 is the first prime after 100, and the one before it is 97. The checker also gives the next prime above and the previous prime below any number, and it can list every prime up to 1,000,000, ready to copy.
Large numbers
The number 1,000,000,007 is prime, and it is used in programming exercises as a modulus because of that. A hand check would need testing against every prime below about 31,623. A browser tool does it in moments, since it only has to try about ten thousand candidates. Numbers close to 10 to the power 15 need millions of tests, so they take a little longer.
A prime check is not a security tool. Cryptography uses primes with hundreds of digits, far beyond what a trial division tool handles, so use the checker for learning, homework and everyday number work.
Put it into practice
Prime Number Checker
Check whether a number is prime, see its prime factors and all its divisors, find the next and previous prime, and list every prime up to…
Runs in your browserGCD and LCM Calculator
Find the greatest common divisor and least common multiple of two or more whole numbers, with prime factorisations and the Euclidean algo…
Runs in your browserFraction Calculator
Add, subtract, multiply or divide two fractions with exact integer arithmetic: simplified results, mixed-number form and decimal value.
Runs in your browserScientific Calculator
Work out expressions with trigonometry, logarithms, powers, roots, factorials and percentages, with degree and radian modes, a live previ…
Runs in your browserHow this guide is maintained
This page is reviewed when the related tools change. It describes what the published tools actually do: the tools run in your browser tab, so your files stay on your device. If you find something inaccurate, email [email protected] and it will be corrected.
Other guides
- How to merge PDFs without uploading them6 min · 17 November 2026
- OCR a scanned PDF: accuracy, limits and privacy7 min · 17 November 2026
- Compress a PDF without destroying readability6 min · 17 November 2026