Skip to main content
ilovecalcs logoilovecalcs.

Math · Live

Common Factor Calculator, find every shared divisor instantly.

Enter two or more positive integers and instantly see every number that divides all of them evenly. Get the complete list of common factors, the GCF, LCM, a factor-by-factor visual grid, and a divisibility table.

How it worksReal-time

Inputs

Enter integers

2–10 integers · max value 1,000,000

Examples

Numbers
24, 36
Common factors
6
GCF / GCD
12
LCM
72

Common factors of 24, 36

6 factors
1234612GCF

Every number in {1, 2, 3, 4, 6, 12} divides evenly into 24, 36

Common factors
6
From 1 to 12
GCF / GCD
12
Greatest Common Factor
LCM
72
Least Common Multiple

Factor breakdown

All factors of each number — common ones highlighted

248 factors
1234681224
369 factors
123469121836
Common factorUnique factor

Divisibility check

Each common factor divides all numbers evenly

Number÷ 1÷ 2÷ 3÷ 4÷ 6÷ 12
24=24=12=8=6=4=2
36=36=18=12=9=6=3

Number theory guide

Common factors — what they are and how to find them.

A factor (also called a divisor) of an integer n is any positive integer that divides n with no remainder. For example, the factors of 12 are 1, 2, 3, 4, 6, and 12 — each divides 12 exactly.

A common factor of two or more integers is a number that is a factor of every one of them simultaneously. The common factors of 12 and 18 are 1, 2, 3, and 6, because each of those numbers divides both 12 and 18 with no remainder.

How to find all common factors

The most reliable method is to use the relationship between common factors and the Greatest Common Factor (GCF):

  1. Find the GCF of all the numbers using the Euclidean algorithm.
  2. List all factors of the GCF. Every factor of the GCF is also a common factor of the original numbers, and every common factor of the original numbers is a factor of the GCF.

This works because of a fundamental theorem: the set of common divisors of a collection of integers is exactly the set of divisors of their GCF.

Common factors(a, b) = Factors(GCF(a, b))

For example, GCF(24, 36) = 12, and the factors of 12 are 1, 2, 3, 4, 6, 12, which are exactly the common factors of 24 and 36.

Finding all factors of a number efficiently

To find all factors of n, iterate from 1 to ⌊√n⌋. If i divides n, then both i and n ÷ i are factors. This O(√n) algorithm handles any number up to 1,000,000 in under a millisecond.

for i in 1..⌊√n⌋: if n mod i = 0: factors ← factors ∪ {i, n ÷ i}

For n = 36: iterate up to 6. At i = 1: add 1 and 36. At i = 2: add 2 and 18. At i = 3: add 3 and 12. At i = 4: add 4 and 9. At i = 6: add 6 (since 6 = √36, add once). Result: {1, 2, 3, 4, 6, 9, 12, 18, 36}.

Common factors vs. the Greatest Common Factor

The Greatest Common Factor (GCF). Also, called Greatest Common Divisor (GCD) or Highest Common Factor (HCF) — is simply the largest element of the set of common factors. While the GCF is often the only value needed in fraction simplification, the full set of common factors is useful in:

  • Breaking quantities into equal groups of different sizes
  • Understanding all valid tile sizes that exactly cover a floor
  • Finding all ways to cut a rope into equal pieces without waste
  • Determining all valid denominators when simplifying fractions

The Euclidean algorithm for GCF

This calculator uses the Euclidean algorithm to find the GCF, then lists all factors of that GCF. The Euclidean algorithm is:

gcd(a, b): while b ≠ 0: (a, b) ← (b, a mod b); return a

For multiple numbers: gcd(a, b, c) = gcd(gcd(a, b), c). The algorithm is O(log(min(a, b))) per pair, making it extremely fast even for large numbers.

Worked examples

Example 1: 12 and 18

  • Factors of 12: 1, 2, 3, 4, 6, 12
  • Factors of 18: 1, 2, 3, 6, 9, 18
  • GCF(12, 18) = 6
  • Common factors = factors of 6 = 1, 2, 3, 6

Example 2: 24, 36, and 48

  • GCF(24, 36) = 12; GCF(12, 48) = 12
  • Common factors = factors of 12 = 1, 2, 3, 4, 6, 12
  • Verify: 12 ÷ 1 = 12 ✓, 24 ÷ 2 = 12 ✓, 36 ÷ 3 = 12 ✓, 48 ÷ 4 = 12 ✓

Example 3: co-prime numbers (GCF = 1)

  • GCF(8, 15) = 1
  • Common factors = factors of 1 = 1 only
  • Two integers whose only common factor is 1 are called co-prime or relatively prime.

Relationship between common factors, GCF, and LCM

The GCF and LCM (Least Common Multiple) are linked by a key identity:

GCF(a, b) × LCM(a, b) = a × b

This means once you know the GCF, you can compute the LCM as LCM = (a × b) ÷ GCF. The common factors are all divisors of the GCF, and the GCF itself divides the LCM.

Common factors in everyday applications

  • Fraction simplification: To reduce 18⁄24, divide both by any common factor. Using the GCF (6) gives the fully simplified form 3⁄4. Using a smaller common factor (e.g., 2 or 3) gives a partially simplified fraction that can be reduced further.
  • Cutting and dividing: A 24 cm and a 36 cm ribbon can be cut into equal pieces of length 1, 2, 3, 4, 6, or 12 cm . Each of the 6 common factors gives a valid cutting size.
  • Scheduling: Two events that repeat every 12 and 18 days both occur on days that are multiples of the LCM (36). The GCF (6) tells you how often their scheduling overlaps.
  • Grid and tiling: The largest square tile that fits exactly in both a 24 cm × 36 cm rectangle is 6 cm × 6 cm (the GCF). All valid tile sizes are 1, 2, 3, 4, or 6 cm.

How many common factors can two numbers have?

The number of common factors of a and b equals the number of factors of their GCF — often written τ(GCF(a, b)), where τ is the divisor function. If the GCF is a prime p, there are exactly 2 common factors: 1 and p. If the GCF is a highly composite number (like 720 = 2⁴ × 3² × 5, which has 30 divisors), there can be 30 common factors.

Two numbers always share at least one common factor, the number 1. They share the factor 2 iff both are even. They share the factor p (prime) iff both are divisible by p.