Skip to content

Factor Calculator — Step-by-Step Solutions

The Factor Calculator finds all factors of a number, its prime factorisation, and factor pairs. It can also compute the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two numbers.

Enter any positive integer to see its complete factorisation. The calculator uses trial division for efficient computation and displays results clearly.

All Factors
—

Your calculations will appear here

How to Use the Factor Calculator

  1. Choose a mode from the selector at the top: All Factors lists every divisor of a number, Prime Factorisation breaks a number into its prime building blocks, Factor Pairs shows pairs that multiply to give the number, GCD finds the greatest common divisor of two numbers, and LCM finds the least common multiple.
  2. For All Factors, Prime Factorisation, and Factor Pairs, enter a single positive integer. For GCD and LCM, enter two positive integers.
  3. Results appear instantly as you type. Click "Show steps" to see the working, rendered with proper mathematical notation. In Prime Factorisation mode, an interactive factor tree diagram is also displayed.
  4. Use the Share button to copy a link that pre-fills the calculator with your current inputs and mode.
  5. The factor tree highlights prime numbers in blue. Each level splits a composite number into its smallest prime factor and the remaining quotient until only primes remain.

Formula and Theory

A factor (or divisor) of a positive integer n is any positive integer that divides n without leaving a remainder. Every positive integer has at least two factors: 1 and itself. Numbers with exactly two factors are called prime numbers, while numbers with more than two factors are called composite numbers.

Prime factorisation expresses a composite number as a product of prime numbers. By the Fundamental Theorem of Arithmetic, every integer greater than 1 has a unique prime factorisation (up to the order of the factors). This decomposition is the foundation for many results in number theory.

The Greatest Common Divisor (GCD) of two integers is the largest positive integer that divides both numbers. The Euclidean algorithm computes it efficiently by repeatedly replacing the larger number with the remainder of dividing the two, until the remainder is zero. The last non-zero remainder is the GCD.

The Least Common Multiple (LCM) of two integers is the smallest positive integer divisible by both. It is related to the GCD by the identity LCM(a, b) = (a * b) / GCD(a, b). This relationship makes computing the LCM straightforward once the GCD is known.

Worked Examples

Example 1: Finding all factors of 36

Problem: List every positive integer that divides 36.

Solution: Test integers from 1 to sqrt(36) = 6. 36 / 1 = 36, 36 / 2 = 18, 36 / 3 = 12, 36 / 4 = 9, 36 / 6 = 6. Collect both divisor and quotient.

Answer: 1, 2, 3, 4, 6, 9, 12, 18, 36

Example 2: Prime factorisation of 180

Problem: Express 180 as a product of prime factors.

Solution: 180 / 2 = 90, 90 / 2 = 45, 45 / 3 = 15, 15 / 3 = 5, 5 is prime.

Answer: 2^2 * 3^2 * 5

Example 3: Factor pairs of 24

Problem: Find all pairs (a, b) where a * b = 24.

Solution: Test from 1 upward: 1 * 24, 2 * 12, 3 * 8, 4 * 6. Stop when a > sqrt(24).

Answer: (1, 24), (2, 12), (3, 8), (4, 6)

Example 4: GCD of 48 and 36

Problem: Find the greatest common divisor of 48 and 36 using the Euclidean algorithm.

Solution: gcd(48, 36): 48 / 36 = 1 remainder 12. gcd(36, 12): 36 / 12 = 3 remainder 0. The last non-zero remainder is 12.

Answer: 12

Example 5: LCM of 15 and 20

Problem: Find the least common multiple of 15 and 20.

Solution: First find GCD(15, 20) = 5. Then LCM = (15 * 20) / 5 = 300 / 5.

Answer: 60

Frequently Asked Questions

What is the difference between a factor and a multiple?
A factor of n divides n exactly (e.g. 4 is a factor of 12). A multiple of n is n multiplied by a positive integer (e.g. 24 is a multiple of 12). Factors are always less than or equal to the number, while multiples are always greater than or equal to it.
Is 1 a prime number?
No. By convention, 1 is neither prime nor composite. A prime number must have exactly two distinct positive divisors: 1 and itself. Since 1 has only one divisor, it does not qualify.
How does the Euclidean algorithm work?
Divide the larger number by the smaller and take the remainder. Replace the larger number with the smaller, and the smaller with the remainder. Repeat until the remainder is 0. The last non-zero remainder is the GCD. For example, gcd(48, 18): 48 mod 18 = 12, then 18 mod 12 = 6, then 12 mod 6 = 0, so gcd = 6.
Why is prime factorisation unique?
The Fundamental Theorem of Arithmetic guarantees that every integer greater than 1 can be written as a product of primes in exactly one way (ignoring order). This uniqueness is what makes prime factorisation so useful in cryptography, number theory, and computing.
Can I use GCD and LCM with more than two numbers?
Yes. To find the GCD of three numbers, compute gcd(a, b) first, then gcd(result, c). The same chaining approach works for LCM. This calculator handles two numbers at a time, but you can apply the result iteratively for larger sets.

Related General Calculators

Related Articles