
Prime Factorization Calculator
Use this free prime factorization calculator to decompose any integer from 2 to 1 billion (like 360 = 2 × 2 × 2 × 3 × 3 × 5) into its prime factors online.
Open toolEnter any whole number from 0 to 1,000,000,000 into this prime number checker to see if it is a prime number or composite. When a number is composite, the tool shows its smallest prime factor and matching cofactor (n = p x (n / p)) directly in your browser.
Enter the inputs, then select Calculate result.
Result will appear here
A prime number is an integer greater than 1 whose only positive divisors are 1 and itself. This checker evaluates primality up to 1,000,000,000 using deterministic square-root trial division in client-side JavaScript.
When you submit an integer x, the calculator first checks if x < 2 (returning Not prime: 0 or Not prime: 1) or x = 2 (returning Prime: 2). For any integer above 2, it tests divisibility by p = 2 and then odd divisors p = 3, 5, 7, 9, ... while p * p <= x.
If any candidate divides x with zero remainder, the loop stops immediately and returns Not prime: x = p x (x / p). Because divisors are tested in ascending order, the first factor p found is always the smallest prime factor of x. Since sqrt(1,000,000,000) is 31,622.77, even a 9-digit prime requires at most 15,811 division checks.
Compare all 25 prime numbers below 100, common odd composite numbers that pass quick divisibility rules, and the largest primes below powers of 10.
| Category or range | Numbers in group | Prime status and factor notes |
|---|---|---|
| Primes from 2 to 19 | 2, 3, 5, 7, 11, 13, 17, 19 | 8 primes (2 is the only even prime number) |
| Primes from 23 to 47 | 23, 29, 31, 37, 41, 43, 47 | 7 primes |
| Primes from 53 to 73 | 53, 59, 61, 67, 71, 73 | 6 primes |
| Primes from 79 to 97 | 79, 83, 89, 97 | 4 primes (25 prime numbers total below 100) |
| Divisible-by-3 odd composites under 100 | 51 (3 x 17), 57 (3 x 19), 87 (3 x 29), 93 (3 x 31) | Composite (digit sum is a multiple of 3) |
| Two-digit look-alike composite | 91 | Not prime: 91 = 7 x 13 (passes 2, 3, and 5 checks) |
| Three-digit multiples of 7 | 119 (7 x 17), 133 (7 x 19), 161 (7 x 23), 203 (7 x 29) | Composite (smallest prime factor is 7) |
| Three-digit multiples of 11 and 13 | 121 (11 x 11), 143 (11 x 13), 169 (13 x 13), 187 (11 x 17), 221 (13 x 17) | Composite (requires testing primes 11 and 13) |
| Classic 4-digit Euler composite | 1001 | Not prime: 1001 = 7 x 143 (factors into 7 x 11 x 13) |
| Largest primes below powers of 10 | 997 (< 1,000), 9973 (< 10,000), 999983 (< 1,000,000), 999999937 (< 1,000,000,000) | Verified prime benchmarks within tool range |
Follow these three steps to test whether any non-negative integer up to 1 billion is prime or composite.
Type your target integer into the Integer to check box (pre-filled with 97). You can test small homework numbers like 91 or 9-digit integers up to 1000000000.
Enter plain digits without thousand-separator commas or decimal points. Negative integers, decimals, and numbers above 1,000,000,000 trigger an input range validation message.
Click Calculate result to display Prime: n or Not prime: n = p x (n / p). You can copy the output string or download result.txt for your notes.
These three examples show how the square-root bound floor(sqrt(n)) verifies primes and exposes composite numbers.
Because floor(sqrt(97)) = 9, you only need to check prime divisors up to 9, which are 2, 3, 5, and 7. None of those four primes divide 97 evenly, so the calculator outputs Prime: 97.

