GCD and LCM calculator

The Euclidean algorithm finds the GCD in a handful of steps even for very large integers, and the LCM follows from it.

Greatest common divisor
12
= Exact GCD and LCM
Least common multiple
720
Product of the two
8640
First divided by the GCD
4
Second divided by the GCD
15
Coprime 1 when the only common factor is 1.
0
Show the working
  1. First integer = 48
  2. Second integer = 180
  3. Greatest common divisor = gcd(48, 180) = 12
  4. Least common multiple = lcm(48, 180) = 720
  5. Product of the two = abs(48 * 180) = 8640
  6. Coprime = 12 == 1 ? 1 : 0 = 0
  7. First divided by the GCD = 12 != 0 ? 48 / 12 : 0 = 4
  8. Second divided by the GCD = 12 != 0 ? 180 / 12 : 0 = 15

Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.

Scenarios & local history

Compare a saved scenario

Recent calculations

    The formula

    • gcd(a,b) x lcm(a,b) = |a x b|

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library