Prime Factorization Calculator

Every whole number above 1 breaks into primes in exactly one way. That uniqueness is the whole content of the fundamental theorem of arithmetic, and it is less obvious than it sounds — start a factor tree from a different branch and every level looks different, yet the leaves always come out the sam...

The factorisation is unique, and that is why 1 is not prime. Every integer above 1 breaks into primes in exactly one way. Admit 1 as a prime and 6 becomes 2×3, then 1×2×3, then 1×1×2×3, without end — the uniqueness the whole theorem rests on would be gone.

THE NUMBER

360 =

2^3 × 3^2 × 5

3 distinct primes, 6 factors counted with multiplicity. Multiplying them back gives 360 — the same number, which is the check worth doing.

DIVISORS

24

4 × 3 × 2

SUM OF DIVISORS

1,170

EULER TOTIENT φ(n)

96

coprime to n below n

√n

18

the search never needs to go past this

The divisor count comes from the exponents alone. Each prime can appear anywhere from none to all of its available copies, so the choices multiply: 3 + 1, then 2 + 1, then 1 + 1 — giving 4 × 3 × 2 = 24. Nothing needs listing, which matters once the count runs into thousands.

BREAKING IT DOWN

SPLITTING OFF ONE PRIME AT A TIME360red is prime and cannot be split further — the column carries what is left

Any order of splitting reaches the same primes. Start with a different factor and the tree looks different at every level, yet the leaves are identical. That is the uniqueness the fundamental theorem asserts, and it is far less obvious than it sounds — it took until Euclid to prove and until Gauss to state properly.

HOW MANY TIMES EACH PRIME APPEARSmultiply each of these plus one and you have the number of divisors4 × 3 × 2 = 24 divisors
THE SEARCH ONLY HAS TO REACH THE SQUARE ROOTa logarithmic scale — n is vastly further right than it looks√n ≈ 18nthe smallest factor sits inside the shaded region — it always does

Miller–Rabin and Pollard’s rho · exact to 2⁵³ − 1

Created with❤️byeaglecalculator.com

HOW TO USE

  1. 1

    Type any whole number from 2 up to 9,007,199,254,740,991. Commas and spaces are ignored; decimals are rejected, because primes are built from divisibility and a fraction divides nothing evenly.

  2. 2

    Read the exponents as well as the primes. Multiplying each one plus one gives the divisor count directly, which is the quickest thing the factorisation tells you.

  3. 3

    Check the reconstruction. Multiplying the factors back must give the number you typed — the page shows it, and that single line catches any error the rest of the working could hide.

  4. 4

    Add a second number to get the gcd and lcm from the exponents: the smaller of each pair for one, the larger for the other. Their product always equals the product of the two numbers.

REFERENCE FORMULAS

RuleFormulaWhat it is for
Fundamental theoremn = p₁^a₁ · p₂^a₂ · … , uniquelyEvery integer above 1 factors one way only, up to the order of the factors.
Why 1 is excluded6 = 2·3 = 1·2·3 = 1·1·2·3 …Counting 1 as prime would give infinitely many factorisations and kill uniqueness.
Trial division boundtest only up to √nIf n = ab with a ≤ b then a ≤ √n, so a composite always has a factor below the root.
Number of divisorsd(n) = ∏(aᵢ + 1)Each prime can appear 0 to aᵢ times, so the choices multiply. No listing needed.
Sum of divisorsσ(n) = ∏ (pᵢ^(aᵢ+1) − 1)/(pᵢ − 1)A geometric series per prime, multiplied together.
Euler totientφ(n) = ∏ pᵢ^(aᵢ−1)(pᵢ − 1)How many numbers below n share no factor with it. Central to RSA.
GCD from exponentstake the smaller exponent of each primeAny prime missing from either number contributes nothing.
LCM from exponentstake the larger exponent of each primeAnd gcd × lcm = a × b always, which is a quick check.
Perfect squareevery exponent is evenBecause a square is its root multiplied by itself, doubling every exponent.
Perfect numberσ(n) = B26, 28, 496, 8128. Whether an odd one exists is still unknown.
Coprimegcd(a, b) = 1No prime in common. Their factorisations share nothing at all.
Prime countingπ(x) ≈ x / ln xRoughly one number in ln x is prime near x, so primes thin out slowly.
Cube of a primep³ has exactly 4 divisors1, p, p², p³. From (3 + 1) — the exponent rule at its simplest.
Why factoring is hard√n divisions for a naive searchA 16-digit number needs ~10⁸ steps. Public-key cryptography rests on this.

FREQUENTLY ASKED QUESTIONS

RELATED CALCULATORS

MORE ALGEBRA CALCULATORS

Was this calculator helpful?

Last updated: August 4, 2026 · Miller–Rabin primality with Pollard’s rho, exact to 2⁵³ − 1 · The factorisation is unique, which is why 1 is not counted as prime.