CALCULATE ALL — every calculation, from tomorrow

Math • Finance • Health • Conversion • Education — 100% free, no sign-up

Math

GCF Calculator

Find the greatest common factor of two numbers instantly.

Find the greatest common factor (GCF, also called GCD) of two numbers — the largest number that divides both evenly. Used for simplifying fractions and ratios, factoring expressions, and splitting quantities into equal groups.

Introduction

The greatest common factor (GCF), also called the greatest common divisor, is the largest number that divides two or more numbers evenly. It is what you use to reduce fractions to lowest terms — 48/72 reduces via their GCF of 24 to 2/3 — and to split quantities into the largest possible equal groups with nothing left over, like dividing 36 apples and 54 oranges into identical gift bags (18 bags of 2 apples and 3 oranges). Any time you want the biggest equal split, you want the GCF.

Prime factorization finds it cleanly: break each number into primes and take the lowest power of each prime common to all of them. For 48 (2^4 x 3) and 72 (2^3 x 3^2), the shared primes give 2^3 x 3 = 8 x 3 = 24. The Euclidean algorithm is the faster method computers use: repeatedly replace the larger number with the remainder of dividing it by the smaller until the remainder is zero — the last non-zero remainder is the GCF. For 48 and 72: 72 mod 48 = 24, 48 mod 24 = 0, so the GCF is 24. It is also the mirror image of the LCM, linked by GCF(a,b) x LCM(a,b) = a x b — for 48 and 72, 24 x 144 = 3,456 = 48 x 72.

How it's calculated

The GCF is found with the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller until the remainder is zero — the last non-zero remainder is the GCF.

Worked examples

GCF of 48 and 72

Prime factors: 48 = 2^4 x 3, 72 = 2^3 x 3^2. Shared primes at their lowest powers: 2^3 x 3 = 8 x 3 = 24. Verify: 48/24 = 2 and 72/24 = 3, and 2 and 3 share no further common factor — so 24 is the greatest. The fraction 48/72 therefore reduces to 2/3. Euclidean check: 72 mod 48 = 24, 48 mod 24 = 0 — GCF is 24.

GCF of 36, 54, and 81

Prime factors: 36 = 2^2 x 3^2, 54 = 2 x 3^3, 81 = 3^4. The only prime common to all three is 3, at its lowest power 3^2 = 9. So 9 is the GCF: the maximum number of identical gift bags is 9, each holding 36/9 = 4 of the first item, 54/9 = 6 of the second, and 81/9 = 9 of the third, with nothing left over. Using the GCF of just two of the numbers (e.g., 18 for 36 and 54) would fail on the third — always include every quantity.

Frequently asked questions

What is the GCF of 12 and 18?

6. It's the largest number that divides both 12 and 18 evenly.

What is the difference between GCF and GCD?

Nothing — GCF (greatest common factor) and GCD (greatest common divisor) are two names for the same thing.

How is the GCF used to simplify fractions?

Divide the numerator and denominator by their GCF. For 12/18, the GCF is 6, so 12/18 simplifies to 2/3.

Is the GCF Calculator free to use?

Yes. The GCF Calculator on CalculateAll is completely free — no sign-up, no usage limits and nothing to install. The calculation runs entirely in your browser, so the numbers you enter never leave your device.

Does the GCF Calculator work on mobile phones?

Yes. The GCF Calculator is fully responsive and works on phones, tablets and computers. Open the page, enter your values, and the result updates instantly — no app download needed.

The GCF at work: tiling a floor and cutting ribbon

Worked example: the largest square tile that fits exactly

A bathroom floor measures 252 cm by 198 cm, and you want the largest square tiles that cover it with no cuts and no gaps. The tile side must divide both dimensions exactly, and the largest such length is the GCF of 252 and 198. Factor them: 252 = 2 x 2 x 3 x 3 x 7 and 198 = 2 x 3 x 3 x 11, so the shared primes give 2 x 3 x 3 = 18. The answer is 18 cm tiles, laid 252 / 18 = 14 along the length and 198 / 18 = 11 across — 154 tiles exactly, with nothing left over. Any larger "round" size fails: 21 cm tiles divide 252 but leave a strip along the 198 side, and 20 cm divides neither. This is the GCF's most practical disguise — every "biggest equal size that fits both" problem in tiling, paving, fencing panels and fabric cutting is this calculation.

Worked example: cutting two ribbons into equal pieces

Two ribbons, 84 cm and 60 cm, must be cut into pieces of one identical length, using all of both ribbons. GCF(84, 60) = 12, so the longest possible piece is 12 cm, giving 84 / 12 = 7 pieces from the first ribbon and 60 / 12 = 5 from the second — 12 pieces in total. Choose any other common divisor, such as 6 cm, and you get more, shorter pieces (24 of them); choose a length that is not a common divisor, like 15 cm, and the 60 cm ribbon cuts cleanly while the 84 cm ribbon leaves a 9 cm stub. The GCF is the unique answer to "longest pieces, nothing wasted."

Edge cases: coprime numbers, zero, and equal inputs

Three special cases are worth recognizing before they confuse you. If the GCF comes out as 1 — for example GCF(7, 13) = 1, or GCF(25, 36) = 1 — the numbers are called coprime: they share no factor besides 1, no equal split larger than 1 exists, and any fraction built from them is already in lowest terms. If one input is 0, the GCF is the other number, since every number divides 0: GCF(18, 0) = 18. And if the two inputs are equal, the GCF is that number itself — GCF(24, 24) = 24 — because a number always divides itself. A GCF larger than the smaller input is impossible, so if a result ever looks bigger than both numbers, the inputs were probably mistyped.

Reducing ratios: the GCF behind aspect ratios

Screen and photo dimensions are ratios waiting to be reduced, and reducing a ratio is the GCF at work. A 1440 x 960 photo has an aspect ratio of 1440:960; GCF(1440, 960) = 480, and dividing both sides by 480 gives 3:2 — the classic print ratio, which is why that file prints perfectly at 6 x 4 inches and crops awkwardly at 7 x 5. The same check explains video formats: 1920:1080 reduces by a GCF of 120 to 16:9, and 1024:768 reduces by 256 to 4:3. When a platform asks for an image "in 16:9," it is asking whether your dimensions share a GCF that reduces them to 16 and 9 — this calculator is the fastest way to find out.

Related calculators

References