Find the greatest common factor and least common multiple of two integers.
Practice integers →Enter two nonzero whole numbers and press Calculate. Read the greatest common factor (GCF), least common multiple (LCM), and the multiplication used to find the LCM; negative inputs are treated by their absolute values.
The GCF is the largest positive number that divides both inputs without a remainder. The LCM is the smallest positive number that is a multiple of both. The calculator finds the GCF with repeated remainders, then uses LCM = (first number ÷ GCF) × second number.
For 12 and 18, the greatest shared factor is 6. LCM = (12 ÷ 6) × 18 = 36, so 36 is the first positive number in both multiplication tables.
For 8 and 15, no factor above 1 divides both, so the GCF is 1. LCM = (8 ÷ 1) × 15 = 120.
Yes. Greatest common factor, greatest common divisor, and highest common factor name the same positive number.
The LCM of two denominators is their least common denominator. For denominators 12 and 18, use 36 to rewrite both fractions before adding or subtracting.
No. This calculator requires nonzero safe integers. Negative inputs are accepted as absolute values, so −12 and 18 give the same results as 12 and 18.
Even safe integer inputs can produce an LCM outside JavaScript’s exact integer range. The calculator rejects that result rather than claiming an exact rounded number.
Use Prime Factorization to see the prime building blocks of each number, or the Fraction Calculator to apply common factors and denominators. The integers lesson builds the underlying number skills. Related tools: Prime Factorization Calculator, Fraction Calculator. Read the Integers & Negative Numbers lesson or practice integers & negative numbers to build confidence without relying on a calculator.