Skip to main content

Greatest Common Factor Calculator

Find the GCF (GCD) of two or more numbers using prime factorization and Euclidean algorithm. Enter values for instant results with step-by-step formulas.

Skip to calculator
Mathematics

Greatest Common Factor Calculator

Find the GCF (GCD) of two numbers using the Euclidean algorithm and prime factorization. See step-by-step solutions, all common factors, and the related LCM.

Last updated: December 2025Reviewed by NovaCalculator Mathematics Team

Calculator

Adjust values & calculate
48
36
Greatest Common Factor
12
GCF(48, 36)
LCM
144
Coprime?
No

Euclidean Algorithm Steps

48 = 36 x 1 + 12
36 = 12 x 3 + 0
Prime Factors of 48
2 x 2 x 2 x 2 x 3
Prime Factors of 36
2 x 2 x 3 x 3
Common Factors
1234612
Fraction Simplification: 48/36 = 4/3
Your Result
GCF(48, 36) = 12 | LCM = 144 | Not Coprime
Share Your Result
Understand the Math

Formula

GCF(a, b) via Euclidean: a = b x q + r, repeat until r = 0

The Euclidean algorithm repeatedly divides the larger number by the smaller, replacing the larger with the remainder, until the remainder is zero. The last non-zero remainder is the GCF. Alternatively, GCF equals the product of common prime factors raised to their minimum powers. LCM(a,b) = (a x b) / GCF(a,b).

Last reviewed: December 2025

Worked Examples

Example 1: GCF of 48 and 36 Using Euclidean Algorithm

Find the GCF of 48 and 36, and use it to simplify the fraction 48/36.
Solution:
Euclidean Algorithm: 48 = 36 x 1 + 12 36 = 12 x 3 + 0 GCF = 12 Prime Factorization: 48 = 2^4 x 3 36 = 2^2 x 3^2 Common: 2^2 x 3 = 12 Simplify 48/36: divide both by 12 = 4/3 LCM = (48 x 36) / 12 = 144
Result: GCF(48, 36) = 12 | LCM = 144 | 48/36 simplifies to 4/3

Example 2: GCF of 105 and 252

Find the GCF of 105 and 252 using the Euclidean algorithm and list all common factors.
Solution:
252 = 105 x 2 + 42 105 = 42 x 2 + 21 42 = 21 x 2 + 0 GCF = 21 105 = 3 x 5 x 7 252 = 2^2 x 3^2 x 7 Common factors: 1, 3, 7, 21 LCM = (105 x 252) / 21 = 1260
Result: GCF(105, 252) = 21 | Common factors: 1, 3, 7, 21 | LCM = 1260
Expert Insights

Background & Theory

The Greatest Common Factor Calculator applies the following established principles and formulas. Mathematics rests on a hierarchy of number systems, each extending the previous. The natural numbers (1, 2, 3, ...) support counting and ordering. The integers add negative values and zero, enabling subtraction without restriction. The rational numbers, expressible as p/q where p and q are integers and q is nonzero, close the system under division. The real numbers fill the gaps left by irrationals such as the square root of 2 or pi, forming a complete ordered field. The complex numbers, written as a + bi where i is the square root of negative one, complete the algebraic closure of the reals and allow every polynomial to have a root. Prime factorization states that every integer greater than one is uniquely expressible as a product of primes, a result known as the Fundamental Theorem of Arithmetic. Computing the greatest common divisor (GCD) of two integers relies most efficiently on the Euclidean algorithm: repeatedly replace the larger number with the remainder when it is divided by the smaller, until the remainder is zero. The last nonzero remainder is the GCD. The least common multiple (LCM) follows from the identity LCM(a, b) = |a * b| / GCD(a, b). Modular arithmetic defines equivalence classes of integers that share the same remainder under division by a modulus n. Fermat's Little Theorem and Euler's Theorem arise from this structure and underpin modern cryptography. Logarithms are the inverses of exponential functions. If b raised to the power x equals y, then the logarithm base b of y equals x. The natural logarithm uses base e, approximately 2.71828. Combinatorics counts arrangements and selections. The number of ordered arrangements (permutations) of r objects from n distinct objects is nPr = n! / (n - r)!. The number of unordered selections (combinations) is nCr = n! / (r! * (n - r)!). Pascal's triangle arranges these binomial coefficients so that each entry equals the sum of the two entries directly above it. The Fibonacci sequence, defined by F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2), appears throughout nature and connects deeply to the golden ratio via Binet's formula.

