NathanTools
NathanTools
Text Tools 13
SEO Tools 7
Image Tools 19
YouTube Tools 38
Device Tests 4
PDF Tools 10
Calculators 52
Electrical Calculators 10
Time Tools 7
Random Tools 9
Converters 14
Developer Tools 11
Hash Generators 5
Password & Security 2
Network & DNS 3
Website Tools 9

LCM & GCF Calculator

Enter two or more whole numbers to get their least common multiple and greatest common factor, with prime factors and the working.

100% free No sign-up Works on any device
–GCF (GCD, HCF)
–LCM

Prime factorisation

Euclidean algorithm

    Updated November 2026 · Calculated in your browser

    How to use the LCM and GCF calculator

    1. Type two or more whole numbers, separated by commas or spaces. Very large numbers stay exact.
    2. Read the GCF and LCM at once.
    3. Check the working: each number's prime factors and, for two numbers, every step of the Euclidean algorithm.

    Formulas

    GCF(a, b) = GCF(b, a mod b), until the remainder is 0 LCM(a, b) = |a × b| ÷ GCF(a, b)

    For more than two numbers, apply them one pair at a time: GCF(12, 18, 30) = GCF(GCF(12, 18), 30) = GCF(6, 30) = 6, and LCM(12, 18, 30) = LCM(36, 30) = 180.

    When you need them

    • Simplifying fractions: divide top and bottom by their GCF. 18/24 → GCF 6 → 3/4.
    • Adding fractions: the LCM of the denominators is the lowest common denominator.
    • Scheduling: buses every 12 and 18 minutes leave together every LCM = 36 minutes.
    • Tiling and packing: the largest square tile that fits a 12 × 18 floor exactly is GCF = 6 units.

    Working with fractions? Use the fraction calculator.

    Frequently asked questions

    The greatest common factor (also called the greatest common divisor, GCD, or highest common factor, HCF) is the largest whole number that divides every number in the list with no remainder. The GCF of 12 and 18 is 6.

    The least common multiple is the smallest positive number that every number in the list divides into. The LCM of 4 and 6 is 12. It's the lowest common denominator you need when adding fractions such as 1/4 + 1/6.

    Write each number as a product of primes. The GCF takes each prime that appears in every number, to its lowest power; the LCM takes every prime that appears anywhere, to its highest power. 12 = 2² × 3 and 18 = 2 × 3², so the GCF is 2 × 3 = 6 and the LCM is 2² × 3² = 36.

    For two numbers, LCM × GCF = a × b. So once you know the GCF you can get the LCM: LCM(12, 18) = 12 × 18 ÷ 6 = 36. This doesn't hold for three or more numbers.

    A fast way to find the GCF of two numbers: divide the larger by the smaller, then replace the larger with the remainder and repeat until the remainder is 0. The last non-zero remainder is the GCF. The calculator lists each step.
    All Calculators
    Age Calculator Find your exact age in years, months and days. BMI Calculator Calculate body mass index from height and weight. Loan Calculator Monthly payment, total interest and amortization schedule. Mortgage Calculator Monthly mortgage payment with taxes, insurance and PMI. Time Calculator Add or subtract time, or find the time between two times or dates. Date Calculator Days between two dates, or add and subtract days from a date. Scientific Calculator Trigonometry, logarithms, powers, roots and memory. Percentage Calculator Percent of a number, percentage change, increase and decrease. Tip Calculator Work out the tip and split the bill between friends. GPA Calculator Semester and cumulative GPA, weighted or unweighted. Grade Calculator Weighted course grade and the final exam score you need. Fraction Calculator Add, subtract, multiply and divide fractions with steps. Compound Interest Calculator Grow savings with compound interest and monthly deposits. Car Loan Calculator Monthly car payment with trade-in, sales tax and fees. Calorie Calculator Daily calories to maintain, lose or gain weight. TDEE Calculator Total daily energy expenditure at every activity level. BMR Calculator Basal metabolic rate with three formulas. Macro Calculator Daily protein, carbs and fat in grams for your goal. Body Fat Calculator Body fat % from a tape measure (US Navy method). Due Date Calculator Pregnancy due date and how far along you are. Ovulation Calculator Fertile window and ovulation dates for the next 6 cycles. Inflation Calculator What US dollars are worth across years, 1913 to today. Sales Tax Calculator Add tax to a price, take it out, or find the rate. Discount Calculator Sale price, savings and stacked discounts. Margin Calculator Profit margin, markup and selling price. Concrete Calculator Cubic yards and bags for slabs and post holes. Square Footage Calculator Area of rooms and plots in sq ft and m². Paint Calculator Gallons or litres of paint for a room. Time Card Calculator Weekly hours worked, overtime and pay. Sleep Calculator When to go to bed or wake up, in sleep cycles. Graphing Calculator Plot functions and explore them with pan and zoom. Roman Numeral Converter Convert numbers to Roman numerals and back. Square Root Calculator Square, cube and nth roots, simplified. Ratio Calculator Simplify ratios, solve proportions, split amounts. Average Calculator Mean, median, mode and weighted average. Standard Deviation Calculator Sample and population SD and variance, with steps. Quadratic Formula Calculator Solve ax² + bx + c = 0 with steps and a graph. Percent Error Calculator Percent error and percent difference, with steps. Log Calculator Logarithms in any base, natural log and antilog. Exponent Calculator Powers with negative, fractional and huge exponents. Factorial Calculator Exact n! up to 10,000, double factorial and gamma. Remainder Calculator Quotient and remainder with long division steps. Scientific Notation Calculator Convert and calculate in scientific and E notation. Pythagorean Theorem Calculator Find the hypotenuse or a leg of a right triangle. Trigonometry Calculator sin, cos, tan and inverses in degrees or radians. Complex Number Calculator Add, multiply, divide and convert complex numbers. Exponential Growth Calculator Growth and decay, doubling time and half-life. Multiplication Table Printable times tables up to 30 × 30, plus a quiz. Decimal to Fraction Converter Decimals, fractions and percents, including repeating decimals. Simple Interest Calculator I = P × r × t, solving for any value. APY Calculator APR to APY (effective annual rate) and back.
    Esc
    ↑ ↓ to moveEnter to open