Math

Instant, private, and free

Relatively Prime Calculator.

Check whether two integers have a greatest common divisor of one.

On-device calculationNo signup
01

Set your values

Results update as you type.

Results update automatically as you type.

Use Cases

Simplifying fractions

Determine if a fraction is already in its simplest form. If the numerator and denominator are relatively prime, the fraction cannot be reduced further.

Example: Check if 21/22 is simplified: 21 and 22 are relatively prime, so it is.

Number theory and cryptography

In mathematics and computer science, relatively prime numbers are used in modular arithmetic, RSA encryption, and other algorithms. Quickly verify coprimality for your calculations.

Example: Verify that 35 and 12 are coprime before using them in a modular inverse calculation.

Frequently Asked Questions

What does it mean for two numbers to be relatively prime?
Two integers are relatively prime (or coprime) if their greatest common divisor (GCD) is 1. This means they share no common positive factors other than 1. For example, 8 and 15 are relatively prime because their GCD is 1, even though neither is prime itself.
How does this calculator determine if numbers are relatively prime?
The calculator computes the greatest common divisor (GCD) of the two integers you enter. If the GCD is exactly 1, the numbers are relatively prime; otherwise, they are not. The result is shown instantly after you input both integers.
Can I use negative numbers or zero?
Yes, you can enter any integers, including negative numbers and zero. For negative numbers, the calculator uses their absolute values for the GCD calculation. Zero is relatively prime only to 1 and -1, because the GCD of 0 and any other number is that number's absolute value.

Tips & Common Mistakes

Tips

  • Enter both integers to get an instant result. The calculator will show whether they are relatively prime or not.
  • If you're checking multiple pairs, use the calculator repeatedly to compare results.
  • Remember that two prime numbers are always relatively prime, but non-prime numbers can also be relatively prime (e.g., 8 and 15).
  • For large numbers, the calculator handles them efficiently, so you can trust the result.

Common Mistakes to Avoid

  • Assuming that if both numbers are not prime, they cannot be relatively prime. For example, 8 and 15 are both composite but relatively prime.
  • Forgetting that 1 is relatively prime to every integer, including 0 (since GCD(1,0)=1).
  • Confusing relatively prime with prime numbers. Relatively prime refers to a pair of numbers, not individual numbers.

Last updated: August 13, 2026