Skip to content
CalculatorZilo Logo
  • Home
  • CalculatorsExpand
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
CalculatorZilo Logo
Home / Math Calculators / GCD Calculator
Math Calculators

GCD Calculator

Published onOctober 1, 2025 Updated onNovember 10, 2026 6:18 pm

Finding the greatest common divisor by listing factors works for small numbers and falls apart fast once the numbers grow. This calculator runs the Euclidean algorithm on two integers, or three with the optional field, and prints every division step under the answer so you can check the working, not just the result. It is pre-filled with 48 and 18: press Calculate and you get a GCD of 6 with the full remainder chain.

GCD Calculator

Greatest common divisor of two or three integers, with every Euclidean step shown

Quick Answer

The GCD of 48 and 18 is 6: 48 = 18 × 2 + 12, 18 = 12 × 1 + 6, 12 = 6 × 2 + 0. In general, the GCD is the largest whole number that divides every number in the set with no remainder, and the fastest reliable way to find it is the Euclidean algorithm: divide, keep the remainder, repeat until the remainder is 0.

On this page
  • Quick Answer
  • Key Takeaways
  • How to use the GCD Calculator
  • The Euclidean algorithm, step by step
  • Worked example: GCD of 48 and 18, plus a three-number check
  • Where the GCD actually earns its keep
  • Quick reference: common GCD pairs
  • What competing calculators miss
  • Frequently asked questions
  • Add This Calculator to Your Website
  • References

Key Takeaways

  • The GCD is the largest whole number dividing every number in the set.
  • Euclid’s method needs no factorisation: divide, keep the remainder, repeat to 0.
  • Three numbers reduce pairwise: GCD(a, b, c) = GCD(GCD(a, b), c).
  • A GCD of 1 means coprime, so fractions and ratios are already reduced.
  • Signs are ignored and the answer is always positive; 0 paired with n gives n.

How to use the GCD Calculator

Two fields required, the third optional

Two fields are required and the third is optional. Enter whole numbers, press Calculate, and read the GCD in the result box with its step-by-step working below it.

  1. Enter the first two numbers. Order does not matter for the answer. One quirk worth knowing: if the first number is smaller, the first printed step swaps the pair by showing a quotient of 0, which is the algorithm correcting the order itself.
  2. Add a third number only if you need one. The calculator reduces the first pair, then reduces that answer with the third number. A blank or non-numeric third field is ignored silently, so a stray character there never breaks a two-number calculation.
  3. Press Calculate. The result box appears with the GCD, a copyable result field, and the Euclidean steps. Nothing is calculated until you press the button.
  4. Copy or share the result, or press Reset to return to the 48 and 18 worked example.

Enter integers. The tool reads each field with integer parsing, so 12.9 is read as 12. That truncation is disclosed in the FAQs because it surprises people: for decimal problems, scale every number by the same power of ten first. If you are simplifying a fraction once you have the GCD, the decimal to fraction calculator handles the conversion side of that job.

The Euclidean algorithm, step by step

Divide, replace, repeat

The Euclidean algorithm rests on one fact: GCD(a, b) = GCD(b, a mod b). Dividing cannot create or destroy shared divisors, it only shrinks the pair, so repeating the division walks straight down to the answer.

1. Divide

Divide the larger number by the smaller one and note the quotient and remainder: a = b × q + r.

2. Replace

The smaller number becomes the new divider and the remainder becomes the new number to divide.

3. Repeat

Keep going. The remainders shrink every step, so the process always ends.

4. Read the answer

When the remainder hits 0, the last divisor used is the GCD.

The method is old and still unbeaten for hand and computer work alike: it appears as Proposition 2 of Book VII of Euclid’s Elements, written around 300 BCE, and the number of steps grows slowly even for very large inputs. Prime factorisation finds the same answer and teaches more about the numbers, but it depends on factoring, which gets hard quickly. Euclid’s method never needs a single factor.

