One Calculator Logo One Calculator
Mathematics & Statistics • Formulas shown

Prime Factorization Calculator

Quick Answer

Prime factorization writes a number as a product of prime numbers. Divide by the smallest prime that fits and repeat on the quotient until you reach 1. For example, 360 = 2³ × 3² × 5. Every whole number above 1 has exactly one such factorization.

Up to 1,000,000,000,000,000.
Result

360 = 2^3 × 3^2 × 5

Prime number?No
Distinct primes3
Number of divisors24
Sum of divisors1,170
Step-by-step calculation
  1. Divide by the smallest prime that fits (2, 3, 5, 7, …) and repeat on the quotient until it reaches 1.
  2. 2 divides 3 times
  3. 3 divides 2 times
  4. 5 divides 1 time
  5. Number of divisors = (3 + 1) × (2 + 1) × (1 + 1) = 24

About the Prime Factorization Calculator

Enter a whole number from 2 up to one quadrillion and the calculator returns its prime factorization, whether it is prime, how many divisors it has and the sum of those divisors. These are the building blocks for simplifying fractions, finding GCF and LCM, and many number-theory problems.

The method is trial division: test 2, then odd numbers up to the square root of what remains. That is fast for the range supported here. Factoring much larger numbers is a genuinely hard problem, which is why modern cryptography relies on it.

How to Use the Prime Factorization Calculator

  1. Enter a whole number of 2 or more.
  2. Read the factorization in the headline.
  3. Use the tiles for divisor count and sum of divisors.

Formula and Method

Fundamental theorem of arithmetic

n = p₁^a₁ × p₂^a₂ × … × pₖ^aₖ

Every integer above 1 factors uniquely into primes.

Number of divisors

d(n) = (a₁ + 1)(a₂ + 1)…(aₖ + 1)

Add one to each exponent and multiply.

Sum of divisors

σ(n) = Π (pᵢ^(aᵢ+1) − 1) ÷ (pᵢ − 1)

Geometric series for each prime power.

Worked Example

Factor 360

Input: 360

  • 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45 → 2³
  • 45 ÷ 3 = 15, ÷ 3 = 5 → 3²
  • 5 is prime → 5¹
  • Divisors = (3 + 1)(2 + 1)(1 + 1) = 24

Result: 360 = 2³ × 3² × 5, with 24 divisors summing to 1,170.

Frequently Asked Questions

Is 1 a prime number?

No. A prime has exactly two distinct positive divisors, and 1 has only one. Excluding 1 is what makes prime factorization unique.

How can I tell whether a number is prime?

If it has no prime factor up to its square root, it is prime. The calculator reports this directly in the "Prime number?" tile.

What is the largest number I can factor here?

Up to 1,000,000,000,000,000 (10¹⁵). Above that, standard JavaScript numbers lose exact integer precision.

How is prime factorization used to find GCF and LCM?

The GCF multiplies the lowest power of each shared prime; the LCM multiplies the highest power of every prime that appears.

Related Calculators

All Math & Statistics Calculators →

Sources and Further Reading

Accuracy and Scope

Results use standard IEEE-754 double-precision arithmetic and are rounded for display. For exam, engineering or research work, verify critical values with a second method. See our full disclaimer.