Beginner

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.
Positive whole number
Positive whole number
Least Common Factor (LCF)
2

Smallest prime factor shared by both numbers (smallest factor of GCF > 1)

GCF / GCD (Greatest Common Factor)
6
All common factors
1, 2, 3, 6
Shared factors > 1
2, 3, 6
Are numbers coprime?
No
01.22.33.44.65.86.989.2LCF=2GCF=6Least Common Factor and GCF on the number line
Step by step
  1. 1

    GCF = GCD(a, b) via Euclidean algorithm

    GCD(12, 18) = 6
    All common factors of a and b are exactly the divisors of their GCF.
  2. 2

    LCF = smallest prime factor of GCF

    smallest prime dividing 6 = 2
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

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
LCF(a, b) = smallest prime factor of GCF(a, b) • GCF via Euclidean algorithm
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

least common factor calculator
smallest shared factor
common factor finder
smallest common divisor calculator
shared factors of two numbers
lcf calculator math
coprime factor calculator

APA

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

Chicago

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.

IEEE

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

BibTeX

@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?