Greatest Common Denominator Calculator - GCD With Euclidean Steps

Use this greatest common denominator calculator to find the GCD of two or three numbers and see the common divisors list and Euclidean algorithm steps.

Updated: June 16, 2026 • Free Tool

Greatest Common Denominator Calculator

First positive integer. Zero is allowed and is treated as gcd(n, 0) = n in the Euclidean step.

Second positive integer. Combine with Number 1 and Number 3 to feed up to three values into the Euclidean algorithm.

Optional third integer. Leave at 0 to compute the GCD of the first two numbers only.

Results

Greatest Common Denominator (GCD)
0
Common Divisors List 0
Euclidean Algorithm Steps 0
Inputs Used 0integers

What Is a Greatest Common Denominator Calculator?

A greatest common denominator calculator is a focused math tool that takes two or three positive integers and returns the largest positive integer that divides every one of them with no remainder, the same value number-theory textbooks call the greatest common divisor (GCD) and grade-school worksheets call the greatest common factor (GCF). Type a value into each Number slot and the result panel shows the GCD, the common divisors list, and the Euclidean algorithm steps in a single read. The term 'denominator' is a popular alternate name for 'divisor', so the answer matches what any GCD or GCF tool would return.

  • Homework and textbook problems: Solve 'what is the GCD' or 'what is the GCF' questions for two or three numbers, then copy the Euclidean steps into a worked solution.
  • Simplifying fractions to lowest terms: Reduce a fraction to lowest terms by dividing the numerator and denominator by their greatest common denominator.
  • Tiling, cutting, and equal-grouping problems: Split a length, area, or set of items into the largest possible equal whole parts without leftovers.

Because the answer is a single integer, the result drops cleanly into a fraction-reduction step, a tile-counting worksheet, or a ratio check, and the common divisors list makes it obvious why the GCD is the largest one: every entry divides every input and the final entry is the largest value with that property.

When the same problem also asks for the smallest number that all inputs divide evenly, our GCF and LCM Calculator returns the GCF and the LCM together.

How the Greatest Common Denominator Calculator Works

The calculator applies the Euclidean algorithm to the active inputs in a single pass, reducing the list two at a time until only one integer remains. The last non-zero remainder is the GCD, the divisors of that integer form the common divisors list, and the intermediate (a, b, remainder) triples become the Euclidean steps.

gcd(a, b) = gcd(b, a mod b), repeating until the remainder is 0. For more than two numbers, gcd(a, b, c, ...) = gcd(gcd(a, b), c, ...).
  • a, b, c: The three integer inputs from the Number slots. Blank or 0 slots are skipped, and a single non-zero input returns itself as the GCD.
  • a mod b: The remainder when a is divided by b. The Euclidean algorithm replaces (a, b) with (b, a mod b) until the remainder is 0.
  • gcd: The greatest common denominator, the largest positive integer that divides every active input with no remainder. Same as the GCD or GCF.
  • common divisors: Every positive integer from 1 up to the GCD that divides every active input, in ascending order.

The Euclidean algorithm is exact: there is no rounding or tolerance, which is why the same algorithm is taught in introductory number-theory textbooks and used inside production software libraries.

GCD of 12, 18, and 24

Number 1 = 12, Number 2 = 18, Number 3 = 24

gcd(12, 18) -> gcd(18, 12) -> gcd(12, 6) -> 6. Then gcd(6, 24) -> 6.

GCD: 6. Common divisors: 1, 2, 3, 6. Inputs used: 3.

According to Wikipedia, the greatest common divisor of two or more integers, none of which is zero, is the largest positive integer that divides each of the integers, and the Euclidean algorithm computes it by repeated remainder operations until the remainder is zero.

If the common divisors list is the part you actually need, Common Factor Calculator returns every shared factor of two numbers together with the factor pairs.

Key Concepts Behind the GCD

Four small ideas explain why the Euclidean algorithm is so short and why the result shows up in so many number-theory problems, and they keep the difference between GCD, GCF, and LCM clear.

Denominator vs. divisor vs. factor

Denominator, divisor, and factor all name the same operation: the largest positive integer that divides every input. Mathematicians prefer greatest common divisor (GCD), grade school uses greatest common factor (GCF), and consumer calculators often label the answer greatest common denominator. The three names return the same integer.

