Prime Factorization & Divisors

Factor any integer into primes with ladder-division working, list its divisors, test for primality, and find the GCD and LCM of several numbers.

✨ Features

  • Factors an integer the moment you type it, with ladder-division working and 2³×3²×5 exponent form
  • Lists every divisor with the count, the sum, and the pairs that multiply back to the number
  • Tells you whether the number is prime – instant even for 15-digit inputs
  • Finds the GCD and LCM of two or more numbers, showing the common-prime division steps

🪄 Use cases

Checking maths homework

The working is shown step by step, so you can compare method as well as answer.

Adding or reducing fractions

Get the LCM of the denominators or the GCD of numerator and denominator, with the steps.

Exploring number properties

See the divisor count and sum, and spot perfect numbers (sum equal to twice the number).

Sanity-checking code

Verify your own factorization or primality routine against large inputs.

🔒 Privacy

Every calculation runs in your browser; the numbers you type are never sent to a server. Only when you shorten a share URL is that URL (including your values) sent to the shortening service.

❓ FAQ

What is ladder division?

It is the written method taught in Japanese schools (sudare-zan): divide by the smallest prime, write that prime on the left and the quotient underneath, and repeat. For 360 you divide by 2 to get 180, by 2 to get 90, by 2 to get 45, by 3 to get 15, by 3 to get 5, and by 5 to get 1. The primes down the left – 2, 2, 2, 3, 3, 5 – are the factorization, written compactly as 2³×3²×5.

How are the divisor count and sum worked out?

Straight from the factorization. If n = p^a × q^b then the number of divisors is (a+1)(b+1) and their sum is (1+p+…+p^a)(1+q+…+q^b). For 360 = 2³×3²×5 that gives 4×3×2 = 24 divisors summing to (1+2+4+8)(1+3+9)(1+5) = 15×13×6 = 1170. When the sum is exactly twice the number itself you have a perfect number, such as 6, 28, 496 or 8128.

How large a number can it handle?

Up to 15 digits (999,999,999,999,999). Primality uses the Miller-Rabin test and factorization uses Pollard's rho, so even a product of two large primes comes back immediately. The digit limit is there to keep the divisor list and the on-screen working a sensible size.

How are the GCD and LCM related?

For two numbers a and b, a × b always equals GCD × LCM. With 12 and 18: 12×18 = 216 and 6×36 = 216. That identity does not extend to three or more numbers, but the exponent rule always does – take the smallest exponent of each prime for the GCD and the largest for the LCM.

🔗 Related tools

Prime factorization

Prime factorization
-
Primality
-
Number of divisors
-
Sum of divisors
-

Ladder division (working)

Divide by the smallest prime each time. The primes down the left are the factors; you are done when the bottom reaches 1.

Divisors

Listed in ascending order. The pairs below multiply back to the original number.

    Divisor pairs

    GCD and LCM

    Greatest common divisor (GCD)
    -
    Least common multiple (LCM)
    -

    Dividing by the common primes (working)

    Divide every number by a prime that goes into all of them. The primes down the left multiply to the GCD.

    Each number factored

    NumberPrime factorization