LCM and GCF calculator
Exact whole-number maths in this tab. Nothing is uploaded.
- Greatest common factor (GCF)
- 6
- Least common multiple (LCM)
- 180
By prime factors
- 12 = 2² × 3
- 18 = 2 × 3²
- 30 = 2 × 3 × 5
- GCF = 2 × 3 = 6 — each shared prime at its lowest power
- LCM = 2² × 3² × 5 = 180 — each prime at its highest power
Euclid's algorithm
How to use this tool
Find the least common multiple and greatest common factor of several numbers. Nothing is uploaded.
Open LCM and GCF calculator
Type 2 to 20 whole numbers separated by commas or spaces.
Read the GCF and LCM
Both appear at once, and the page says when the numbers are coprime (GCF 1).
Follow the working
Each number's prime factors show how the GCF and LCM are built. For two numbers, Euclid's algorithm is shown step by step.
FAQ
How do I find the LCM and GCF?
Type two or more whole numbers separated by commas or spaces. The least common multiple (LCM) and greatest common factor (GCF) appear at once, with the working.
Is GCF the same as GCD or HCF?
Yes. Greatest common factor (GCF), greatest common divisor (GCD) and highest common factor (HCF) are three names for the largest number that divides all of them.
How do prime factors give the LCM and GCF?
Factor each number into primes. The GCF takes each prime that is in every number, at its lowest power; the LCM takes every prime at its highest power. For 12, 18 and 30: GCF = 2 × 3 = 6, LCM = 2² × 3² × 5 = 180.
What is Euclid's algorithm?
For two numbers, divide the larger by the smaller and keep the remainder; repeat with the smaller number and the remainder until the remainder is 0. The last divisor is the GCF. The page shows each step.
When do I need the LCM?
To add fractions (the LCM of the denominators is the lowest common denominator) and to find when repeating events line up, such as buses every 12 and 18 minutes meeting every 36 minutes.