Euclidean algorithm and remainders

The Euclidean algorithm is the iterative rule gcd(a, b) = gcd(b, a mod b). It keeps replacing the larger with the remainder of dividing the larger by the smaller until the remainder is 0, at which point the last non-zero value is the GCD. The algorithm runs in logarithmic time and never needs prime factorization.

Coprime inputs and GCD = 1

Two or more inputs are coprime when their only common positive divisor is 1, so the GCD of a coprime set is 1. The result panel lists 1 as the only common divisor, but the Euclidean steps still run every remainder operation the pair produces. A coprime pair such as 7 and 100 needs three remainder steps to settle at 1, and 4 and 9 needs two.

GCD and LCM trade off

For two positive integers a and b, GCD(a, b) x LCM(a, b) = a x b, so the GCD shrinks when the LCM grows and vice versa. The same product identity does not hold in one step for three or more numbers, but it does hold pairwise: gcd(a, b, c) = gcd(gcd(a, b), c) and lcm(a, b, c) = lcm(lcm(a, b), c), so each fold still respects the two-number identity.

When you want to confirm that one of the inputs is prime before treating it as a shared factor, Prime Number Checker verifies the primality of a single integer in the same range the GCD tool accepts.

How to Use the Greatest Common Denominator Calculator

Type up to three positive integers into the three Number slots and read the GCD, the common divisors list, and the Euclidean algorithm steps on the right. The result panel updates as you type, so you can swap inputs to test edge cases.

  1. 1 Type the first two integers: Enter at least two positive integers in the Number 1 and Number 2 slots. The defaults are 12 and 18, which already show a worked GCD example.
  2. 2 Add a third integer if you have one: Enter a third integer in the Number 3 slot to fold it into the GCD. Leave the slot at 0 to compute the GCD of the first two numbers only.
  3. 3 Read the GCD in the highlighted result: The highlighted Greatest Common Denominator (GCD) row shows the largest positive integer that divides every active input with no remainder.
  4. 4 Check the common divisors list: The Common Divisors List row shows every positive integer from 1 up to the GCD that divides every input. The last entry is the GCD itself.
  5. 5 Read the Euclidean algorithm steps: The Euclidean Algorithm Steps row shows the (a, b, remainder) triples the algorithm visited, enough to paste into a worked solution.
  6. 6 Confirm the inputs used and reset if needed: The Inputs Used row reports how many of the three Number slots held a positive integer. Press Reset to return to the 12, 18, 24 default.

Example: a student is asked for the GCD of 24, 60, and 84. They type the three numbers and read 12 in the highlighted row, then copy the partial-GCD steps into their worked solution.

If you need a focused single-output GCF tool that walks through the Euclidean algorithm side by side with a prime-factorization alternative, Greatest Common Factor Calculator shows both methods for two or three numbers.

Benefits of Using This Greatest Common Denominator Calculator

The Euclidean algorithm is short, but the same five-minute routine is simple to get wrong by hand when one of the inputs is a large prime or does not divide any of the others. The calculator handles those edge cases in a single pass.

  • GCD plus the full common divisors list: The result panel shows the GCD together with every common divisor of the inputs, so you can verify the GCD by inspection.
  • Euclidean steps ready to copy: Every (a, b, remainder) triple the algorithm visits appears in the result panel, enough to write a worked solution without redoing the long division.
  • Handles coprime inputs without special case: Coprime sets return 1 as the GCD and the common divisors list collapses to just 1, matching the textbook rule for inputs that share no prime factor. A coprime pair such as 7 and 100 still takes several steps to settle at 1.
  • Folds three numbers in a single pass: The tool applies gcd(a, b, c) = gcd(gcd(a, b), c) so you do not have to compute a partial GCD and feed it back in.
  • Treats zero as the identity case: An input of 0 is treated as a neutral element, so gcd(0, n) = n and the calculation continues against the other two slots.

When the GCD feeds into a polynomial step that has to factor a trinomial, Factoring Trinomials Calculator returns the trinomial factors in the same integer domain.

Factors That Affect the Result and Its Limits

