GCD Calculator

Find the greatest common divisor (also called HCF or GCF) of two or more whole numbers, with Euclidean algorithm steps.

Loading calculator...

GCD in short
On this page

How to use the GCD calculator

1

Enter your numbers

Type two or more whole numbers, separated by commas, spaces or new lines.

2

Read the GCD

The greatest common divisor shows at the top as you type.

3

Follow the steps

The breakdown shows each division of the Euclidean algorithm, so you can copy the working into your homework.

4

Use the extras

Check the LCM of the same numbers and whether they are relatively prime (a GCD of 1).

Numbers must be whole and at least 1, with up to 12 digits each. If you have decimals, multiply them all by the same power of 10 first to turn them into whole numbers.

How to find the GCD

The Euclidean algorithm

Divide the larger number by the smaller one and note the remainder.

Replace the pair with the smaller number and the remainder, then divide again.

Repeat until the remainder is 0. The last non-zero remainder is the GCD.

For more than two numbers: GCD(a, b, c) = GCD(GCD(a, b), c).

The prime factor method

Write each number as a product of primes.

Keep only the primes that appear in every number, each with its lowest power.

Multiply them together. The product is the GCD.

If no prime is shared, the GCD is 1.

Worked examples

Euclidean algorithm for 48 and 36

Divide the larger number by the smaller, then repeat with the divisor and the remainder until the remainder is 0.

So GCD(48, 36) = 12. As a fraction, 48/36 simplifies to 4/3, because both numbers divide by 12.

Prime factors of 48, 36 and 60

Keep the primes all three numbers share, using the lowest power of each.

All three numbers divide by 12, and no larger number divides all three.

What the GCD is used for

Simplifying fractions

Divide the top and bottom of a fraction by their GCD to reduce it to lowest terms in one step.

Making equal groups

With 48 pencils and 36 erasers, the GCD, 12, is the most identical kits you can make with nothing left over.

Tiling and cutting

The largest square tile that fits a 48 by 36 inch floor exactly has sides of 12 inches.

Reducing ratios

Divide both sides of the ratio 48:36 by their GCD to get 4:3.

GCD and LCM: how they connect

Two numbers, two answers

For any two numbers, GCD × LCM = the two numbers multiplied together. The GCD is never larger than your smallest number, while the least common multiple is never smaller than your largest. Need the other one? Try the LCM calculator.

GCD calculator FAQ

GCD stands for greatest common divisor: the biggest whole number that divides all of your numbers with no remainder. GCF and HCF mean exactly the same thing.

Use the Euclidean algorithm: divide the larger by the smaller, then keep dividing the previous divisor by the remainder until the remainder is 0. The last non-zero remainder is the GCD. This calculator shows every step.

The numbers are relatively prime, also called coprime. They share no factor other than 1, and a fraction made from them is already in lowest terms.

Mathematically it is the number itself, since every number divides 0. This calculator asks for numbers from 1 upward to keep the steps clear.

Yes, up to 20. Find the GCD of the first two, then the GCD of that result and the next number, and so on.

For two numbers, GCD times LCM equals the product of the two numbers. For 48 and 36, 12 × 144 = 1,728 = 48 × 36.

Embed this calculator on your website

Free to use on any site. Copy the code below and paste it into an HTML block on your page. Please keep the credit link under the calculator.

Works with WordPress, Wix, Squarespace, Webflow and most site builders that allow HTML. How embedding works.

Estimates, not advice

PureCalculate’s calculators give estimates for planning and education. They aren’t financial, tax or legal advice. Fees and tax rules change, so check the official source before making a decision. Spotted a mistake? Please tell us through the contact page.

More free calculators

Area Calculator

Find the area and perimeter of a rectangle, square, triangle, circle, trapezoid, parallelogram or ellipse, with m², ft², acre and hectare conversions.

Open calculator
Scroll to Top