Math calculator

Free common factor calculator

Find all common factors of two integers — enter any two numbers to see their shared factors and greatest common factor, updated live, as you type.

InputsLive
First Number (a)
Second Number (b)
Result
Common factors
1, 2, 3, 4, 6, 12
Common factors of 24 and 36: 1, 2, 3, 4, 6, 12
First Number (a)24
Second Number (b)36
Factor Count6
GCF12

Common factors are divisors of both a and b. The greatest common factor (GCF) is the last value in the list.

Results are estimates. Consult a professional.

How it's calculated

How the common factor calculator works

Common factors of two (or more) numbers are the positive integers that divide every number in the set evenly. The greatest common factor (GCF) — also called the greatest common divisor (GCD) — is the largest of those shared divisors. The calculator finds the full factor list for each number, intersects the sets, and identifies the GCF.

Step 1 — Factor each number:
Factors(a) = {all i : a mod i = 0, 1 ≤ i ≤ a}
Factors(b) = {all i : b mod i = 0, 1 ≤ i ≤ b}
Step 2 — Intersect:
Common factors = Factors(a) ∩ Factors(b)
Step 3 — Find GCF:
GCF(a, b) = max(Common factors)
Euclidean algorithm (efficient GCF):
GCF(a, b) = GCF(b, a mod b) until b = 0
Khan Academy — Greatest common factor
Example

Worked example: common factors of 24 and 36

Example: Find all common factors and GCF of 24 and 36

List the complete factor sets for both numbers, then find their intersection. The largest element of that intersection is the GCF.

Factors(24) = {1, 2, 3, 4, 6, 8, 12, 24}
Factors(36) = {1, 2, 3, 4, 6, 9, 12, 18, 36}
Common factors = {1, 2, 3, 4, 6, 12}
GCF(24, 36) = 12
Euclidean check:
GCF(36, 24) → GCF(24, 12) → GCF(12, 0) = 12 ✓
GCF = 12
24 and 36 share 6 common factors: 1, 2, 3, 4, 6, and 12. Their greatest common factor is 12 — meaning 12 is the largest tile size that evenly fills both a 24-unit and a 36-unit length.
Quick reference

Common factors for selected number pairs

The table shows common factors and GCF for frequently encountered number pairs. Pairs with a large GCF share many factors; pairs of consecutive integers always have GCF = 1.

Pair (a, b)Common factorsGCF
12 and 181, 2, 3, 66
24 and 361, 2, 3, 4, 6, 1212
30 and 451, 3, 5, 1515
48 and 601, 2, 3, 4, 6, 1212
36 and 481, 2, 3, 4, 6, 1212
15 and 251, 55
14 and 211, 77
16 and 241, 2, 4, 88

Source: trial division and factor intersection

Practical tips

Tips for finding common factors

Common factors and GCF are used to simplify fractions, distribute items evenly, and solve ratio problems. These tips make the process more systematic.

  • Use the Euclidean algorithm for large numbers — listing all factors of a 6-digit number is tedious; the algorithm GCF(a,b) = GCF(b, a mod b) reaches the answer in a handful of steps.
  • GCF = 1 means the numbers are coprime — if the only common factor is 1, the two numbers share no prime factors. Consecutive integers are always coprime (e.g. GCF(8,9) = 1).
  • Simplify fractions with the GCF — to reduce a/b to lowest terms, divide both numerator and denominator by GCF(a, b). This is the most direct simplification method.
  • GCF from prime factorisation — express each number as a product of prime powers, then take the lowest power of each shared prime. For 24 = 2³×3 and 36 = 2²×3²: GCF = 2²×3 = 12.
  • Real-world use — even distribution — to split 24 apples and 36 oranges into identical groups (each group has the same number of apples and oranges), the maximum group count is GCF(24,36) = 12 groups of 2 apples and 3 oranges.
Accuracy & limits

Accuracy and limitations

Common factor calculations on positive integers are exact — integer division has no rounding error. The Euclidean algorithm terminates in at most O(log(min(a,b))) steps, making it fast even for inputs near JavaScript's safe integer limit (2⁵³ − 1 ≈ 9 × 10¹⁵). When more than two numbers are entered, the calculator computes the pairwise GCF iteratively: GCF(a,b,c) = GCF(GCF(a,b),c). Both inputs must be positive integers; zero and negative numbers are excluded from the factor definition used here.

Glossary

Key terms

A positive integer that divides two or more numbers exactly (with zero remainder); e.g. 6 is a common factor of 24 and 36.
The largest common factor of a set of numbers; also called the Greatest Common Divisor (GCD). Used to simplify fractions and solve ratio problems.
Two numbers are coprime when their only common factor is 1; GCF = 1. Example: 8 and 9.
An efficient method for finding the GCF: GCF(a,b) = GCF(b, a mod b), repeated until the remainder is 0.
Expressing a number as a product of its prime factors (e.g. 36 = 2² × 3²); a systematic way to identify common prime factors.
The smallest positive integer divisible by both a and b; related to GCF by LCM(a,b) = (a × b) / GCF(a,b).
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free common factor calculator

A common factor calculator is a free online tool that helps you find all common factors of two integers. Intersection of individual factor sets. It runs entirely in your browser with instant results and no sign-up.
JavaScript double-precision floating-point — accurate to about 15-17 significant digits. For arbitrary precision, use the Big Number calculator.
The statistics calculator computes population variance (divides by n). For sample variance, multiply variance by n/(n-1).

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.