IP331.com | Online Tools
HomeNumber Theory ToolsCoprime Calculator

Coprime Calculator

Check whether two integers are relatively prime using gcd

First integer
Second integer

Coprime Number Formula

a and b are coprime if gcd(a, b) = 1
Euclidean algorithm: gcd(a, b) = gcd(b, a mod b)

Two numbers are coprime when they share no common factor greater than 1. The Euclidean algorithm repeatedly replaces a pair by the smaller number and the remainder until the remainder becomes zero.

Use nonzero integers. Negative signs do not affect coprime status because gcd uses absolute values.

What Are Coprime Numbers?

Coprime numbers, also called relatively prime numbers, are pairs of integers whose greatest common divisor is 1. They do not need to be prime individually; only their shared factors matter.

GCD Test

The entire decision is based on whether the greatest common divisor equals 1.

Not Both Prime

Composite numbers can still be coprime if they share no factor.

Euclidean Steps

Repeated remainders give a fast and exact gcd calculation.

Why It Matters

Coprime pairs allow modular inverses and reduced fractions.

Example: For 35 and 64, the Euclidean algorithm gives gcd(64,35)=gcd(35,29)=gcd(29,6)=gcd(6,5)=gcd(5,1)=1, so they are coprime.

Applications of Coprime Numbers

GCD Problems Fractions Modular Inverses Euler Totient CRT

Frequently Asked Questions

What is a coprime calculator?
A coprime calculator checks whether two integers have greatest common divisor 1. If gcd(a,b)=1, the numbers are coprime.
What formula is used for coprime numbers?
The rule is gcd(a,b)=1. This tool uses the Euclidean algorithm to compute the gcd quickly.
How do I use this relatively prime calculator?
Enter two nonzero integers and press Calculate. The tool shows the gcd steps and tells whether the pair is coprime.
Can composite numbers be coprime?
Yes. For example, 8 and 9 are both composite-related values, but gcd(8,9)=1, so they are coprime.
Where are coprime numbers used?
Coprime numbers are used in fractions, modular inverses, Euler totient, Chinese remainder theorem, and cryptography.

More Number Theory Tools

Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.

© 2026 IP331.com — Free Online Tools. All rights reserved.

About · Contact · Privacy Policy · Cookie Policy · Terms of Use · Disclaimer · Sitemap