Learntrix
Step-by-Step Prime Factorization · Free & Instant

LCM & GCF / HCF Calculator

Find the Greatest Common Factor (GCF / HCF) and Least Common Multiple (LCM) for any set of positive integers with complete prime factor trees and Euclidean algorithm steps.

Supports 2 to 6 numbers (e.g. 24, 36, 48, 60).
Try Common Examples:
Greatest Common Factor (GCF / HCF)

6

The largest number dividing 12, 18, 30 evenly without remainder.

Least Common Multiple (LCM)

180

The smallest positive multiple shared by all input values.

Input numbers: 12, 18, 30100% Exact
Advertisement
Prime Factorization Breakdown

Step-by-Step Prime Factors for 12, 18, 30

Every composite number has a unique representation as a product of prime powers (Fundamental Theorem of Arithmetic).

Number
12
2^2 × 3
Number
18
2 × 3^2
Number
30
2 × 3 × 5
How GCF (6) is derived:

Take the lowest power of prime factors that appear in every number. Multiplying these common prime powers yields exactly 6.

How LCM (180) is derived:

Take the highest power of every prime factor present across any number. Multiplying these maximal powers produces 180.

Euclidean Division Algorithm Steps for (12, 18):

StepDivision Equation (a = b × q + r)Remainder
Step 118 = 12 × 1 + 66
Step 212 = 6 × 2 + 00 ← Last Non-Zero Divisor is GCF
Fundamental Number Theory · Mathematical Rigor

Comprehensive Guide to Greatest Common Factor & Least Common Multiple

Master the mathematical mechanics, formulas, and computational algorithms for factoring numbers in algebra, engineering, and daily calculations.

What is the Greatest Common Factor (GCF / HCF)?

The Greatest Common Factor (GCF), universally referred to as the Highest Common Factor (HCF) or Greatest Common Divisor (GCD), is the largest positive integer that divides evenly into two or more numbers with zero remainder. For instance, the factors of 12 are 1, 2, 3, 4, 6, and 12, while the factors of 18 are 1, 2, 3, 6, 9, and 18. Their shared common factors are 1, 2, 3, and 6. Among these, the largest value is 6, making GCF(12, 18) = 6.

The Three Reliable Methods for Calculating GCF

1. Prime Factorization

Decompose every number into its prime building blocks. Write each number in prime exponent form. The GCF is the product of prime factors common to all numbers, each raised to its lowest exponent.

2. Euclidean Algorithm

First formulated by Greek mathematician Euclid in 300 BCE. Divide the larger integer by the smaller integer. Replace the larger integer with the divisor, and the smaller integer with the remainder. Repeat until the remainder reaches zero.

3. Listing All Factors

Ideal for smaller integers under 100. Write out every divisor pair for each number, circle the intersection set, and select the highest circled number.

The Fundamental Formula Connecting LCM and GCF

For any pair of positive integers a and b, their product is mathematically identical to the product of their Greatest Common Factor and Least Common Multiple:

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

This relationship allows you to immediately compute the LCM once the GCF has been found via Euclidean division, running in logarithmic time complexity O(log min(a, b)).

Real-World Practical Applications

  • Simplifying Algebraic Fractions: Dividing both numerator and denominator by their GCF reduces any fraction to its irreducible simplest form in a single step (e.g. 48/64 ÷ 16/16 = 3/4).
  • Tiling and Spatial Design: Calculating the largest square tile size required to pave a rectangular floor (e.g. 12m × 18m) without cutting any tiles corresponds directly to GCF(12, 18) = 6 meters.
  • Gear Ratio Alignment and Periodic Events: Finding when two mechanical gears of different tooth counts will return to their starting alignment relies on their Least Common Multiple (LCM).
Advertisement
For Educational Purposes Only

Results are provided for general informational and educational reference only. While we strive for accuracy, Learntrix makes no guarantee of the correctness or completeness of these results for any specific purpose. Actual figures may differ based on your circumstances. Do not rely solely on these results for any significant decision.

Learntrix · Accuracy not guaranteed · For reference only