Number theory

Prime Factorization Calculator

Break an integer into prime factors and see divisors, largest prime factor, GCD, LCM, radical, and Euler totient.

Integers

Enter the integer to factor and, optionally, a comparison integer for GCD and LCM results. The calculator returns the factor tree summary and related number-theory values.

Prime factorization

2^3 * 3^2 * 5

The integer written as a product of prime powers.

Number of divisors

24

How many positive divisors the number has.

Largest prime factor

5

The biggest prime number that divides the input exactly.

Factor summary

Prime factors reveal the building blocks of an integer. They are useful for simplifying fractions, finding common denominators, checking divisibility, and studying modular arithmetic.

Smallest prime factor

2

Distinct prime factors

3

Greatest common divisor

12

Least common multiple

2,520

Radical

30

Euler totient

96

Overview

Prime factorization breaks a whole number into prime numbers that multiply back to the original value. Prime numbers are the basic building blocks of positive integers: 2, 3, 5, 7, 11, and so on. For example, 360 can be written as 2^3 × 3^2 × 5. This compact expression reveals far more than the original number alone. It shows divisibility, common factors, the number of divisors, and relationships with other integers.

This prime factorization calculator is useful for school math, contest practice, fraction simplification, cryptography introductions, modular arithmetic, and general number sense. It returns the factorization, divisor count, smallest and largest prime factors, distinct prime count, radical, Euler's totient, and GCD/LCM with a comparison number. The extra outputs make the calculator more than a factor tree: it becomes a small number-theory workspace.

How to use the calculator

Enter the integer you want to factor. The current shell is designed for positive integers in a practical range, not extremely large cryptographic numbers. Then enter a comparison number if you want greatest common divisor and least common multiple results. For example, entering 360 and 84 shows how much structure the two numbers share and what common multiple would contain both.

The factorization result is written with exponents when a prime appears more than once. 2^3 means 2 × 2 × 2. If a number is prime, the factorization is simply the number itself, the divisor count is 2, and the smallest and largest prime factor are the same.

Formula and method

The calculator uses trial division. It first tests divisibility by 2, then checks odd divisors. Every time a divisor divides the number exactly, the exponent for that prime increases and the remaining number shrinks. Once the possible divisor is larger than the square root of the remaining value, any leftover value must be prime.

From the prime powers, other values follow. If n = p^a × q^b, the number of divisors is (a + 1)(b + 1). The radical is the product of distinct primes, so repeated powers count once. Euler's totient counts positive integers up to n that are coprime with n. GCD is calculated with the Euclidean algorithm, and LCM follows from lcm(a,b) = a × b / gcd(a,b).

Example

For 360, the calculator returns 2^3 * 3^2 * 5. The divisor count is (3 + 1)(2 + 1)(1 + 1) = 24, because each prime exponent can be chosen from zero up to its maximum. The largest prime factor is 5, the smallest is 2, and the radical is 2 × 3 × 5 = 30.

If the comparison number is 84, the greatest common divisor is 12. The least common multiple is 2,520. Those two values are useful when reducing fractions, adding fractions with different denominators, or synchronizing cycles that repeat after different intervals.

Limitations

Trial division is reliable and easy to understand, but it is not intended for massive integers. Very large numbers require specialized algorithms. The calculator also assumes ordinary positive integers. It does not factor polynomials, decimal numbers, negative values, or algebraic expressions. For everyday arithmetic and learning, however, prime factorization gives a powerful view of how a number is assembled.