Skip to content
LunaCalc

Math

GCF and LCM Calculator

Compute GCF and LCM for one or more integers.

About this calculator

This GCF and LCM calculator finds the greatest common factor and least common multiple of a list of integers using prime factorization.

Formula notes

GCF is the product of the lowest powers of shared primes; LCM is the product of the highest powers across all numbers. GCF × LCM = a × b for two numbers.

Worked examples

  1. Example: 12 and 18 share factors 2 and 3, so GCF = 6 and LCM = 36.
  2. For 18, 24, and 30, the greatest common factor is 6 and the least common multiple is 360.

How to use it

  1. Enter two or more positive integers separated by commas.
  2. Read the GCF for simplification problems.
  3. Read the LCM for common-denominator or scheduling problems.

Frequently asked questions

When would I use GCF instead of LCM?

Use GCF to simplify fractions or split items into equal groups; use LCM to sync repeating events.

Can I enter more than two numbers?

Yes, the calculator extends the same prime-factor logic across the whole list.

Limits and interpretation

  • Inputs are treated as integers; decimals must be transformed according to the actual problem before using integer GCF or LCM.
  • Zero and negative values require a stated convention, especially because an LCM involving zero is commonly defined as zero.

References