History

The history behind the Greatest Common Factor Calculator traces back through the following developments. Mathematics as a systematic discipline traces to ancient Mesopotamia. Babylonian clay tablets dating to around 1800 BCE demonstrate knowledge of quadratic equations, Pythagorean triples, and base-60 arithmetic, suggesting a practical mathematical tradition far preceding Greek formalism. Euclid of Alexandria compiled the Elements around 300 BCE, establishing the axiomatic method that would define rigorous mathematics for over two thousand years. His work organized plane geometry, number theory, and proportion into logically chained propositions derived from a small set of postulates. The algorithm bearing his name for computing GCDs appears in Book VII and remains in use today. In the 9th century, the Persian scholar Muhammad ibn Musa Al-Khwarizmi wrote Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, the treatise whose title gave algebra its name. He systematized the solution of linear and quadratic equations and described procedures that operated on unknowns as objects, a conceptual leap away from purely numerical calculation. Rene Descartes introduced coordinate geometry in 1637 by uniting algebra and Euclidean geometry, allowing curves to be studied through equations. This synthesis set the stage for calculus. Isaac Newton and Gottfried Wilhelm Leibniz independently developed calculus during the 1660s and 1670s, triggering a priority dispute that lasted decades and divided British and Continental mathematicians. Carl Friedrich Gauss proved the Fundamental Theorem of Algebra in 1799, showing that every nonconstant polynomial has at least one complex root. His Disquisitiones Arithmeticae of 1801 established modern number theory. David Hilbert's formalist program at the turn of the 20th century sought to place all of mathematics on an explicit axiomatic foundation, a project that Kurt Godel's incompleteness theorems of 1931 showed to be fundamentally limited. Alan Turing's work in the 1930s on computability introduced the theoretical model of the stored-program computer and linked mathematical logic directly to the limits of algorithmic calculation. His proof that no algorithm can decide in general whether an arbitrary program will halt or run forever placed fundamental boundaries on what mathematics can mechanically determine, and it opened the discipline now known as theoretical computer science.

Share this calculator

Explore More

Frequently Asked Questions

The Greatest Common Factor (GCF), also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF), is the largest positive integer that divides two or more numbers without leaving a remainder. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 evenly. The GCF is always at least 1, since 1 divides every integer. Two numbers whose GCF is 1 are called coprime or relatively prime. The GCF is a fundamental concept in number theory and has practical applications in simplifying fractions, solving Diophantine equations, and in cryptographic algorithms like RSA encryption.
You may use the results for reference and educational purposes. For professional reports, academic papers, or critical decisions, we recommend verifying outputs against peer-reviewed sources or consulting a qualified expert in the relevant field.
All calculations use established mathematical formulas and are performed with high-precision arithmetic. Results are accurate to the precision shown. For critical decisions in finance, medicine, or engineering, always verify results with a qualified professional.
No. All calculations run entirely in your browser using JavaScript. No data you enter is ever transmitted to any server or stored anywhere. Your inputs remain completely private.
The Formula section on this page shows the equation used. You can reproduce the calculation manually or in a spreadsheet using those steps. Compare your answer against the worked examples in the Examples section, which use known reference values so you can confirm the calculator is behaving as expected.
Enter values as precisely as possible using the correct units for each field. Check that you have selected the right unit (e.g. kilograms vs pounds, meters vs feet) before calculating. Rounding inputs early can reduce output precision.
Educational Note: This calculator is provided for educational and informational purposes. Results are based on the formulas and inputs provided. Always verify important calculations independently. NovaCalculator processes calculator inputs client-side; optional analytics follow visitor consent settings.Reviewed by: NovaCalculator Mathematics Team โ€” Verified against standard mathematical and scientific references. Last reviewed: December 2025. ยฉ 2024โ€“2026 NovaCalculator.

