Prime Factorization Calculator

This professional-grade calculator decomposes any supported integer into its prime factors. It’s built for students, teachers, engineers, data scientists, and number theory enthusiasts who need accurate prime power form, divisor counts, and related arithmetic functions—instantly and accessibly.

Data Source and Methodology

The calculator is grounded in well-established results from analytic and computational number theory:

  • G. H. Hardy and E. M. Wright, “An Introduction to the Theory of Numbers,” 6th ed., Oxford University Press, 2008. Official reference
  • R. Crandall and C. Pomerance, “Prime Numbers: A Computational Perspective,” 2nd ed., Springer, 2005. Springer
  • “Fundamental Theorem of Arithmetic,” Wolfram MathWorld (accessed 2025).

All calculations are rigorously based on the formulas and data provided by these sources.

The Formula Explained

1) Fundamental factorization:
n = \prod_{i=1}^{k} p_i^{a_i}, \quad p_1 < p_2 < \cdots < p_k,\; a_i \in \mathbb{Z}_{\ge 1}
2) Number of divisors:
\tau(n) = \prod_{i=1}^{k} (a_i + 1)
3) Sum of divisors:
\sigma(n) = \prod_{i=1}^{k} \frac{p_i^{a_i + 1} - 1}{p_i - 1}
4) Euler’s totient:
\varphi(n) = n \prod_{i=1}^{k} \left(1 - \frac{1}{p_i}\right)
5) Prime-count functions (for reference):
\omega(n) = k, \quad \Omega(n) = \sum_{i=1}^{k} a_i

Glossary of Variables

SymbolMeaning
nInput integer (2 ≤ n ≤ 9,007,199,254,740,991)
p_ii-th prime factor of n in ascending order
a_iExponent of prime p_i in the factorization of n
\omega(n)Number of distinct prime factors
\Omega(n)Total number of prime factors counted with multiplicity
\tau(n)Number of positive divisors of n
\sigma(n)Sum of all positive divisors of n
\varphi(n)Euler’s totient: count of integers 1 ≤ k ≤ n that are coprime to n

How It Works: A Step-by-Step Example

Example: Factor n = 360.

  1. Remove small primes: 360 is even.
    360 = 2 × 180 = 2² × 90 = 2³ × 45
  2. Next prime 3: 45 = 3 × 15 = 3² × 5
  3. Remaining 5 is prime.

Therefore 360 = 2^3 \cdot 3^2 \cdot 5. From this:

  • \omega(360) = 3 and \Omega(360) = 3 + 2 + 1 = 6
  • \tau(360) = (3+1)(2+1)(1+1) = 24
  • \sigma(360) = \frac{2^{4}-1}{2-1} \cdot \frac{3^{3}-1}{3-1} \cdot \frac{5^{2}-1}{5-1} = 1200
  • \varphi(360) = 360\left(1-\frac{1}{2}\right)\left(1-\frac{1}{3}\right)\left(1-\frac{1}{5}\right) = 96

Frequently Asked Questions (FAQ)

What is prime factorization?

It is the expression of an integer n ≥ 2 as a product of primes, uniquely determined up to ordering, by the Fundamental Theorem of Arithmetic.

Can I factor 0 or 1?

0 and 1 do not have a prime factorization. The tool explains this case and avoids returning misleading results.

What size numbers are supported?

Integers from 2 to 9,007,199,254,740,991 (Number.MAX_SAFE_INTEGER). This ensures exact arithmetic and reliable results.

Does the tool guarantee uniqueness of the result?

Yes. The output primes and exponents are canonical (sorted ascending), reflecting the theorem’s uniqueness.

Will it always be instantaneous?

Almost always. Rare hard cases near the upper bound may take longer; a time budget and robust algorithms keep the UI responsive.

Can I see all divisors?

Yes, when the total count is reasonable (≤ 10000). Otherwise, we show counts and sums without listing every divisor to keep performance high.

How are φ(n), τ(n), and σ(n) computed?

They are derived directly from the prime power factorization using the well-known multiplicative formulas shown above.

Tool developed by Ugo Candido. Content reviewed by the CalcDomain Expert Team.
Last reviewed for accuracy on: .