Math Last updated: July 2026

Relatively Prime Calculator

Use our free **Relatively Prime Calculator** to **check if two numbers are coprime** instantly. This **coprime checker** helps you **compute the GCD** and **verify shared factors** with step-by-step results. Whether you need to **test coprimality** or **find the greatest common divisor**, this tool provides accurate solutions. Features include **prime factorization**, **GCD computation**, and **factor comparison**. 100% free — no signup required!

How to Use the Relatively Prime Calculator

Interactive calculator available after JavaScript loads.

Loading calculator...

Written by Calculator Archive Team

Math & Finance Experts — Verified Formulas, Peer-Reviewed Sources, Expert Analysis

Looking for a deeper explanation?

Read our comprehensive, peer-reviewed educational article in our Blog to learn the underlying math, formulas, and step-by-step examples.

Read Blog Guide ›

Mathematical Formula & Logic

Two numbers a and b are relatively prime (coprime) if their Greatest Common Divisor (GCD) equals 1, meaning they share no common prime factors.
Variable Glossary
GCD Greatest Common Divisor — the largest integer that divides both numbers
a, b The two positive integers being tested for coprimality
Relatively Prime Having no common prime factors; their GCD equals 1
Prime Factorization Breaking a number into its prime number factors

Step-by-Step Worked Calculation

Scenario: Checking if 14 and 25 Are Relatively Prime

Determine whether 14 and 25 share any common factors.

1

Step 1: Prime factorize 14: 14 = 2 × 7

2

Step 2: Prime factorize 25: 25 = 5²

3

Step 3: Compare factors: no common prime factors exist

4

Step 4: GCD(14, 25) = 1

5

Step 5: Since GCD = 1, 14 and 25 ARE relatively prime (coprime)

How to Use the Relatively Prime Calculator

  1. 1. Step 1: Enter the **first positive integer** into the relatively prime calculator.
  2. 2. Step 2: Enter the **second positive integer** to compare for coprimality.
  3. 3. Step 3: Click Calculate to see if the two numbers are **relatively prime (coprime)**.
  4. 4. Step 4: Review the **GCD (greatest common divisor)** of both numbers.
  5. 5. Step 5: Check the **prime factorization** of each number to see shared factors.
  6. 6. Step 6: Follow the **coprimality test** showing whether GCD equals 1.
  7. 7. Step 7: Use the step-by-step breakdown to understand the **number theory** behind coprime verification.

What Is a Relatively Prime Calculator?

Two numbers are relatively prime (also called coprime) if their Greatest Common Divisor (GCD) equals 1, meaning they share no common prime factors. This is a fundamental concept in number theory.

Why This Calculation Matters

Relatively prime numbers are essential in cryptography (RSA encryption), modular arithmetic, simplifying fractions, the Chinese Remainder Theorem, and many areas of pure and applied mathematics.

Common Mistakes to Avoid

  • Assuming relatively prime means both numbers must be prime — they do not (e.g., 8 and 15 are coprime but neither is prime)
  • Confusing "relatively prime" with "prime" — relatively prime describes a relationship between two numbers
  • Forgetting that 1 is relatively prime to every positive integer
  • Not checking all prime factors — missing a shared factor leads to incorrect coprimality results

Frequently Asked Questions

Complete indexable directory of answers (10 questions)

What does relatively prime mean?

Two numbers are relatively prime (also called coprime) if their Greatest Common Divisor (GCD) is 1 — they share no common prime factors.

Is 1 relatively prime to every number?

Yes. The GCD of 1 and any positive integer is always 1, so 1 is coprime to all positive integers.

Can two even numbers be relatively prime?

No. Any two even numbers both share 2 as a factor, so their GCD is at least 2, meaning they cannot be coprime.

What are relatively prime numbers used for?

They are essential in cryptography (RSA encryption), modular arithmetic, simplifying fractions, and the Chinese Remainder Theorem.

How do I find all pairs of relatively prime numbers up to N?

Two numbers a and b are coprime if and only if gcd(a,b) = 1. You can use the Euclidean algorithm to efficiently compute GCDs for all pairs.

Are consecutive integers always relatively prime?

Yes. Any two consecutive integers are always relatively prime because their difference is 1, and the only positive divisor of 1 is 1 itself.

How do I check if three numbers are pairwise coprime?

Three numbers are pairwise coprime if every pair among them is coprime. Check GCD(a,b) = 1, GCD(a,c) = 1, AND GCD(b,c) = 1. All three conditions must hold.

What mathematical formula does the Relatively Prime Calculator use?

The Relatively Prime Calculator uses standard mathematical formulas validated against authoritative references. The specific formula is displayed in the calculator interface with a detailed explanation of each variable.

How can I verify the Relatively Prime Calculator results manually?

Each calculator includes a step-by-step worked example showing exactly how the formula is applied. You can follow these steps with pen and paper to verify any result.

What types of inputs does the Relatively Prime Calculator accept?

The Relatively Prime Calculator accepts numeric inputs including integers and decimals. Invalid inputs (letters, special characters) are rejected with clear error messages.