Common Factor Calculator

This Common Factor Calculator allows users to input two numbers to calculate the greatest common factor, all common factors, determine if the numbers are coprime, and find the least common multiple.

Use Our Common Factor Calculator

How to Use the Common Factor Calculator

This guide will walk you through using the Common Factor Calculator, which allows you to calculate the Greatest Common Factor (GCF), all common factors, check if two numbers are coprime, and find the Least Common Multiple (LCM).

Step 1: Enter Input Numbers

  • First Number: In the field labeled “First Number,” enter your first integer. This field must contain a number between 1 and 999999 inclusive.
  • Second Number: In the field labeled “Second Number,” enter your second integer which should also be between 1 and 999999 inclusive.

Both input fields are required, and the numbers should be whole numbers. Ensure you have entered valid numbers to proceed with the calculations.

Step 2: Calculate the Greatest Common Factor (GCF)

The calculator will use the formula gcd(number1, number2) to determine the GCF. This will be automatically calculated and displayed in the field labeled “Greatest Common Factor (GCF).” This field will output the largest number that divides both input numbers without leaving a remainder.

Step 3: Identify All Common Factors

To find all common factors of the numbers entered, the calculator implements the logic getCommonFactors(number1, number2). This result is displayed in the “All Common Factors” field with a format that brackets the list of factors. All integers that can divide both numbers without a remainder will be shown here.

Step 4: Check if Numbers are Coprime

The calculator will check if the two numbers are coprime, which means their greatest common factor is 1. The formula gcd(number1, number2) === 1 ? 'Yes' : 'No' is used for this determination. The result will be displayed in the “Are Numbers Coprime?” field, outputting either “Yes” or “No.”

Step 5: Calculate the Least Common Multiple (LCM)

To find the least common multiple, the calculator uses the formula (number1 * number2) / gcd(number1, number2). The result is displayed in the “Least Common Multiple (LCM)” field, which indicates the smallest positive integer that is divisible by both entered numbers.

After following these steps, you will have a comprehensive understanding of the relationships between your chosen numbers in terms of divisibility and multiples.