The integer 91 ends in 1 and its digits sum to 10, so it is not divisible by 2, 3, or 5. Dividing by 7 reveals 91 / 7 = 13, so the checker outputs Not prime: 91 = 7 x 13. Likewise, 1001 returns Not prime: 1001 = 7 x 143.

For n = 999999937, the square-root limit is floor(sqrt(999999937)) = 31622. Testing 2 and all odd numbers from 3 to 31621 finds zero exact divisors, returning Prime: 999999937 in milliseconds.

Understand how to read the factor pair returned for composite numbers and why 0 and 1 are excluded.
When your integer is composite, the result line Not prime: n = p x (n / p) gives you the smallest prime divisor p and the cofactor n / p. To break n / p all the way down into prime powers, enter the number into the Prime Factorization Calculator, or list every positive factor in ascending order with the Divisors Calculator.
When you enter 0 or 1, the tool returns Not prime: 0 or Not prime: 1. A prime number must have exactly two distinct positive divisors (1 and itself); 1 has only one divisor, and 0 is divisible by every nonzero integer.

Use these mental shortcuts when learning how to check whether a number is prime on paper.
Any integer greater than 5 that ends in 0, 2, 4, 5, 6, or 8 is divisible by 2 or 5 and can be ruled out at a glance. Next, add the digits of the number together: if the digit sum is a multiple of 3 (for example, 1 + 1 + 1 = 3 for 111), the number is divisible by 3.
For numbers that pass the 2, 3, and 5 checks, test 7, 11, 13, 17, 19, and 23 up to floor(sqrt(n)), or check exact remainders with the Modulo Calculator. If you are comparing two integers to see whether they are relatively prime (coprime), use the GCF Calculator.


Use this free prime factorization calculator to decompose any integer from 2 to 1 billion (like 360 = 2 × 2 × 2 × 3 × 3 × 5) into its prime factors online.
Open tool
List all positive divisors of one positive integer in ascending order.
Open tool
Find the greatest common factor of the supplied integers.
Open toolChoose another tool for your next calculation, conversion, or text task.

Use this free LCM calculator to find the least common multiple of 2 to 100 positive integers (like 12, 18, 30 = 180) in your browser with BigInt precision.
Open tool
Use this free modulo calculator to compute the non-negative Euclidean remainder (a mod b) for positive or negative integers between -1 billion and 1 billion.
Open tool
Use this free long division calculator to find the whole-number quotient, remainder, and Euclidean equation (a = b × q + r) for integers up to 1 billion.
Open tool
Calculate the exact factorial of a nonnegative integer.
Open toolAnswers to common questions about prime numbers, the square-root trial division rule, 0 and 1, and tricky composite numbers.
By definition, a prime number has exactly two distinct positive divisors: 1 and the number itself. The integer 1 has only one positive divisor (1). Excluding 1 from the primes ensures the Fundamental Theorem of Arithmetic holds, so every integer greater than 1 has a single unique prime factorization.
Dividing 2 by 1 or 2 leaves zero remainder, with no other positive integers in between, which makes 2 prime. Every larger even integer is a multiple of 2 (4, 6, 8, 10, ...), so 2 is always a third factor alongside 1 and the number itself.
If an integer n > 1 can be factored as n = a x b with 1 < a <= b, then multiplying a <= b by a gives a^2 <= a x b = n, so a <= sqrt(n). If no integer from 2 up to floor(sqrt(n)) divides n evenly, no matching cofactor b can exist above sqrt(n) either, proving n is prime.
The number 91 is composite because 91 = 7 x 13. It is the most frequently missed two-digit composite in school math tests because it is odd, does not end in 5, and its digits add up to 10 (not divisible by 3).
There are exactly 25 prime numbers between 1 and 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97. All four of these subsets are listed in the lookup table above.
No. Primality is defined on positive integers greater than 1. Fractions and decimals are not integers, and negative integers like -7 are classified in ring theory as prime associates (-1 x 7) rather than standard positive prime numbers.
Return to the input box above to test another integer up to 1,000,000,000.