GCF and LCM Calculator - Greatest Factor, Smallest Multiple
Use this gcf and lcm calculator to find the greatest common factor and least common multiple of up to 6 whole numbers from prime factorization.
GCF and LCM Calculator
Results
What Is GCF and LCM Calculator?
A gcf and lcm calculator is a math tool that turns a list of two to six whole numbers into two answers at once: the greatest common factor (GCF) and the least common multiple (LCM). The GCF is the largest integer that divides every number in the set, while the LCM is the smallest integer that every number in the set divides evenly. Because both answers come from the same prime-factorization step, the tool is the most efficient way to handle homework, scheduling, and gear-ratio problems without doing the factorization twice by hand.
- • Homework and test prep: Solve 'find the GCF' or 'find the LCM' questions for two, three, or more whole numbers and show the prime factor map.
- • Adding and subtracting fractions: Use the LCM of the denominators as a common denominator, or use the GCF to reduce a fraction to lowest terms.
- • Scheduling and repeating cycles: Find when two or more cycles (bus routes, pill schedules, project phases) line up by computing the LCM of the cycle lengths.
- • Tile, gear, and packing problems: Use the GCF to split a length into equal whole pieces and the LCM to find a dimension that fits two tile or gear patterns at once.
Both answers rely on the same prime factor map, so a single run of the gcf and lcm calculator gives you everything you need. The calculator also shows the prime factorization of every number you entered, which makes it easy to follow a worked example from a textbook or to verify a student's work step by step.
If you only need the LCM of two or three numbers, the Least Common Multiple Calculator is a focused single-output tool that walks through the same prime-factorization steps in more detail.
How GCF and LCM Calculator Works
The calculator factors each number into primes, then combines those prime maps to produce both the GCF and the LCM in one pass. The prime map of every number appears in the results panel along with the shared and combined factor rules.
- input numbers: Up to six positive integers from 1 to 1,000,000 that the user wants to factor together.
- prime factor map: For each number, the set of primes that divide it and the exponent of each prime.
- shared primes: Primes that appear in every input's factor map. The GCF keeps only the smallest exponent of each shared prime.
- all primes: Every prime that appears in any input's factor map. The LCM keeps the largest exponent of each prime that appears.
The GCF and LCM share a clean identity for two numbers: GCF(a, b) x LCM(a, b) = a x b. The results panel shows this check so you can verify the answer by hand in seconds. For three or more numbers, the identity extends to a chain, so the tool shows the prime map rather than the product identity.
GCF and LCM of 24 and 56
Inputs: 24 and 56
24 = 2 x 2 x 2 x 3 and 56 = 2 x 2 x 2 x 7. Shared primes: 2 with the smallest exponent 3, so GCF = 2^3 = 8. All primes at the largest power: 2^3 x 3 x 7 = 168.
GCF(24, 56) = 8, LCM(24, 56) = 168.
Use the GCF when you want to split 24 and 56 into the largest equal whole parts (eight 3s and eight 7s). Use the LCM when you want a single number that is a multiple of both, which is handy when you need a measurement that fits both 24-unit and 56-unit patterns.
According to Wikipedia, the greatest common divisor can be computed from prime factorizations by taking the smallest power of each prime that appears in every number
According to Khan Academy, Khan Academy teaches the same prime-exponent method and uses the GCF-LCM pair for fraction and ratio problems
When the problem asks for the GCF alone and you want a deeper worked example, the Greatest Common Factor Calculator shows the Euclidean algorithm side by side with the prime-factorization method used here.
Key Concepts Explained
Four ideas appear in every GCF and LCM problem. Understanding each one makes the answers obvious before you reach for the calculator.
Prime factorization
Every whole number greater than 1 can be written as a product of prime numbers, and that product is unique. The GCF and LCM are just two ways of combining those products.
Greatest common factor (GCF)
Also called the greatest common divisor (GCD). The largest integer that divides every number in the set with no remainder.
Least common multiple (LCM)
The smallest positive integer that is divisible by every number in the set. Useful for cycles and patterns that need to line up.
Coprime numbers
Two or more numbers are coprime when their only common factor is 1, so GCF = 1. The LCM of coprime numbers is just their product.
LCM drives bus and shift schedules, gear and pattern matching, and the common-denominator step of every fraction calculation. GCF drives fraction simplification, equal-group sharing, and tiling problems where you cannot leave a partial tile.
To see the prime map of a single large number before you feed it into this tool, the Prime Factorization Calculator returns the prime factor map with exponents and lets you copy it into the GCF and LCM rows.
How to Use This Calculator
Enter two to six positive whole numbers and read the GCF, LCM, and full prime-factor breakdown directly from the results panel. The default values show a worked example so you can confirm what each line means.
- 1 Enter the first two numbers: Type at least two positive integers in the first two rows. These rows are required.
- 2 Add more numbers if you have them: Fill in any of the optional rows 3 through 6 to extend the set. Leave a row blank to ignore it.
- 3 Press Calculate: The results panel updates with the GCF, the LCM, and the prime-factor breakdown for every number.
- 4 Read the prime-factor breakdown: Each input appears with its prime factorization, followed by the GCF rule and the LCM rule.
- 5 Verify the identity (two numbers only): For two inputs, the tool prints the GCF x LCM = a x b check. If the two products match, both answers are correct.
- 6 Copy or reset: Use the Reset button to clear every row and return to the worked example. The default numbers are 24 and 56.
If you need the LCM of 4, 6, and 15 to schedule a project phase that runs every 4, 6, and 15 days, the gcf and lcm calculator returns LCM = 60 once you enter the three numbers. The prime map (4 = 2^2, 6 = 2 x 3, 15 = 3 x 5) becomes 2^2 x 3 x 5 = 60, the smallest day count on which all three cycles line up.
When one of your inputs might be prime and you want to confirm it before treating it as a shared factor, the Prime Number Checker verifies the primality of a single number in the same range.
Benefits of Using This Calculator
A combined GCF and LCM tool saves time on every problem that would otherwise need two separate calculators, and it documents the prime-factor map you can quote in a worked solution.
- • Two answers from one entry: Get the GCF and the LCM at the same time, so you stop repeating the prime-factorization step.
- • Up to six numbers at once: Solve problems with three, four, five, or six numbers without writing them down on paper and re-typing them into a second tool.
- • Transparent prime-factor map: Every number is shown with its prime factorization, so the calculator is a teaching aid, not a black box.
- • Built-in identity check: For two numbers, the panel shows GCF x LCM = a x b. That single line catches both arithmetic slips and copy-paste errors in seconds.
- • Covers the coprime edge case: When the inputs share no prime factors, the tool returns GCF = 1 and LCM = the product, which is the rule students trip on most often.
The biggest practical win is the prime-factor map. Most students get the GCF and LCM wrong because they confuse 'lowest power' with 'highest power' when a prime appears more than once. Showing the exponent for every prime side by side makes the rule visible and the answer obvious.
If you need the full list of common factors, not just the greatest one, the Common Factor Calculator returns every shared divisor in order and pairs them with the GCF you see here.
Factors That Affect Your Results
Five things change the GCF, the LCM, or both, and understanding them helps you predict the answer before you press Calculate.
Shared prime factors
The GCF grows with every prime that appears in every input. A prime that only some numbers share does not change the GCF.
Highest prime exponent
The LCM grows with the largest exponent of every prime that appears anywhere. A single input that contains 2^10 will set the LCM to 1024 times the contribution of the other primes.
Number of inputs
Adding more inputs can only keep the GCF the same or shrink it, but the LCM can only stay the same or grow.
Coprime inputs
If no prime is shared, the GCF is forced to 1 and the LCM is forced to the product of every input.
Inputs equal to 1
The number 1 has no prime factors, so it never contributes a new prime to the LCM. It is a neutral input that keeps both answers inside the range of the other numbers.
- • GCF and LCM are only defined for positive integers. Zeros, negatives, and decimals are rejected so the prime-factor map stays valid.
- • Inputs above 1,000,000 are out of range for this tool. For larger numbers, use a general math engine or factor them by hand in stages.
- • The prime-factorization method is exact, so there is no rounding or approximation to worry about. Every answer is an integer you can verify with long division.
The two product identities to keep in mind are GCF(a, b) x LCM(a, b) = a x b for two numbers, and a stepwise LCM(a, b, c) = LCM(LCM(a, b), c) for more numbers.
According to Wikipedia, the LCM is the smallest positive integer that is a multiple of every number in the set, and is computed from prime factorizations by taking the highest power of each prime that appears
When you want every factor of a single number rather than just the GCF or LCM, the Factor Calculator returns the complete factor list with pairings and helps you sanity-check the largest shared factor.
Frequently Asked Questions
Q: What is the gcf and lcm calculator used for?
A: The gcf and lcm calculator turns up to six positive whole numbers into the greatest common factor (GCF) and the least common multiple (LCM) in a single step, using prime factorization. It also prints the prime-factor map for every number so you can show your work.
Q: How do you find the GCF and LCM of two numbers?
A: Factor both numbers into primes. The GCF is the product of the primes they share, each raised to the smallest power it appears. The LCM is the product of every prime that appears in either number, each raised to the largest power it appears.
Q: What is the difference between GCF and LCM?
A: The GCF is the largest number that divides both inputs with no remainder; the LCM is the smallest number that both inputs divide evenly. The GCF is at most the smaller input, while the LCM is at least the larger input.
Q: How do you find the GCF and LCM of three or more numbers?
A: Factor every number into primes. For the GCF, keep only the primes that appear in every number, each at its smallest exponent. For the LCM, keep every prime that appears in any number, each at its largest exponent. The calculator does this in one pass for up to six numbers.
Q: What is the GCF of 24 and 36?
A: 24 = 2^3 x 3 and 36 = 2^2 x 3^2. The shared primes are 2 at exponent 2 and 3 at exponent 1, so GCF(24, 36) = 2^2 x 3 = 12. The LCM of 24 and 36 is 2^3 x 3^2 = 72.
Q: Why is GCF multiplied by LCM equal to the product of two numbers?
A: For two positive integers a and b, the GCF keeps the minimum exponent of each prime and the LCM keeps the maximum, and the sum of the two equals the total exponent of that prime across a and b, so GCF x LCM = a x b.