GCF Calculator – Greatest Common Factor

Enter two or more whole numbers to find their greatest common factor (GCF), also called the greatest common divisor (GCD) or highest common factor (HCF). The calculator shows the prime factorization method, the Euclidean algorithm step by step, and the full list of factors your numbers share. It handles very large numbers exactly.

Two or more integers, separated by commas or spaces. Example: 48, 180, 600
Try an example
12GCF of 48, 180, 600
GCF (GCD)12
Common factors6
Numbers3
Coprime?No
All common factors

Method 1: prime factorization
    Method 2: Euclidean algorithm

      Runs entirely in your browser. Nothing you enter is uploaded or stored.

      Rate this tool

      Be the first to rate this tool

      How to use the GCF Calculator

      1. Type two or more whole numbers, separated by commas or spaces, or tap an example.
      2. Read the greatest common factor at the top, along with how many factors the numbers share.
      3. Check the prime factorization and Euclidean algorithm steps to see how the answer was found.
      4. Copy the result with its working if you need it for homework or notes.

      What is the greatest common factor?

      The greatest common factor of a set of whole numbers is the largest number that divides all of them with no remainder. The factors of 12 are 1, 2, 3, 4, 6 and 12, and the factors of 18 are 1, 2, 3, 6, 9 and 18. The factors they share are 1, 2, 3 and 6, so the GCF of 12 and 18 is 6. You will also see it called the greatest common divisor (GCD) or the highest common factor (HCF); all three names mean the same thing. Every common factor of a set of numbers is also a factor of their GCF, which is why the calculator can list all of them from the GCF alone.

      Method 1: prime factorization

      Break each number into prime factors, then multiply the primes that appear in every number, each raised to the lowest power it has in any of them. For 48, 180 and 600: 48 = 2⁴ × 3, 180 = 2² × 3² × 5, and 600 = 2³ × 3 × 5². The primes common to all three are 2 and 3. The lowest power of 2 is 2² and the lowest power of 3 is 3¹, so the GCF is 2² × 3 = 12. The prime 5 is left out because 48 does not contain it. This method is easy to follow by hand for small numbers and shows clearly why the answer is what it is.

      Method 2: the Euclidean algorithm

      For larger numbers, factoring gets slow, but Euclid’s algorithm stays fast. Divide the larger number by the smaller one and keep the remainder. Then divide the smaller number by that remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF. For 1071 and 462: 1071 = 2 × 462 + 147, then 462 = 3 × 147 + 21, then 147 = 7 × 21 + 0, so the GCF is 21. With three or more numbers, find the GCF of the first two, then the GCF of that result and the next number, and so on. This calculator uses exact big-integer arithmetic, so it works for numbers with dozens of digits without rounding errors.

      Where the GCF is useful

      The most common use is simplifying fractions: divide the top and bottom by their GCF to get lowest terms in one step, so 48/180 becomes 4/15 after dividing both by 12. The same idea simplifies ratios, which you can do with the ratio calculator. The GCF also answers practical questions, such as the largest square tile that fits a 48 by 180 inch floor exactly, or the greatest number of identical gift bags you can make from 84 pencils, 126 erasers and 210 stickers (42 bags). Numbers whose GCF is 1, like 35 and 64, are called coprime or relatively prime: they share no prime factors at all, even though neither has to be prime itself.

      GCF and LCM together

      The GCF is closely linked to the least common multiple. For any two positive integers, GCF × LCM equals the product of the numbers: for 12 and 18, 6 × 36 = 216 = 12 × 18. That makes it quick to find one from the other. To find the smallest number that two or more numbers all divide into, such as a common denominator, use the LCM calculator. A few edge cases: negative numbers have the same GCF as their absolute values, the GCF of any number and 0 is the number itself, and the GCF of 0 and 0 is undefined.

      Examples

      • 12, 18 → GCF 6 (common factors 1, 2, 3, 6)
      • 48, 180, 600 → GCF 12
      • 1071, 462 → GCF 21 by the Euclidean algorithm
      • 35, 64 → GCF 1, so the numbers are coprime

      GCF Calculator FAQ

      Is GCF the same as GCD and HCF?

      Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number: the largest whole number that divides all the given numbers exactly.

      How do you find the GCF of three or more numbers?

      Find the GCF of the first two numbers, then find the GCF of that result and the third number, and continue through the list. The calculator does this automatically and shows each Euclidean step.

      What is the GCF of two prime numbers?

      If the primes are different, their GCF is 1, because a prime’s only factors are 1 and itself. If both numbers are the same prime, the GCF is that prime.

      Can the GCF be larger than the smallest number?

      No. The GCF must divide the smallest number, so it can be at most that number. It equals the smallest number when that number divides all the others, such as GCF(6, 18, 24) = 6.

      Does the calculator work with negative numbers or zero?

      Yes. Negative numbers are treated by their absolute value, and 0 is ignored in the sense that GCF(n, 0) = n. If every number is 0, the GCF is undefined.

      Related tools

      All Calculators
      Age CalculatorFind your exact age in years, months and days.BMI CalculatorCalculate body mass index in metric or imperial units.Percentage CalculatorSolve percent of, percent change and increase/decrease problems.EMI CalculatorWork out monthly loan payments, interest and a full schedule.Hours to Decimal ConverterConvert hours and minutes to decimal hours and back, with a timesheet.Age Difference CalculatorFind the exact age gap between two people in years, months and days, plus total days and weeks, who is older and each person’s current age.Aspect Ratio CalculatorFind the missing width or height for any ratio, and simplify any resolution like 1920 × 1080 to 16:9.Birthday CalculatorFind the day of the week you were born, your exact age, a countdown to your next birthday, your zodiac sign and half-birthday.Calorie CalculatorEstimate your BMR and daily calorie needs, with targets for losing, maintaining or gaining weight.Days Between DatesCount the days between two dates in days, weeks, months and years, plus business days without weekends and US holidays.Discount CalculatorFind the sale price and how much you save from a percent or dollar discount, including stacked extra % off deals.Etsy Fee and Profit CalculatorCalculate Etsy listing, transaction, payment, and offsite ad fees plus net profit.GPA CalculatorAdd your courses, grades and credits to calculate your GPA instantly.Hourly to Salary CalculatorConvert an hourly wage to annual, monthly, biweekly, weekly and daily pay, with overtime – or turn a salary into an hourly rate.LCM CalculatorFind the least common multiple of two or more whole numbers, with prime factorization, listing multiples and the GCF formula.Loan CalculatorWork out the monthly payment, total interest and payoff date for any loan in seconds.Mortgage CalculatorEstimate your monthly mortgage payment with principal, interest, taxes and insurance, plus the total interest over the loan.Percentage Increase CalculatorFind the percent increase or decrease between two numbers, raise or lower a value by a percent, or work back to the original.Pregnancy CalculatorEstimate your due date, current week and trimester from the first day of your last period.Ratio CalculatorSolve A:B = C:D for a missing value, simplify ratios (decimals too), split an amount by a ratio, and turn ratios into fractions and percents.Sales Tax CalculatorAdd sales tax to a price or work backward from a total to find the pre-tax price and the tax paid.Scientific CalculatorA full scientific calculator with trig, logs, powers and roots, evaluated safely in your browser.Standard Deviation CalculatorPaste a list of numbers to get the sample or population standard deviation, variance, mean, median and range, with a step-by-step table.Stripe Fee CalculatorCalculate Stripe card fees and find the exact invoice amount to receive your target net.TikTok Creator Rewards CalculatorEstimate TikTok Creator Rewards earnings from views, qualified view rate, and RPM.JSON to ExcelConvert a JSON array to a real Excel .xlsx spreadsheet or CSV, with nested objects flattened into dot-named columns and a live preview.Character CounterCount characters with and without spaces, with social media limits.