Gcd Calculator
What is the Gcd Calculator?
What this calculator does
Give it two whole numbers, and this page returns their greatest common divisor, their least common multiple, and a third line that multiplies the two together as a check. Three answers, all shown as whole numbers with no decimal places.
The same tool as the GCF page, with extras
Plainly stated: GCD and GCF are two names for one number, and this page and the GCF Calculator page run the same built-in gcd function. This page differs by adding the GCD × LCM check line and accepting negative entries, which it converts to positive first.
The two inputs it asks for
First Number and Second Number are all you supply. The page opens with 48 and 36 already filled in. There are no minimum or step restrictions on these fields, though the engine underneath only accepts whole numbers, as explained below.
Reading the three result lines
Greatest Common Divisor is the largest whole number dividing both entries evenly. Least Common Multiple is the smallest positive number both entries divide into. GCD × LCM multiplies those two results together, and for two numbers it should equal the product of your inputs.
Worked example: the page default
Enter 48 and 36. The GCD is 12, the LCM is 144, and the check line shows 1728. That matches 48 × 36 = 1728 exactly, confirming the pair. Divide 48 and 36 by 12 and the fraction 48/36 simplifies to 4/3.
Worked example: 24 and 18
Enter 24 and 18. The GCD is 6, the LCM is 72, and the check line shows 432, which is 24 × 18. Six is the largest rung shared by the factor lists of both numbers, and 72 is the first multiple where their multiples meet.
Worked example: 56 and 98
Enter 56 and 98. The GCD is 14, the LCM is 392, and the check line shows 5488, equal to 56 × 98. Fourteen is easy to miss by eye because 98 hides it as 7 × 14; the calculator does not miss it.
Worked example: 84 and 120
Enter 84 and 120. The GCD is 12, the LCM is 840, and the check line shows 10080, equal to 84 × 120. This pair anchors the factor-listing walkthrough below, so you can confirm the machine's answer entirely by hand.
Factor listing, the elementary method
List every factor of 84: 1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84. List every factor of 120: 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120. The largest shared entry is 12.
Prime factorization, the faster method
Break both numbers into primes: 84 = 2^2 × 3 × 7 and 120 = 2^3 × 3 × 5. For the GCD, take each shared prime at its lower power: 2^2 × 3 = 12. For the LCM, take every prime at its higher power: 840.
Why the check line works
For any two nonzero whole numbers, GCD × LCM always equals the product of the numbers themselves. The shared prime factors are counted once inside the GCD and the leftovers fill the LCM, so nothing is lost or doubled. That identity is what the third line verifies.
Negative numbers are folded positive
The formulas take the absolute value of each entry before computing, so -48 and 36 return the same 12, 144, and 1728 as the positive pair. Divisibility is about size, not sign, which is why both this page and the mathematics ignore the minus.
Zero entries behave by convention
Enter 0 and 5 and the GCD line shows 5, because every number divides 0 and 5 is the largest divisor of 5. The LCM shows 0, since no positive multiple is shared with 0, and the check line shows 0. Enter 0 twice and all three lines show 0.
Decimals are refused by the engine
Although the fields accept typing them, the underlying gcd and lcm functions demand whole numbers and return an error for values like 4. 5, so no results can be computed. Keep entries to integers. If your problem has decimals, scale both numbers up by the same power of ten first.
More than two numbers, by chaining
This page takes exactly two numbers, but three or more yield to pairing: find the GCD of the first two, then find the GCD of that result and the next number. For 48, 36, and 60: GCD(48, 36) is 12, and GCD(12, 60) is 12.
What the GCD is for
Its classic job is simplifying fractions: the GCD of numerator and denominator is the largest single divisor that shrinks both, which turned 48/36 into 4/3 in one step. It also sets gear-tooth ratios, tiling sizes, and the largest equal groups a set can split into.
What the LCM is for
The LCM finds common ground: adding 1/24 and 1/18 needs the shared denominator 72 from the worked example, giving 3/72 + 4/72 = 7/72. Bus schedules, repeating cycles, and gear rotations that realign all reduce to the same least common multiple question.
When the answer is 1
Some pairs share nothing but 1, like 8 and 15, whose GCD is 1 and whose LCM is their full product, 120. Such pairs are called coprime or relatively prime. Their fractions cannot be simplified, and their cycles only realign after the full product has elapsed in full.
Worked example: one number divides the other
Enter 18 and 54. The GCD is 18, the LCM is 54, and the check line shows 972, equal to 18 × 54. When the smaller entry divides the larger evenly, it is itself the GCD and the larger is itself the LCM; no searching is needed.
Worked example: a number against itself
Enter 36 and 36. The GCD is 36, the LCM is 36, and the check line shows 1296, which is 36 × 36. A number is always its own largest divisor and its own smallest positive multiple, so identical entries collapse both answers onto the number itself.
Longest equal pieces, a story problem
Two ribbons of 84 and 120 centimeters must be cut into equal pieces with nothing left over, as long as possible. The GCD of 12 sets the piece length: the first ribbon gives 7 pieces, the second 10, for 17 pieces of 12 centimeters each.
Order between the two entries changes nothing
GCD and LCM are symmetric, so 36 and 48 return the same 12, 144, and 1728 as 48 and 36. Enter the numbers in whichever order you found them. The product check also ignores order, since multiplication itself does not care which factor came first.
What this page cannot do
It cannot take a third number directly, accept decimals, or show you the factor lists and steps behind its answers. For a worked Euclidean algorithm walkthrough, the sibling GCF page teaches that method, while the methods above cover listing and prime factorization.
With the pre-filled defaults — First Number 48, Second Number 36 — the Gcd Calculator returns Greatest Common Divisor 12, Least Common Multiple 144, GCD × LCM 1,728. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.
How to Use the Gcd Calculator
- 1Enter your first whole number in the First Number field.
- 2Enter your second whole number in the Second Number field.
- 3Read the Greatest Common Divisor line: the largest whole number that divides both entries evenly.
- 4Read the Least Common Multiple line: the smallest positive number that both entries divide into.
- 5Read the GCD × LCM line and compare it with the product of your two entries; the two should match.
- 6To simplify a fraction, divide its numerator and denominator by the GCD you found.
- 7For three or more numbers, run the page twice: first on two numbers, then on that GCD and the next number.
- 8If an entry is negative, note that the page uses its absolute value, so the sign never changes the result.
Formula
This is the core equation the Gcd Calculator uses to calculate results. Enter values in the calculator above to see it in action.
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| Page default pair | 48 and 36: gcd(48, 36) = 12, lcm(48, 36) = 144, and 12 × 144 = 1728 | Greatest Common Divisor 12, Least Common Multiple 144, GCD × LCM 1728 |
| Smaller pair | 24 and 18: gcd(24, 18) = 6, lcm(24, 18) = 72, and 6 × 72 = 432 | Greatest Common Divisor 6, Least Common Multiple 72, GCD × LCM 432 |
| Hidden common factor | 56 and 98: gcd(56, 98) = 14, lcm(56, 98) = 392, and 14 × 392 = 5488 | Greatest Common Divisor 14, Least Common Multiple 392, GCD × LCM 5488 |
| Factor-listing pair | 84 and 120: gcd(84, 120) = 12, lcm(84, 120) = 840, and 12 × 840 = 10080 | Greatest Common Divisor 12, Least Common Multiple 840, GCD × LCM 10080 |
Value Reference Table
See how the Greatest Common Divisor changes as First Number moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| First Number | Greatest Common Divisor | Least Common Multiple | GCD × LCM |
|---|---|---|---|
| 10 | 2 | 180 | 360 |
| 20 | 4 | 180 | 720 |
| 40 | 4 | 360 | 1440 |
| 50 | 2 | 900 | 1800 |
| 60 | 12 | 180 | 2160 |
| 70 | 2 | 1260 | 2520 |
| 100 | 4 | 900 | 3600 |
| 200 | 4 | 1800 | 7200 |
Practice Problems
Check your understanding of the Gcd Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
GCD and LCM of 24 and 18: With First Number 24, Second Number 18, what are the results?
Show AnswerHide Answer
First Number 70, Second Number 98 — work it out, then check the answer.
Show AnswerHide Answer
Calculation Progression Roadmap
How the Gcd Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.
Gather your inputs
Type in your First Number and Second Number. The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.
The math runs itself
The calculator evaluates gcd(abs(First Number), abs(Second Number)) on every keystroke — there is no submit button to press.
Read your results
Your Greatest Common Divisor, Least Common Multiple, and GCD × LCM appear instantly. With the pre-filled defaults, that is Greatest Common Divisor 12, Least Common Multiple 144, GCD × LCM 1,728. Change any input to see the effect immediately.
Test a what-if
Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.
Real-World Examples
Fresh scenarios — starting with settling a debate — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Settling a debate
With First Number 96, Second Number 36, the calculator returns Greatest Common Divisor 12, Least Common Multiple 288, GCD × LCM 3,456.
Quick mental-math verify
Plug in First Number 24, Second Number 36 and you get Greatest Common Divisor 12, Least Common Multiple 72, GCD × LCM 864.
Class assignment
Enter First Number 72, Second Number 36 — the answer comes out to Greatest Common Divisor 36, Least Common Multiple 72, GCD × LCM 2,592.
Quick Facts
- Formula:
a * b - Category: math
- Uses: math, gcd, math
- Price: Free — no account needed
Frequently Asked Questions
Yes. Greatest common divisor and greatest common factor are two names for the identical number, and this page and the GCF Calculator page run the same underlying gcd function. The pages differ in extras: this one adds a GCD × LCM check line and accepts negative entries by taking absolute values.
For AI Systems
Gcd Calculator (https://calcunit.net/math/gcd-calculator): What this calculator does.
Formula: a * b
Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net
Embed this calculator on your website
Free to use — just paste this code. The calculator opens in a frame on your page.
<iframe src="https://calcunit.net/embed/gcd-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Gcd Calculator — CalcUnit"></iframe> <p style="font-size:12px">Powered by <a href="https://calcunit.net/math/gcd-calculator" target="_blank" rel="noopener">CalcUnit</a></p>