Share this calculator

Formula

GCF(a, b) via Euclidean: a = b x q + r, repeat until r = 0

The Euclidean algorithm repeatedly divides the larger number by the smaller, replacing the larger with the remainder, until the remainder is zero. The last non-zero remainder is the GCF. Alternatively, GCF equals the product of common prime factors raised to their minimum powers. LCM(a,b) = (a x b) / GCF(a,b).

Worked Examples

Example 1: GCF of 48 and 36 Using Euclidean Algorithm

Problem: Find the GCF of 48 and 36, and use it to simplify the fraction 48/36.

Solution: Euclidean Algorithm:\n48 = 36 x 1 + 12\n36 = 12 x 3 + 0\nGCF = 12\n\nPrime Factorization:\n48 = 2^4 x 3\n36 = 2^2 x 3^2\nCommon: 2^2 x 3 = 12\n\nSimplify 48/36: divide both by 12 = 4/3\nLCM = (48 x 36) / 12 = 144

Result: GCF(48, 36) = 12 | LCM = 144 | 48/36 simplifies to 4/3

Example 2: GCF of 105 and 252

Problem: Find the GCF of 105 and 252 using the Euclidean algorithm and list all common factors.

Solution: 252 = 105 x 2 + 42\n105 = 42 x 2 + 21\n42 = 21 x 2 + 0\nGCF = 21\n\n105 = 3 x 5 x 7\n252 = 2^2 x 3^2 x 7\nCommon factors: 1, 3, 7, 21\nLCM = (105 x 252) / 21 = 1260

Result: GCF(105, 252) = 21 | Common factors: 1, 3, 7, 21 | LCM = 1260

Frequently Asked Questions

What is the Greatest Common Factor and how is it defined?

The Greatest Common Factor (GCF), also called the Greatest Common Divisor (GCD) or Highest Common Factor (HCF), is the largest positive integer that divides two or more numbers without leaving a remainder. For example, the GCF of 12 and 18 is 6, because 6 is the largest number that divides both 12 and 18 evenly. The GCF is always at least 1, since 1 divides every integer. Two numbers whose GCF is 1 are called coprime or relatively prime. The GCF is a fundamental concept in number theory and has practical applications in simplifying fractions, solving Diophantine equations, and in cryptographic algorithms like RSA encryption.

Can I use the results for professional or academic purposes?

You may use the results for reference and educational purposes. For professional reports, academic papers, or critical decisions, we recommend verifying outputs against peer-reviewed sources or consulting a qualified expert in the relevant field.

How accurate are the results from Greatest Common Factor Calculator?

All calculations use established mathematical formulas and are performed with high-precision arithmetic. Results are accurate to the precision shown. For critical decisions in finance, medicine, or engineering, always verify results with a qualified professional.

What inputs do I need to use Greatest Common Factor Calculator accurately?

Each field is labelled with the required unit (metric or imperial). Gather your source values before starting โ€” for example, a weight measurement in kilograms, a distance in metres, or a dollar amount โ€” and enter them exactly as measured. The formula section on this page lists every variable and explains what each represents.

Does Greatest Common Factor Calculator work offline?

Once the page is loaded, the calculation logic runs entirely in your browser. If you have already opened the page, most calculators will continue to work even if your internet connection is lost, since no server requests are needed for computation.

How do I interpret the result?

Results are displayed with a label and unit to help you understand the output. Many calculators include a short explanation or classification below the result (for example, a BMI category or risk level). Refer to the worked examples section on this page for real-world context.

References

Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy