How to find and use the greatest common factor

Find the GCF of two positive integers in TinyToolbox and use it to simplify fractions, reduce ratios, or make identical groups.

Open the tool

You have 84 pencils and 126 cards to divide among identical kits. Every kit should have the same number of pencils and the same number of cards, and you want to use everything. To find the largest possible number of kits, look for the largest whole number that divides both quantities exactly. That number is their greatest common factor.

TinyToolbox Greatest Common Factor Calculator finds that number for two positive integers. It is also called the greatest common divisor, or GCD. The answer can describe a number of groups, a shared length, or the factor by which to divide a fraction. Decide which of those interpretations matches your question before applying the result.

Recognize a common factor

A factor divides a number with no remainder. For example, 6 is a factor of 18 because 18 ÷ 6 is exactly 3. It is also a factor of 24 because 24 ÷ 6 is exactly 4. No larger positive number divides both 18 and 24, so their greatest common factor is 6.

The word greatest matters. The number 3 also divides both numbers. It would let you make three identical groups, but it would leave more items in each group because there are fewer groups. When your task asks for the largest count of identical groups, the greatest shared divisor gives that count. When it asks for every possible grouping, list all the positive factors of the GCF.

A shared factor is different from a common multiple. The factor divides the original quantities. The multiple is divisible by them. For example, 72 is divisible by both 18 and 24, so it is a common multiple. It cannot divide either starting quantity into whole groups. If you are working out when cycles of 18 and 24 steps next align, you need the Least Common Multiple Calculator.

Find the GCF in TinyToolbox

  1. Open Greatest Common Factor Calculator.
  2. Enter the first quantity under First positive integer.
  3. Enter the other quantity under Second positive integer.
  4. Select Calculate.
  5. Check that the result divides both original values without leaving a remainder.

The form accepts two whole numbers from 1 to 1,000,000,000. For counts like pencils and cards, enter the numbers of items. For lengths, convert both measurements to the same unit before entering them. If your lengths contain decimals, use a smaller common unit that represents both as whole numbers, as long as the resulting counts are within the supported range. Convert the factor back to the original unit if that is more useful for your report.

The result is the same in either input order. For example, the GCF of 84 and 126 is 42, and the GCF of 126 and 84 is also 42. The order matters again when you apply that factor to a ratio. Keep the labels on the original quantities so you can tell which reduced value goes first.

The form requires both inputs to be positive. Some mathematical definitions allow a GCD involving zero or negative numbers, but those are outside these input fields. A value of one is valid. Its only positive factor is one, so the GCF of one and any allowed input is one.

Check the answer using remainders

To check the first example, start with the larger value. Divide 126 by 84. The quotient is one with remainder 42. Then divide 84 by 42. It divides exactly. The last nonzero remainder is the GCF, 42.

This process is called the Euclidean algorithm. It works because a number that divides both starting values also divides the remainder left after subtracting a whole multiple of the smaller number. The reverse holds too: a divisor of the smaller number and the remainder also divides the larger number. The pair can therefore be replaced with the smaller value and remainder without changing the greatest common factor.

Try 144 and 60. Dividing 144 by 60 gives a remainder of 24. Dividing 60 by 24 gives a remainder of 12. Dividing 24 by 12 gives zero remainder, so 12 is the GCF. Check the result directly: 144 ÷ 12 is 12, and 60 ÷ 12 is 5. These quotients share no factor greater than one, which confirms that no further common division is possible.

If the smaller number already divides the larger one exactly, the smaller number is the answer. For example, the GCF of 35 and 105 is 35. Two different numbers can also have a GCF of one. Eight and fifteen share no larger divisor, even though both are composite.

Use the result to make identical kits

Return to the 84 pencils and 126 cards. Dividing by the GCF of 42 gives 2 pencils and 3 cards per kit. Check the inventory by multiplying back. Forty-two kits use 84 pencils and 126 cards. This is the largest number of identical kits that uses all the supplies under those conditions.

If you need fewer kits, consider the factors of 42. For example, 21 also divides both quantities and would produce 21 kits with 4 pencils and 6 cards each. The appropriate answer depends on the question. If the event has exactly 21 attendees, that grouping might fit. If you are asked for the maximum number, the result remains 42.

A different question asks for the longest equal piece that can be cut from two lengths without waste. There the GCF measures length, rather than the number of groups. If one strip is 84 cm and the other is 126 cm, pieces of 42 cm divide both strips exactly. The first strip yields two pieces and the second yields three. The same input numbers produce the same factor, but the physical meaning changes with the task.

