Enter any positive integer and this tool reports whether it is prime, and if not, returns its full prime factorization. Internally it uses 6k±1 trial division: after eliminating 2 and 3, only divisors of those two forms up to √n are tested, which is roughly three times faster than naive trial division while remaining deterministic.
Trial division is exact for everything up to JavaScript's safe-integer ceiling of 2^53 − 1 (about 9 × 10^15). For larger numbers you would need BigInt arithmetic and a probabilistic primality test such as Miller-Rabin — out of scope for this single-page tool. The verdict updates on every keystroke and the factor list is shown in non-decreasing order with multiplicities collapsed.
No. By the modern definition a prime is an integer greater than 1 with exactly two distinct positive divisors: 1 and itself. The number 1 has only one divisor, so it sits outside both "prime" and "composite".
It uses 6k±1 trial division: after ruling out 2 and 3, it only tests divisors of the form 6k−1 and 6k+1 up to the square root. That skips two-thirds of the candidates of plain trial division while remaining deterministic.
Up to 2^53 − 1 (about 9 × 10^15), the JavaScript safe-integer limit. Above that, integer arithmetic loses precision in the browser and you would need a BigInt-based or Miller-Rabin probabilistic test instead.
Trial division is exact for numbers in range, so any composite is fully decomposed. Common surprises: numbers ending in 1, 3, 7, or 9 can still be products of larger primes — for example 91 = 7 × 13.
Explore the full suite of Number tools and 290+ other free utilities at Chunky Munster.