GCD & LCM Calculator

Find the greatest common divisor and least common multiple of a list of numbers.

Separate whole numbers with commas or spaces.
Greatest common divisor (GCD) —
Least common multiple (LCM) —
Shin, kanã son ka ƙõne? —

Results update as you type.

Shin wannan Kalkulator ya ba ka amsa madaidaiciya?

Game da wannan Kalkulator

This calculator finds the greatest common divisor (GCD) — the largest number that divides all your values evenly — and the least common multiple (LCM), the smallest number they all divide into. Enter two or more whole numbers separated by commas or spaces and it also tells you whether they are coprime.

The GCD is found with the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing the two until one becomes zero; the other is the GCD. The LCM is then built up pairwise using LCM = a × b ÷ GCD. For 12, 18 and 24 the greatest common divisor is 6 and the least common multiple is 72. When the GCD is 1 the numbers share no common factor and are called coprime.

The GCD is what you use to reduce a fraction to lowest terms, while the LCM gives the common denominator for adding fractions and the period at which repeating cycles line up. The result is the same no matter what order you enter the numbers in.

Tambayoyi da ake yi da yawa

Ta yaya ake kimanta GCD?

%s: An yi amfani da algorithm na Euclid: ana sake maye gurbin mafi girman adadin da sauran rabawa biyu, har ɗaya ta zama sifar. Wata kuma ita ce GCD.

Ta yaya GCD da LCM suke dangantaka?

Ga adadin biyu, GCD × LCM = nasarar adadin. Saboda haka LCM = a × b ÷ GCD, wanda shi ne yadda kayan aiki ke faɗaɗa LCM a kan jerin gaba ɗaya.

Mẽne ne coprime?

Lamba biyu ko fiye suna da farkon farko idan mafi girman rabawa na su shi ne 1 - ba su raba wani ma'aunin da yafi 1 ba. Kifi na nuna wannan ga kai.

Shin zan iya shigar da fiye da lambobin biyu?

Na'am. Ka raba ƙididdiga da koma ko da faɗi kuma za'a ƙididdige GCD da LCM a cikin jerin gaba ɗaya.

Mẽne ne GCD da LCM na 12, 18 da 24?

Kuma mafi girman mai raba sau biyu shi ne 6, kuma mafi ƙarancin mai raba sau biyu shi ne 72.

Does the order of the numbers matter?

No. Both the GCD and the LCM are the same regardless of the order you type the numbers in.

❤️ Love Calculator.Free? Share

𝕏  X Facebook Reddit
API — amfani da wannan calculator daga code

Ka kira wannan kwalban kamar wata maɓallin ƙarshe JSON mai kyauta - babu maɓalli da ake buƙata. Ka aika kimar fannin ƙasa kamar paramita na tambaya ko JSON. Anything you omit uses the same default this page is pre-filled with; an unknown parameter is a 400, never a silent zero. Read the full API docs →

Endpoint

GET https://calculator.free/api/v1/gcd-lcm/

curl

curl "https://calculator.free/api/v1/gcd-lcm/?numbers=12, 18, 24"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/gcd-lcm/?" + new URLSearchParams({
    "numbers": "12, 18, 24"
  }));
const data = await r.json();
console.log(data.results);

Results are estimates for general guidance only, not financial, medical or tax advice.