Least Common Factor Calculator — Smallest Shared Factor
Enter two positive integers to find all factors they share and the smallest one greater than 1 — the Least Common Factor (LCF), which is the smallest prime in their Greatest Common Factor.
Smallest prime factor shared by both numbers (smallest factor of GCF > 1)
- 1
GCF = GCD(a, b) via Euclidean algorithm
GCD(12, 18) = 6All common factors of a and b are exactly the divisors of their GCF. - 2
LCF = smallest prime factor of GCF
smallest prime dividing 6 = 2
How does this calculator work?
LCF(a, b) = smallest prime dividing GCF(a, b). Compute GCF via Euclidean algorithm, then find its smallest prime factor by trial division. Example: GCF(12, 18) = 6; smallest prime of 6 is 2, so LCF = 2. If GCF = 1 the numbers are coprime and share no factor > 1.
Formula
How this is calculated
The common factors of two integers a and b are exactly the divisors of their Greatest Common Factor (GCF, also called GCD). Finding the GCF via the Euclidean algorithm — repeatedly replacing the pair (a, b) with (b, a mod b) until the remainder is zero — is fast and exact. Every common factor of a and b must divide the GCF, so the full set of common factors is just the divisors of GCF(a, b).
The Least Common Factor is the smallest of those shared factors that is greater than 1. It is always a prime number, because if it were composite it would have a smaller factor that would also divide the GCF — contradicting "smallest". The LCF is therefore the smallest prime that divides GCF(a, b), found by trial division starting at 2.
If GCF(a, b) = 1 the numbers are coprime and share no factor other than 1 — in that case 1 is their only common factor, and there is no shared prime factor. "Least common factor" is not a term with a single universal definition; this calculator interprets it as the smallest prime-factor shared by both integers (smallest divisor of their GCF that is greater than 1), which is the most useful and unambiguous reading.
Frequently asked questions
GCF (Greatest Common Factor) is the largest factor that divides both numbers. LCF (Least Common Factor, > 1) is the smallest prime factor they share — the smallest prime that divides their GCF. GCF ≥ LCF always; they are equal only when the GCF is itself prime.
Coprime (or relatively prime) numbers share no common factor other than 1 — their GCF is 1. For example, 8 and 15 are coprime. Coprime numbers have no LCF greater than 1.
Yes. The LCF (smallest shared factor > 1) must be prime. If it were composite, it would have a smaller factor that also divides both numbers — that smaller factor would then be a smaller common factor, contradicting the assumption that we have the least one.
Also known as
TG we-Calculate Editorial Team. (2026). Least Common Factor Calculator — Smallest Shared Factor [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/least-common-factor-calculator
TG we-Calculate Editorial Team. "Least Common Factor Calculator — Smallest Shared Factor." TG we-Calculate. 2026. https://we-calculate.com/calculator/least-common-factor-calculator.
TG we-Calculate Editorial Team, "Least Common Factor Calculator — Smallest Shared Factor," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/least-common-factor-calculator
@misc{wecalculate_least_common_factor_calculator, title = {Least Common Factor Calculator — Smallest Shared Factor}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/least-common-factor-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
