Math & Trig

GCD Formula

GCD returns the greatest common divisor of two or more integers — the largest number that divides evenly into all arguments. It's used to simplify fractions, find common intervals, and solve problems involving repeating patterns or shared factors in scheduling and manufacturing.

Syntax

GCD(number1, [number2, ...])
ParameterDescription
number1 Parameter of the GCD function.
[number2 (Optional.) Parameter of the GCD function.
...] Parameter of the GCD function.
Try GCD in Viztab — free, no signup

Examples

Simplify a fraction

Formula
=GCD(48, 36)
Returns 12. To simplify 48/36, divide both by GCD: 48/12 = 4, 36/12 = 3, so 48/36 = 4/3.

Three numbers

Formula
=GCD(24, 60, 84)
Returns 12. The largest number that divides evenly into 24, 60, and 84 is 12.

Tile sizing

Formula
=GCD(180, 240)
Returns 60. A 180×240 cm floor can be tiled perfectly with 60×60 cm tiles (the largest square tile that fits with no cutting).

Common Errors

#NUM!

Negative numbers return #NUM!. GCD only works with non-negative integers.

#VALUE!

Non-numeric arguments return #VALUE!.

Tips

Simplify fractions

Numerator/GCD and Denominator/GCD gives the simplified fraction. =A1/GCD(A1,B1) & "/" & B1/GCD(A1,B1) shows it as text.

Check if coprime

If GCD(a,b) = 1, the numbers are coprime (share no common factors). This matters in cryptography and gear ratios.

Accepts multiple arguments

GCD can take up to 255 arguments or a range. =GCD(A1:A10) finds the GCD of all 10 values at once.

Try GCD in Viztab

Import your data and use GCD with 370+ other formulas. No signup required.

Open Viztab

Related Formulas