Math calculator

Prime Factorization Calculator

Break a number into its primes, with the ladder and the reason the search stops.

Break it into primes

With the ladder and the bound.

Whole numbers up to twenty-five digits. Commas are fine.

360

2³ × 3² × 5

Written out flat: 2 × 2 × 2 × 3 × 3 × 5.

Distinct primes

3

6 with repeats counted

Number of divisors

24

one more than each exponent, multiplied: (3 + 1) × (2 + 1) × (1 + 1) = 24

Trial divisions made

4

stopped at 18, the square root

Sum of divisors

1,170

Euler's totient is 96

The division ladder

  1. 360 ÷ 2 = 180
  2. 180 ÷ 2 = 90
  3. 90 ÷ 2 = 45
  4. 45 ÷ 3 = 15
  5. 15 ÷ 3 = 5
  6. 5 ÷ 5 = 1

Divided by the smallest prime that fits, over and over, until 1 is left. Any other order of splitting gives a different-looking tree and the same leaves.

Why the search could stop

Checking every number up to 359 would have been 358 divisions. Stopping at the square root made it 4.

  • Trial division stopped at 18, the square root of 360, and made 4 divisions. That is enough for a complete answer: if a number had two factors both larger than its square root, their product would be larger than the number itself. So while anything remains to be found, a factor below the root exists — and passing the root proves what is left is prime.
  • Any other order of splitting gives a different tree and the same leaves. That is the fundamental theorem of arithmetic: the primes are unique, only the route to them varies.

The divisor count is derived from the exponents and separately matched against the enumerated list.

What this tool shows

Every number above 1 factorises into primes in exactly one way. The page shows the ladder that gets there and reports how many trial divisions it took — and how many the square-root argument saved.

  • Prime factorisation in exponent and expanded form
  • The division ladder, step by step
  • How many trial divisions were needed
  • Why stopping at the square root is enough
  • The divisor count, derived from the exponents
  • Perfect squares and perfect powers, when they apply
The division ladder Trials made and trials saved Divisor count from the exponents Up to twenty-five digits

Exact on BigInt; the trial bound is stated.

Updated 7 September 2026 · Works in any browser, no installation

Divide by the smallest prime that fits, then repeat on what is left, until 1 remains. 360 goes 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, ÷ 3 = 15, ÷ 3 = 5, ÷ 5 = 1, giving 2³ × 3² × 5. The search only has to go as far as the square root of whatever is left, which is why 360 took four trial divisions rather than 358.

At a glance

Formula shown
Every integer above 1 is a product of primes in exactly one way (the fundamental theorem of arithmetic). Trial division to \u221an is sufficient: two factors both above \u221an would multiply to more than n. The divisor count is \u220f(e\u1d62 + 1) over the exponents.
Scenario support
Finding a greatest common factor or least common multiple by hand; simplifying a surd; working out how many divisors a number has without listing them.
Educational estimate
Planning support from the values you enter — not professional advice.

Why the search stops at the square root

Suppose n has a factor at all, so n = a × b with neither a nor b equal to 1. If both were larger than the square root of n, their product would be larger than n — which it is not. So at least one of them is at or below the root.

That single line is the entire argument, and it is what makes trial division feasible. To factorise 600851475143 you check numbers up to about 775000, not up to 600 billion.

It also explains what the end of the search proves. When the trial numbers pass the square root of whatever is left and nothing has divided it, that remainder cannot have any factors at all — so it is prime, and the factorisation is complete.

One number, one factorisation

360 can be split as 36 × 10, or as 8 × 45, or as 2 × 180. The trees look entirely different. The leaves are always the same: three 2s, two 3s and a 5.

That is the fundamental theorem of arithmetic, and it is less obvious than it looks — it fails in other number systems that otherwise behave much like the integers. It is the reason every question about divisibility can be answered by looking at the primes.

It is also why the greatest common factor and the least common multiple can be read off a table of exponents. Both are questions about the primes, and the primes are unique.

Counting divisors without listing them

360 = 2³ × 3² × 5 has 24 divisors, and you can know that without writing a single one down.

