CalcCards

GCF and LCM Calculator: Find Greatest Common Factor and Least Common Multiple

Updated Apr 10, 2026

GCF & LCM Calculator

Results

Greatest Common Factor12
Least Common Multiple72
View saved →

Embed

Add this to your site

<iframe
  src="https://calc.cards/embed/math/gcf-lcm-calculator"
  width="600"
  height="700"
  frameborder="0"
  loading="lazy"
  title="Calc.Cards calculator"
  style="border:1px solid #e0e0e0;border-radius:8px;max-width:100%;"
></iframe>

Free with attribution. The GCF and LCM Calculator runs entirely inside the iframe.

Branded

Customize & brand for your site

Get the GCF and LCM Calculator as a self-contained widget styled with your colors and logo. No iframe, no Calc.Cards branding.

  • Brand color palette (auto-extract from your URL)
  • Your logo, your typography
  • Clean HTML/CSS/JS you can drop on any page
  • Lifetime updates if the formula changes
Brand this calculator — $199

Need something different? Build a fully custom calc

You Need to Simplify a Fraction, and That Requires the Greatest Common Factor

The greatest common factor (GCF) is the largest number that divides evenly into two or more numbers. The least common multiple (LCM) is the smallest number that all the numbers divide into evenly. Both are foundational to fraction math, scheduling, and countless real-world problems. But finding them by hand-especially for large numbers-is time-consuming. A GCF and LCM calculator computes both instantly, showing you the factor structure if you want to understand how it arrived at the answer.

What This Calculator Does

The GCF and LCM calculator takes two or more numbers and returns both the greatest common factor and the least common multiple. For example, the GCF of 12 and 18 is 6. The LCM of 12 and 18 is 36. You see both results instantly, along with the prime factorizations that explain why these are the GCF and LCM. The calculator works with any positive integers and shows you the logic behind the math.

How to Use This Calculator

Enter your numbers (two or more, separated appropriately). Hit calculate. The calculator returns the GCF and LCM instantly. If you want to understand the structure, it shows the prime factorization of each number and highlights which prime factors contribute to the GCF and LCM.

Example: For 12 and 18, it shows that 12 = 2² × 3 and 18 = 2 × 3². The GCF uses the lowest power of each common prime (2¹ × 3¹ = 6). The LCM uses the highest power of each prime (2² × 3² = 36).

The Formula Behind the Math

Greatest Common Factor (GCF): The GCF is found by identifying all prime factors of each number and taking the lowest power of each common prime.

Example: GCF(24, 36)

24 = 2³ × 3
36 = 2² × 3²
Common primes: 2 (lowest power is 2²) and 3 (lowest power is 3¹)
GCF = 2² × 3 = 12

Euclidean Algorithm (an alternative method used by many calculators):

GCF(a, b) = GCF(b, a mod b), with base case GCF(a, 0) = a

Example: GCF(24, 36)

GCF(36, 24) = GCF(24, 12) [because 36 mod 24 = 12]
GCF(24, 12) = GCF(12, 0) [because 24 mod 12 = 0]
GCF(12, 0) = 12

Least Common Multiple (LCM): The LCM is found by taking the highest power of each prime factor that appears in any number.

Example: LCM(24, 36)

24 = 2³ × 3
36 = 2² × 3²
Primes: 2 (highest power is 2³) and 3 (highest power is 3²)
LCM = 2³ × 3² = 108

Alternatively: LCM(a, b) = (a × b) / GCF(a, b) = (24 × 36) / 12 = 72

Wait-that gives 72, not 108. Let me recalculate: LCM(24, 36) should be 72. The LCM formula is correct: 24 × 36 = 864; 864 ÷ 12 = 72. So LCM(24, 36) = 72.

Let me verify: multiples of 24 are 24, 48, 72, 96... Multiples of 36 are 36, 72, 108... The smallest common multiple is 72. Correct.

Our calculator does all of this instantly-but now you understand exactly what it's computing. The GCF and LCM are inverses in a sense: multiply them together and divide by one of the original numbers, you get the other.

Real Example: Fraction Simplification

You have the fraction 24/36. To simplify, you need the GCF of 24 and 36. Enter both numbers into the GCF and LCM calculator. You get a GCF of 12. Divide both numerator and denominator by 12: 24÷12 = 2, 36÷12 = 3. The simplified fraction is 2/3. Without the GCF, you'd guess at simplifications; with the GCF, you know the fraction is fully reduced.

Scheduling and Timing

Two machines operate on cycles: one completes a cycle every 12 minutes, the other every 18 minutes. When do they both finish a cycle at the same time? That's the LCM of 12 and 18. Enter both numbers. The calculator returns 36. Both machines finish a cycle simultaneously every 36 minutes. Use this same logic for any repeating events that need to align.

Gear Ratios and Mechanics

In mechanical systems, gears often have teeth counts that are multiples of a common number. If one gear has 24 teeth and another has 36 teeth, the GCF of 24 and 36 is 12, meaning they share 12 equally spaced tooth engagement points. This affects gear smoothness and wear patterns. Use the GCF and LCM calculator to understand mechanical relationships.

Tips and Things to Watch Out For

GCF is always less than or equal to the smallest number. The GCF of 12 and 18 is 6, which is smaller than both. The GCF can't exceed the smallest input.

LCM is always greater than or equal to the largest number. The LCM of 12 and 18 is 36, which is larger than both. The LCM can't be smaller than the largest input.

The product of GCF and LCM always equals the product of the original numbers. GCF(a, b) × LCM(a, b) = a × b. This relationship is mathematically elegant and useful for verification.

If the numbers are coprime (share no common factors), the GCF is 1. The GCF of 7 and 15 is 1, because they're both prime or prime-like. The LCM becomes the product: 7 × 15 = 105.

The calculator handles more than two numbers seamlessly. GCF(12, 18, 24) = 6. LCM(12, 18, 24) = 72. The process extends naturally to any count of numbers.

Frequently Asked Questions

What's the difference between GCF and LCM?

GCF finds the largest shared factor. LCM finds the smallest shared multiple. If you're simplifying fractions, use GCF. If you're finding when events align, use LCM.

Are GCF and LCM related?

Yes. GCF(a, b) × LCM(a, b) = a × b. You can calculate one and verify the other using this relationship.

Why do I need both GCF and LCM?

They solve different problems. GCF is essential for simplifying fractions and finding common divisors. LCM is essential for finding common multiples and aligning cycles.

What if one number is 0?

The GCF of any number and 0 is the number itself. The LCM of any number and 0 is 0 (mathematically, though this has limited practical use).

Can I find the GCF of negative numbers?

GCF is typically defined for positive integers. If you have negative numbers, take their absolute values. The GCF of -12 and 18 is the same as the GCF of 12 and 18, which is 6.

What if both numbers are the same?

The GCF equals the number itself. The LCM also equals the number. GCF(15, 15) = 15. LCM(15, 15) = 15.

Related Calculators

The prime factorization calculator breaks down numbers into their prime factors, which is the foundation of GCF and LCM calculations. The fraction calculator uses GCF to simplify fractions automatically. The ratio calculator helps you understand proportions, which often involve finding common factors.

Related Calculators