Worked example: GCD of 48 and 18, plus a three-number check

GCD(48, 18) = 6. The calculator prints exactly these steps for the pre-filled values:

StepDivisionReading
148 = 18 × 2 + 12Remainder 12 replaces 48
218 = 12 × 1 + 6Remainder 6 replaces 18
312 = 6 × 2 + 0Remainder 0: the last divisor, 6, is the GCD

Check the answer against the definition

Check it against the definition: 48 / 6 = 8 and 18 / 6 = 3, both whole, and no larger number divides both. Dividing a fraction by its GCD reduces it, so 48/18 becomes 8/3. Adding a third number works pairwise: GCD(48, 18, 30) first gives GCD(48, 18) = 6, then GCD(6, 30) = 6. Try it by typing 30 into the optional field. The same pairwise reduction is what you lean on when adding fractions with different denominators, which is where the fraction addition calculator picks the work up.

Where the GCD actually earns its keep

The GCD shows up wherever a quantity has to split evenly. Reducing fractions and ratios is the classroom case: divide numerator and denominator by their GCD and the fraction is in lowest terms in one move, ready for the fraction to percent calculator if a percentage is the format you need.

Outside the classroom

Outside the classroom the same idea sizes square tiles for a rectangle with no cuts (the tile side must divide both dimensions, so the biggest tile is the GCD), sets gear and timing ratios, and sits inside the modular arithmetic that RSA encryption depends on, where the extended Euclidean algorithm finds the inverses that make the keys work. A GCD of 1 is a useful signal in all of these settings: the numbers are coprime, nothing reduces, and in cryptography that coprimality is a requirement, not a curiosity.

Quick reference: common GCD pairs

The patterns teachers reach for most

These pairs cover the patterns teachers and problem setters reach for most. Every row reproduces exactly in the calculator above.

NumbersGCDNote
12, 186Classic first example
24, 3612Both multiples of 12
48, 18, 306Three-number pairwise reduction
8, 151Coprime: nothing reduces
100, 200100One number divides the other
1071, 46221The textbook Euclidean example, done in three steps

What competing calculators miss

Strong on breadth, weak on the audit trail

Most GCD tools are stronger on breadth and weaker on the audit trail. The honest gaps this page closes are about checking the answer, not about bigger inputs.

  • Wide multi-number tools: up to 15 numbers and a choice of methods including prime factorisation and the binary algorithm. Strength: breadth. Gap: you pick a method menu before you get an answer, and the quotient-by-quotient Euclidean chain this page prints by default is one option among several rather than the main event.
  • Long-list tools: up to 32 integers in one pasted list, LCM alongside, clear notes on signs and zeros. Strength: list handling. Gap: it answers a different question for a two-number homework problem, and LCM output invites confusion about which value was asked for.
  • List-first tools: comma, space or newline lists with Euclidean steps and a tidy HCF/GCF naming note. Strength: flexible input. Gap: list-first design; a student with exactly two numbers and a steps requirement wades through list syntax they do not need.
  • Simple school tools: clean two-or-three number tool with solved examples. Strength: simplicity for school users. Gap: the tool sits inside a tutoring funnel, and its examples stop at listing common factors rather than showing the division chain.
  • Factorisation-only tools: instant prime-factorisation answers for any pair. Strength: speed. Gap: factorisation only, so the Euclidean method most courses actually teach is never shown, and results arrive pre-baked for indexed number pairs.
  • The gap this page fills: a fixed two-or-three integer tool that prints the full quotient-and-remainder chain every time, states its edge behaviour honestly (zero, negatives, decimal truncation, the silent third field), and keeps the naming straight: GCD, GCF and HCF are the same number.

Frequently asked questions

The greatest common divisor is the largest positive whole number that divides every number in your set with nothing left over. For 48 and 18 the shared divisors are 1, 2, 3 and 6, so the GCD is 6.

Yes. Greatest common divisor, greatest common factor and highest common factor are three names for the same value. US textbooks usually say GCF, UK syllabuses usually say HCF, and number theory usually says GCD.