If you have more than two quantities, find the GCF of the first pair, then use that answer as one input with the next quantity. For example, the GCF of 84 and 126 is 42. If you also have 70 labels, the GCF of 42 and 70 is 14. You can make 14 identical kits containing 6 pencils, 9 cards, and 5 labels.

Reduce a fraction or ratio in one step

To simplify 84/126, divide both its numerator and denominator by 42. The result is 2/3. Dividing only one side changes the value. After simplification, check that the two new numbers share no factor greater than one.

The same division reduces the ratio 84:126 to 2:3. Record the original order, such as pencils to cards, before writing the reduced ratio. A ratio of cards to pencils reverses the quantities. Ratio Calculator performs the reduction directly, while Fraction Calculator reduces the result after a fraction operation.

A GCF of one means the pair is already in lowest terms. If an answer surprises you, check the original inputs and try dividing both by the result. Then label the answer as a divisor, a group count, a length, or a reduced comparison according to the question you started with.

Reduce an image’s dimensions to an aspect ratio

Enter 1,440 and 1,080 in the Greatest Common Factor Calculator. Their GCF is 360. Divide the width and height by 360 to get 4 and 3. The image has a 4:3 aspect ratio. Keep the width first when writing the ratio. If you rotate the image by a quarter turn, the corresponding width-to-height ratio becomes 3:4 even though the greatest common factor is unchanged.

If a layout calls for a 720-pixel width at the same aspect ratio, divide 720 by 4 to obtain a multiplier of 180. Multiply the height part, 3, by that multiplier to get 540 pixels. To check that the new shape matches, compare 1,440 ÷ 720 with 1,080 ÷ 540. Each dimension shrank by the same factor. You could also run 720 and 540 through the calculator and verify that they reduce to 4:3.

If a layout instead needs 700 × 540 pixels, the two dimensions do not scale the original equally. Dividing both by their GCF of 20 gives 35:27, which differs from 4:3. This result tells you that you need to choose how to handle the shape difference, such as cropping some of the image or fitting it inside a padded area. For a close ratio that is hard to evaluate visually, compare the cross-products. The original ratio at 540 pixels high needs 720 pixels of width, so this canvas is 20 pixels narrower.

The GCF calculation also helps when you need a whole-number width and height for a very small image. Every exact 4:3 pair with positive integer dimensions is four times and three times the same integer. For a width under 100 pixels, the largest such multiple is 96 × 72. The next pair, 100 × 75, meets a limit of up to 100 pixels but exceeds a requirement of less than 100.

Choose a smaller equal group when there is a size constraint

Imagine that a classroom has 60 red counters and 84 blue counters. Every activity station should receive the same number of each colour, and all counters should be used. The GCF is 12, so you can make at most 12 identical stations under those rules. At that maximum, each station receives five red and seven blue counters.

Now suppose a station needs at least eight red counters. Twelve stations would give only five red counters each. Any valid number of stations divides both 60 and 84, so it must divide their GCF. The positive divisors of 12 are 1, 2, 3, 4, 6, and 12. Try six stations, the largest option below 12. Each then receives 10 red and 14 blue counters, which meets the minimum. Reproduce the totals by multiplying each colour’s allotment by six.

Changing the constraint can change the result in a different way. Suppose the room holds exactly nine stations. Nine does not divide 60 or 84 evenly. Even if every station must receive the same amounts, you could assign six red and nine blue counters to each station and keep six red and three blue in reserve. That satisfies a rule permitting leftovers. If the rules require all counters to be distributed, you would need a different number of stations or a change to the available counts.

Write down whether your answer is the number of groups or the size of a group. “Six stations with 24 counters each” is more informative than “six.” The written units also make it easier to notice whether a minimum applies to the group count, the combined total per group, or the quantity of one particular type.

Check scaled and already reduced inputs

A fraction in lowest terms can help you predict the result when both values are scaled. For example, 18/30 reduces to 3/5 with a factor of 6. If you multiply the original numerator and denominator by 10, you get 180/300. Their GCF is 60, and the reduced fraction is still 3/5. Run both pairs and compare the factors. The different GCF values tell you how much common scaling each pair contains.

For an already reduced fraction such as 35/48, the GCF is 1. Both numbers are composite, but their prime factors do not overlap. You can verify this with the Prime Factorization Calculator or by following the remainder method described above. The next time a pair of composite numbers gives a result of 1, check for common factors before assuming the input must be wrong. The result describes the relationship between the two integers.