The Euclidean algorithm is fixed, but the inputs you type and the constraints of integer arithmetic change what the GCD actually means. Knowing these constraints prevents a reasonable-looking result from leading you to the wrong next step.

Whether the inputs are positive

The algorithm is defined for non-negative integers, so negative numbers, blank slots, and non-finite values are treated as 0 and skipped. Finite positive decimals are floored to the nearest integer before the algorithm runs, so 12.7 is treated as 12. The result is always a positive integer; gcd(n, 0) is defined as n.

How many inputs are non-zero

Blank, zero, or non-finite slots are skipped, so a single positive input returns itself as the GCD and the common divisors list is the full factor list of that integer.

Shared vs. unshared prime factors

A prime that appears in only one of the inputs cannot contribute to the GCD, so coprime sets collapse to 1. The common divisors list shows which primes made the cut.

Size of the inputs

Inputs above 1,000,000 are out of range for this tool to keep the divisor scan fast. For larger integers, use a general math engine that implements the binary GCD variant.

  • The algorithm is defined for non-negative integers, so negative numbers and non-finite values are treated as 0 and skipped. Finite positive decimals are floored to the nearest integer before the algorithm runs, so 12.7 is treated as 12. Multiply first (for example, 0.5 -> multiply by 10) for exact decimal control.
  • The form accepts up to three integers. For four or more numbers, run the calculator with the first three, then feed the previous GCD together with the next number back into the tool until the list is exhausted.

According to Khan Academy, Khan Academy teaches the Euclidean algorithm as the standard way to compute the GCD by repeatedly dividing the larger number by the smaller and using the remainder until the remainder is zero.

If a future problem hands you a negative input, Absolute Value Calculator reports |x| so you can convert the negative integer to its positive magnitude.

greatest common denominator calculator showing the GCD, common divisors list, and Euclidean algorithm steps for two or three numbers.
greatest common denominator calculator showing the GCD, common divisors list, and Euclidean algorithm steps for two or three numbers.

Frequently Asked Questions

Q: What is the greatest common denominator of two numbers?

A: The greatest common denominator of two positive integers is the largest positive integer that divides both numbers with no remainder. For example, the common divisors of 12 and 18 are 1, 2, 3, and 6, so their greatest common denominator is 6. The term 'denominator' is an alternate name for 'divisor' that several calculators use, and the result is identical to the GCD or GCF.

Q: Is greatest common denominator the same as greatest common divisor?

A: Yes. Greatest common denominator, greatest common divisor, and greatest common factor are three names for the same operation: the largest positive integer that divides every input with no remainder. Mathematicians prefer greatest common divisor (GCD), grade-school worksheets use greatest common factor (GCF), and consumer calculators frequently label the answer greatest common denominator.

Q: How do you find the greatest common denominator of three numbers?

A: Apply the Euclidean algorithm to the first two numbers to get a partial GCD, then apply the Euclidean algorithm to that partial GCD and the third number. The final non-zero remainder is the GCD of all three numbers. The calculator does this folding in a single pass and prints the partial GCDs in the Euclidean steps row.

Q: What is the Euclidean algorithm for GCD?

A: The Euclidean algorithm is the iterative rule gcd(a, b) = gcd(b, a mod b). You replace the larger number with the smaller and the smaller with the remainder of dividing the larger by the smaller, then repeat until the remainder is 0. The last non-zero value is the GCD, and the algorithm runs in logarithmic time for any size of positive integer.

Q: What is the greatest common denominator of 12, 18, and 24?

A: gcd(12, 18) = 6, then gcd(6, 24) = 6, so the GCD of 12, 18, and 24 is 6. The common divisors of all three numbers are 1, 2, 3, and 6, which the result panel lists in order. Any common denominator above 6 (such as 12 or 18) does not divide 24, so 6 is the largest one.

Q: When is the greatest common denominator equal to 1?

A: The GCD is 1 when the inputs share no common prime factor, which is the case for coprime sets such as 8 and 9 or 4, 9, and 25. The result panel reports 1 as the GCD and the common divisors list collapses to just 1. Coprime pairs still take several Euclidean steps, so gcd(7, 100) needs three remainder operations (100 = 14 x 7 + 2, 7 = 3 x 2 + 1, 2 = 2 x 1 + 0) to settle at 1.