Divide the larger number by the smaller one and keep the remainder. Then repeat with the smaller number and that remainder. When the remainder reaches 0, the last divisor used is the GCD. The calculator prints every one of those steps under your result.

Yes. Fill in the optional third field and the calculator works in pairs: it finds the GCD of the first two numbers, then finds the GCD of that answer and the third number. Leaving the third field blank calculates the GCD of two numbers.

Signs are ignored, so GCD of -48 and 18 is 6, and the answer is always positive. Zero works with any other number: GCD of 0 and 5 is 5. Entering 0 and 0 returns 0, because every number divides 0, so there is no greatest divisor to report.

Enter whole numbers. The calculator reads each field as an integer, so a decimal entry such as 12.9 is read as 12 before any maths happens. If your problem starts with decimals, scale every number up by the same power of ten first, find the GCD, then scale the answer back down.

It means the numbers are coprime: they share no divisor larger than 1. Coprime pairs such as 8 and 15 still have plenty of factors each, they just have none in common beyond 1. A fraction built from coprime numbers is already in its lowest terms.

No. It returns the GCD and its Euclidean steps only. For two numbers you can get the least common multiple from the GCD with LCM(a, b) = |a x b| / GCD(a, b), so LCM of 48 and 18 is 48 x 18 / 6 = 144.

Add This Calculator to Your Website

Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.

Powered by Calculator Zilo

References

  1. Weisstein, Eric W., Wolfram MathWorld. Greatest Common Divisor. Accessed October 21, 2026.
  2. Weisstein, Eric W., Wolfram MathWorld. Euclidean Algorithm. Accessed October 21, 2026.
  3. Joyce, David E., Clark University. Euclid’s Elements, Book VII, Proposition 2. Accessed October 21, 2026.
  4. Encyclopaedia Britannica. Euclidean algorithm. Accessed October 21, 2026.
  5. O’Connor, John J. and Robertson, Edmund F., MacTutor History of Mathematics, University of St Andrews. Euclid of Alexandria. Accessed October 21, 2026.
  6. National Institute of Standards and Technology, Digital Library of Mathematical Functions. Chapter 27: Functions of Number Theory. Accessed October 21, 2026.

Related calculators

Math CalculatorsStand Alone Calculator: Full-Featured Free ToolA stand alone calculator is a complete calculating tool that runs on its own, right in your browser, with no app to install and no server doing the math for you.Math CalculatorsCosine CalculatorCosine should be the simplest lookup in trigonometry, yet it generates a steady stream of wrong answers,...Math CalculatorsTan Angle Calculator: Free Trigonometry ToolTangent is the workhorse ratio of trigonometry: opposite over adjacent, rise over run, the steepness of an angle turned into a single number.Math CalculatorsPi on Calculator: Formulas, Uses & ResultsIf you typed "pi on calculator" into a search box, you probably want one of two things: the exact buttons...Math CalculatorsSignificant Figures CalculatorA measurement like 0.004567 carries four significant figures while 100 carries only one, and that difference decides whether a lab result is honest or fiction.Math CalculatorsPolynomial CalculatorGive this calculator the coefficients of any single-variable polynomial and a value of x, and it evaluates...

We use cookies to analyze traffic. You can accept or decline cookies below. Learn more

calculatorzilo

CalculatorZilo

Free calculators for everyday life. No signup, no cost, just answers.

Categories

Finance Math Health & Fitness Education Science Real Estate Chemistry Browse all calculators

Popular tools

Mortgage Payment Calculator BMI Walking Calculator Salary Per Minute Calculator Percentage Off Calculator

Company

About Us Contact Us Privacy Policy Terms and Conditions
Disclaimer Cookie Policy DMCA Policy Affiliate Disclosure FAQ Accessibility Statement

© 2026 CalculatorZilo • Free calculators for everyone

  • Home
  • Calculators
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
Search