Every divisor is built by choosing how many 2s to take (0, 1, 2 or 3 — four choices), how many 3s (three choices) and how many 5s (two). Four times three times two is 24. In general it is one more than each exponent, multiplied.

That is why 45360 has exactly 100 divisors, and why a prime has exactly two: its only exponent is 1, so the product is 1 + 1. The Factor Calculator lists them and checks the count against this formula.

Why 1 is not prime

1 has no prime factorisation. It is the empty product — what you get by multiplying no primes at all — and that is a genuine answer rather than a special case.

Calling 1 prime would break unique factorisation immediately, because 12 could then be written 2 × 2 × 3, or 1 × 2 × 2 × 3, or with any number of 1s in front. The theorem that makes primes useful would need an exception clause.

The cleaner definition is the one used everywhere: a prime has exactly two distinct factors. 1 has one. That is not an arbitrary exclusion, it is a count.

Where factorising gets hard

Trial division handles anything a person types. Twelve digits takes well under a second because the search only reaches the square root, which is six digits.

It stops scaling somewhere past twenty digits, and the numbers used in cryptography are six hundred digits and deliberately built as two large primes. No known method factorises those in any reasonable time, and the entire security of RSA rests on that gap between how easy multiplying is and how hard reversing it is.

This page refuses past twenty-five digits rather than spinning. A tool that hangs is worse than one that says it is the wrong tool.

What the factorisation is for

Greatest common factor and least common multiple. Both are read off the exponents — lower powers of shared primes for one, higher powers of all primes for the other.

Simplifying surds. √360 becomes 6√10 by pulling out the pairs: 2³ × 3² × 5 has a pair of 2s and a pair of 3s.

Counting and summing divisors. Both come straight from the exponents, with no enumeration needed.

Deciding perfect powers. A number is a perfect square exactly when every exponent is even, and a perfect cube when every exponent is a multiple of three.

Sources and methodology

Unique factorisation is Euclid; the algorithms are older than computing. These are the references.

Method. Trial division by 2 and then by odd numbers up to the square root, on BigInt so nothing is lost past 2^53. Every trial is counted and reported. The divisor count is derived from the exponents rather than by enumerating, and separately checked against the enumeration in the test suite. Every prime factor the engine reports is independently tested for primality there too, because a factorisation into composites would pass a product check. That engine is verified on every change against 64 hand-written assertions, including that every factorisation to four thousand multiplies back to its input and uses only genuine primes, each verified by a separate primality test. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

FactorEvery factor of a number listed in the pairs that generate them, with the count derived from the prime exponents and separately checked against the list.
GCFThe greatest common factor of two to six numbers with all three routes shown — the shared primes to their lower powers, Euclid line by line, and the full factor lists when they are short enough to be honest.
LCMThe least common multiple of two to six numbers, with the prime table that produces it, the multiples themselves, and how far counting would have had to go.
Prime NumberWhether a number is prime, with a divisor named when it is not and the size of the search stated when it is. Deterministic, not probabilistic.
Divisibility TestEvery divisibility rule from 2 to 16 applied to your number, each with its working, the reason it holds, and the true remainder beside it as a check.
Simplify FractionsReduce a fraction to lowest terms with both routes to the divisor shown side by side — Euclid line by line and the shared primes — and a stated proof when nothing can be cancelled.

More in Math, or browse all calculators.

Read the guide

If you want every factor rather than just the primes, the Factor Calculator lists them in the pairs that generate them. If the only question is whether the number is prime, the Prime Number Calculator answers that with a witness when the answer is no.

Educational use disclaimer

This is an educational tool. Trial division is exact and the right method for numbers typed by hand; past about twenty digits it stops being one, and the page refuses rather than pretending.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 7 September 2026

  1. Published the prime factorisation page with the division ladder and, more to the point, the reason the search terminates: two factors both above the square root would multiply to more than the number.
  2. The page reports the trials it actually made against the trials checking every number would have taken — 4 against 358 for 360.
  3. The divisor count is derived from the exponents rather than by enumerating, and the suite checks every claimed prime factor is genuinely prime, since a factorisation into composites would still pass a product check.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.