🔢 GCF & LCM Calculator
Find the greatest common factor and least common multiple of two or more numbers, with prime factorizations.
How the GCF & LCM Calculator Works
Enter two or more positive whole numbers. The calculator finds:
- the GCF (greatest common factor, also called GCD or HCF) — the largest number that divides all of them exactly, used to simplify fractions;
- the LCM (least common multiple) — the smallest number that all of them divide into, used to find common denominators and to solve "when will these events line up again?" problems.
It also shows the prime factorization of each number. The GCF takes each shared prime at its lowest power; the LCM takes every prime at its highest power.
Formula
GCF(a, b): Euclid's algorithm — replace (a, b) with (b, a mod b) until b = 0; the GCF is a LCM(a, b) = a × b / GCF(a, b) For more numbers: GCF(a, b, c) = GCF(GCF(a, b), c) and LCM(a, b, c) = LCM(LCM(a, b), c)
How to Use It
- Enter two or more positive whole numbers separated by commas or spaces.
- Read the GCF and LCM.
- Check the prime factorization of each number to see how the results are built.
Frequently Asked Questions
What is the difference between GCF and LCM?
The GCF is the largest number that divides all the given numbers; the LCM is the smallest number that all the given numbers divide into. For 12 and 18: GCF = 6 and LCM = 36.
Are GCF, GCD, and HCF the same thing?
Yes. Greatest common factor (GCF), greatest common divisor (GCD), and highest common factor (HCF) are three names for the same value; the name used depends on the country and textbook.
What is the LCM used for?
It gives the lowest common denominator when adding fractions, and it answers repetition problems — for example, two buses leaving every 12 and 18 minutes leave together again every 36 minutes.
Related Calculators
- ➗ Fraction Calculator — Add, subtract, multiply, and divide fractions and mixed numbers, with steps.
- 📊 Average Calculator (Mean, Median, Mode) — Get the mean, median, mode, range, and sum of any list of numbers.
- Ⅻ Roman Numeral Converter — Convert between numbers and Roman numerals in either direction.
- 🎲 Random Number Generator — Unbiased random numbers in any range, with or without repeats.
Formula and content last reviewed: September 2026. All calculations run in your browser — nothing you enter is sent to or stored on our servers.
More Education calculators
See all →✔ Reviewed by GelirLab Editöryal Ekibi · Last reviewed: September 2026 · How we check our calculators