Calcumia

GCF and LCM Calculator

This free GCF and LCM calculator instantly computes the greatest common factor and least common multiple for any set of positive integers. Whether you are simplifying fractions, solving algebra equations, or scheduling recurring events, our tool provides quick, step-by-step mathematical solutions. It is designed for students, educators, and anyone needing fast and accurate number theory calculations.

Your inputs

Result

Greatest common factor (GCF)
—
Least common multiple (LCM)
—

Add this calculator to your site — free

Copy one of the snippets into your page. Please keep the attribution link visible.

How to use the GCF and LCM Calculator

  1. Enter two or more positive whole numbers into the Numbers (comma separated) field.
  2. Separate each integer with a comma (for example: 12, 18, 30).
  3. Click the calculate button to process the numbers.
  4. View your Greatest common factor (GCF) and Least common multiple (LCM) in the results section.

How it works

The greatest common factor (GCF or GCD) represents the largest integer that divides evenly into all specified numbers, essential for simplifying ratios and reducing fractions to lowest terms. Conversely, the least common multiple (LCM) represents the smallest positive integer that is divisible by all numbers in the group, serving as the lowest common denominator when adding or subtracting fractions. Together, for example, the numbers 12, 18, and 30 yield a GCF of 6 and an LCM of 180.

To determine these values efficiently, mathematicians rely on Euclidean algorithm principles documented in Euclid's Elements, which compute the GCF through successive divisions using remainders. Once the GCF of two values is established, their LCM is derived via the fundamental mathematical relation LCM(a, b) equals the product of a and b divided by their GCF. When evaluating three or more numbers, this formula is applied iteratively across each successive pair until all integers are accounted for.

The tool operates on positive whole numbers. Zero or negative integers are typically excluded because division by zero is undefined and factors are traditionally evaluated using natural numbers. For optimal speed and precision, enter your values separated cleanly by commas without extra symbols. Remember that if two numbers share no common factors other than one, they are coprime, meaning their GCF is 1 and their LCM is simply their direct product.

Formula

LCM(a, b) = a × b ÷ GCF(a, b)

Worked example

GCF(12, 18, 30) = 6 and LCM = 180.

GCF and LCM Calculator: a closer look

The greatest common factor (GCF, also called GCD or HCF) is the largest number that divides every number in your list without a remainder. The least common multiple (LCM) is the smallest number that all of them divide into. Together they are the tools behind simplifying fractions, adding fractions and solving repeating-schedule puzzles.

How the calculation works

The calculator uses Euclid's algorithm, which repeatedly replaces the larger number by the remainder of dividing it by the smaller one until the remainder is zero; the last non-zero value is the GCF. The LCM of two numbers is then a × b ÷ GCF(a, b), and for more than two numbers the calculator applies this step by step along the list. Enter positive whole numbers separated by commas.

GCF(a, b): gcd(a, b) = gcd(b, a mod b)        LCM(a, b) = a × b ÷ GCF(a, b)

Worked example 1: Euclid's algorithm by hand

GCF of 48 and 180: 180 = 3 × 48 + 36; 48 = 1 × 36 + 12; 36 = 3 × 12 + 0. The last non-zero remainder is 12, so GCF = 12 and LCM = 48 × 180 ÷ 12 = 720. That also simplifies 48/180 to 4/15.

Worked example 2: Adding fractions and scheduling

1/12 + 1/18 needs a common denominator: LCM(12, 18) = 36, so it is 3/36 + 2/36 = 5/36. In the same way, two buses that leave every 12 and 18 minutes leave together again every 36 minutes.

Related calculators and converters

Frequently asked questions

What is the difference between GCF and LCM?+

The greatest common factor (GCF) is the highest number that divides evenly into all given values, used primarily to simplify fractions. The least common multiple (LCM) is the smallest positive number that all given numbers divide into, commonly used to find common denominators.

What formula links the GCF and the LCM?+

For any two positive integers a and b, the relationship is defined by the formula LCM(a, b) = (a × b) ÷ GCF(a, b). This means the product of two numbers always equals the product of their greatest common factor and least common multiple.

What is the GCF used for in practical math?+

The GCF is most frequently used to reduce fractions to their simplest form by dividing both the numerator and denominator by their greatest divisor. It is also used to factor polynomial expressions and partition objects into equal groups without remainders.

What is the LCM used for in real-world problems?+

The LCM is essential when adding or subtracting fractions with unlike denominators, where it serves as the lowest common denominator. It is also used in real-world scheduling to find when repeating cyclical events will coincide or align simultaneously.

Can this calculator find the GCF and LCM of three or more numbers?+

Yes. The calculator processes multiple numbers sequentially. For instance, with 12, 18, and 30, the tool evaluates pairwise relationships to find that the shared greatest common divisor is 6, while the smallest multiple shared by all three is 180.

Is GCF × LCM always equal to the product of the numbers?+

Only for exactly two numbers: GCF(a, b) × LCM(a, b) = a × b. For three or more numbers the shortcut does not hold, so use the calculator for the whole list.

What if the numbers share no common factor?+

Then the GCF is 1 and the numbers are called coprime. For 8 and 15 the GCF is 1 and the LCM is 120, simply their product.

Can I use it to simplify a fraction?+

Yes. Divide the numerator and denominator by their GCF. For 48/180 the GCF is 12, which gives 4/15, a fraction that cannot be reduced further.

✓ Written and reviewed by the Calcumia editorial team · Last updated: · How we build and check our calculators

Results are estimates for information only and are not financial, medical or legal advice.