Skip to content · 跳到主要内容

GCF Calculator

Find the greatest common factor of two or more positive integers exactly

Greatest common factor
--
--
Input integers
--
Calculation

Greatest common factor of a list of integers

Enter two or more positive integers separated by commas. The calculator applies the Euclidean algorithm repeatedly to find their greatest common factor.

gcd(a, b) = gcd(b, a mod b)
gcd(a, b, c) = gcd(gcd(a, b), c)

Watching the Euclidean algorithm run

For 48 and 18 the chain goes: 48 mod 18 = 12, then 18 mod 12 = 6, then 12 mod 6 = 0. The last nonzero remainder, 6, is the answer. Each step replaces the pair with the smaller number and the remainder, so the numbers shrink fast — even 20-digit inputs converge in a handful of steps. With three or more inputs the calculator folds them pairwise: gcd(a, b, c) = gcd(gcd(a, b), c).

Where the GCF earns its keep

Reducing fractions is the classic use: 48/18 divides top and bottom by 6 to become 8/3. Beyond that, the GCF answers tiling questions — the largest square tile that covers a 48 by 18 inch rectangle without cutting is 6 by 6 inches — and equal-group questions like packing 48 screws and 18 washers into identical kits.

GCF and LCM travel together

For any two positive integers, a × b = gcd(a, b) × lcm(a, b). So once you have the GCF of 48 and 18, the LCM follows without another algorithm: 48 × 18 ÷ 6 = 144. That pair of numbers settles most scheduling and tiling questions involving the two values, which is why this calculator is often the first stop.

Frequently Asked Questions

Can I enter more than two values?

Yes. Enter up to 20 positive integers separated by commas, spaces or semicolons.

Can zero be included?

No. This page accepts positive, nonzero integers.

How are large values handled?

Integer input and the result use exact BigInt arithmetic in the browser.

Last reviewed: October 5, 2026 · How we calculate · Sources: Published formula reference; verify domain-specific assumptions before making a decision