GCD Calculator

Find the greatest common divisor, also called the greatest common factor or highest common factor.

GCD calculator

GCD(48, 18)6

GCD(48, 18) = 6

Calculation steps
  1. Step 1Apply the Euclidean algorithm48 ÷ 18 = 2 remainder 12
  2. Step 2Apply the Euclidean algorithm18 ÷ 12 = 1 remainder 6
  3. Step 3Apply the Euclidean algorithm12 ÷ 6 = 2 remainder 0
GCD Summary
Numbers
48, 18
Greatest Common Divisor
6

Common GCD Problems

Simplifying Fractions

Reduce a fraction by dividing both terms by their GCD.

18/24 → GCD = 6 → (18 ÷ 6)/(24 ÷ 6) = 3/4

Reducing Ratios

Simplify both parts of a ratio with their shared divisor.

12:18 → GCD = 6 → 12 ÷ 6 : 18 ÷ 6 = 2:3

Equal Size Groups

24 apples and 36 oranges form 12 identical groups without leftovers.

Each group contains 2 apples and 3 oranges

Equal Measurement Groups

A 240 by 360 rectangle can be divided into equal squares.

Maximum square side length = 120

Formula

GCD

The largest positive integer that divides every number without remainder

Euclidean Algorithm

gcd(a, 0) = |a|; gcd(a, b) = gcd(b, a mod b)

Multiple Values

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

Examples

GCD of 48 and 18

GCD(48, 18) = 6

GCD of three integers

GCD(24, 36, 48) = 12

GCD when one number divides another

GCD(81, 27) = 27

GCD with zero

GCD(0, 24) = 24

GCD with a negative integer

GCD(-48, 18) = 6

Frequently Asked Questions

What is the difference between GCD, GCF, and HCF?

There is no mathematical difference. GCD, greatest common factor, and highest common factor are names for the same value.

How do you calculate the GCD of two numbers?

Use the Euclidean algorithm: repeatedly replace the pair with the divisor and remainder until the remainder is zero.

Can the GCD be calculated for more than two numbers?

Yes. Find the GCD of the first pair, then combine that result with each remaining integer in order.

What is the GCD of 0 and a positive integer?

The GCD of zero and a positive integer is the positive integer. The GCD is undefined when every input value is zero.

How is GCD used to simplify fractions and ratios?

Divide every term by the GCD. For example, dividing 18 and 24 by 6 reduces 18/24 to 3/4.