GCF Calculator
Find the greatest common factor of two or more positive integers exactly
Find the greatest common factor of two or more positive integers exactly
Enter two or more positive integers separated by commas. The calculator applies the Euclidean algorithm repeatedly to find their greatest common factor.
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).
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.
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.
输入以逗号分隔的两个或多个正整数。计算器会反复使用欧几里得算法求出最大公因数。
以 48 和 18 为例:48 mod 18 = 12,接着 18 mod 12 = 6,再 12 mod 6 = 0。最后一个非零余数 6 就是答案。每一步都用「较小数 + 余数」替换原来的数对,数字缩得很快——就算是 20 位的输入也几步收敛。三个及以上输入时按两两折叠处理:gcd(a, b, c) = gcd(gcd(a, b), c)。
约分是最经典的用法:48/18 分子分母同除 6 得 8/3。此外它还能回答铺砖问题——不切割就能铺满 48 × 18 英寸矩形的最大方形瓷砖是 6 × 6 英寸;以及等分打包问题,比如把 48 颗螺丝和 18 个垫圈装成完全相同的套件。
对任意两个正整数:a × b = gcd(a, b) × lcm(a, b)。拿到 48 和 18 的 GCF 后,LCM 不用再跑算法:48 × 18 ÷ 6 = 144。这一对数能解决涉及两个值的大多数排程和铺砖问题,所以本页常常是第一站。
Yes. Enter up to 20 positive integers separated by commas, spaces or semicolons.
No. This page accepts positive, nonzero integers.
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
最近复核:2026 年 10 月 5 日 · 我们的计算方法 · 来源:公式用于参考;涉及专业决定时请核对适用条件