Advertisement

Free Online Prime Number Checker & Factorizer

Test primality and find prime factors of any number.

Enter any integer from 0 to 1,000,000,000,000.

Prime factorization
—
—
Result
—
Enter a number to test
Number of factors
—
Divisors including 1 and itself
Sum of factors
—
All divisors added
Perfect square
—
n = k × k
Perfect cube
—
n = k × k × k
Next prime
—
The first prime above this number
Previous prime
—
The largest prime below this number

All factors

Factors will appear here.
Advertisement

About the Prime Number Checker

A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. This tool tests any integer up to one trillion, lists every factor, and breaks the number into its prime factorization. It also reports whether the number is a perfect square or perfect cube, and finds the nearest primes on either side. Everything is calculated locally in your browser.

How primality is tested

Trial division checks whether any integer up to the square root divides the number evenly. If none does, the number is prime. Checking only up to the square root is enough because every composite number has a factor no larger than its square root. The implementation skips multiples of 2 and 3 and then tests candidates of the form 6k ± 1, which makes the search much faster than testing every integer.

Prime factorization

The factorization panel divides out the smallest prime repeatedly, then moves to the next candidate. The result is written with exponents, such as 360 = 2³ × 3² × 5. The expanded line shows the same product with every factor written out. This is useful for simplifying fractions, finding least common multiples, and checking divisibility by hand.

Perfect squares and cubes

A perfect square is an integer multiplied by itself, such as 144 = 12 × 12. A perfect cube is an integer multiplied by itself twice, such as 216 = 6 × 6 × 6. The flags are based on exact integer checks, so rounding errors do not produce false positives.

Frequently asked questions

Is 1 a prime number?

No. Prime numbers must be greater than 1 and have exactly two positive divisors. The number 1 has only one divisor.

Why does the factor list stop at a certain point?

For extremely composite numbers the list can contain thousands of values. The panel scrolls, and the count always reports the full total even when the display is long.

What is the difference between a factor and a prime factor?

A factor is any number that divides evenly, such as 4 for 360. A prime factor is a factor that is itself prime, such as 2, 3, or 5.

Sponsored
Find a bug? Report now