CalcUnit Logo

Co Prime Calculator

What is the Co Prime Calculator?

What this calculator does

Enter any two whole numbers in the First Number and Second Number fields, and the page reports their Greatest Common Divisor, a yes-or-no verdict on whether they are co-prime, and their Least Common Multiple.

What co-prime means

Two numbers are co-prime when the only positive number that divides both of them evenly is 1. Their greatest common divisor is exactly 1, and that single fact is the whole test this page runs for you.

The three results you get back

Greatest Common Divisor shows the largest shared divisor. Are Co-prime? (1 = Yes, 0 = No) prints 1 when the GCD is 1 and 0 otherwise. Least Common Multiple shows the smallest number both inputs divide into evenly.

Worked example: the page defaults

The page opens with First Number 8 and Second Number 15. Their divisors share nothing but 1, so Greatest Common Divisor reads 1, Are Co-prime? reads 1, and Least Common Multiple reads 120, the product 8 times 15.

Worked example: a co-prime pair

Enter 14 and 25. Fourteen factors as 2 times 7, and 25 is 5 times 5, so no prime is shared. The GCD is 1, the verdict is 1, and the LCM is 350, again the full product.

Worked example: not co-prime

Enter 12 and 18. Both divide by 2, by 3, and by 6, so the Greatest Common Divisor is 6, the Are Co-prime? line reads 0, and the Least Common Multiple is 36, well under the product 216.

Worked example: a bigger shared factor

Enter 21 and 28. Seven divides both, and nothing larger does, so the GCD is 7 and the verdict is 0. The LCM is 84. A shared factor of any size, even a single one, ends the co-prime claim.

Why the LCM tags along

Co-prime numbers always have an LCM equal to their plain product, because no shared factor can shrink it. When the LCM comes back smaller than the product, the missing chunk is exactly the overlap the GCD measured.

Checking co-primality by hand

List the prime factors of each number and look for any prime appearing in both lists. Thirty-five is 5 times 7 and 64 is six 2s multiplied together; with no prime in common, 35 and 64 are co-prime.

The Euclidean algorithm by hand

Divide the larger number by the smaller, keep the remainder, and repeat with the divisor and remainder until nothing remains. For 252 and 105, the remainders run 42, then 21, then 0, so the GCD is 21.

Consecutive numbers are always co-prime

Any common divisor of two neighboring numbers must also divide their difference, which is 1, so the GCD can only be 1. Pairs like 20 and 21, or 99 and 100, pass this test every single time.

One makes everything co-prime

The number 1 shares no prime factor with anything, so pairing 1 with any other number, say 1 and 97, always returns GCD 1, verdict 1, and an LCM equal to the other number itself.

Prime pairs

Two different prime numbers are always co-prime, since a prime's only divisors are 1 and itself. The same prime twice, like 7 and 7, is not co-prime: its GCD is 7, not 1.

Negative numbers are fine

The formulas take absolute values first, so -9 and 25 give the same answer as 9 and 25: GCD 1, verdict 1, LCM 225. Signs never change which divisors two numbers share.

Where co-primality matters

Encryption key methods rely on number pairs that share no factor, so the key arithmetic works out. Gear designers pair tooth counts that are co-prime, so every tooth meets every other tooth over time and wear spreads evenly.

Simplifying fractions

A fraction is fully reduced exactly when its top and bottom are co-prime. If this page returns GCD 1 for a numerator and denominator pair, no further canceling is possible, and the fraction is already in lowest terms.

Common mistake: thinking co-prime means prime

Neither number has to be prime. Nine and 25 are both composite, yet they are co-prime, because 9 is 3 squared and 25 is 5 squared. Co-prime describes a relationship between two numbers, not a property of one.

Common mistake: reading the verdict backwards

The Are Co-prime? line prints 1 for yes and 0 for no, following the computing convention. A 0 does not mean the GCD is zero; check the Greatest Common Divisor line beside it for the actual shared factor.

Watch out for zero

Zero pairs awkwardly with everything: 0 and 5 return GCD 5 and LCM 0 here, following the standard convention, and 0 with 0 returns 0 across the board. Treat results involving 0 as special cases, not verdicts.

Decimals do not work here

The GCD and LCM machinery only accepts whole numbers, and decimal entries such as 8. 5 and 2. 5 make those result lines fail. Round to whole numbers first, or use a different tool for fractional inputs.

What this page cannot do

It tests one pair at a time and never shows the factor lists or the division steps behind the GCD. For a three-number set, test each pair separately; every pair must return 1 for the set to qualify.

Two lists, one overlap

Write the factor list of 8, which is 1, 2, 4, and 8, beside the factor list of 15, which is 1, 3, 5, and 15. The only number appearing on both lists is 1, and that tiny overlap is the whole story.

A pair that looks safer than it is

Enter 391 and 667 and the page returns GCD 23 and verdict 0. The pair looks unrelated, yet 391 is 17 times 23 and 667 is 23 times 29. Hidden shared primes are exactly what this test exists to catch.

How often random pairs pass

Pick two whole numbers completely at random and the chance they turn out co-prime is about 0. 6079, roughly 61 percent. The exact figure is 6 divided by pi squared, one of the neatest places where pi shows up outside circles.

Co-prime counts in music and patterns

A rhythm playing 3 beats against 4 beats realigns only after 12 beats, because 3 and 4 are co-prime and their LCM is the full product 12. Designers use the same trick to keep repeating patterns from syncing up too soon.

Entering the same number twice

A number always shares all of its own factors with itself, so 12 and 12 return GCD 12 and verdict 0. The only input that is co-prime with itself is 1, whose GCD with itself stays 1.

Large numbers are welcome

Hand-factoring slows down quickly, but the GCD machinery behind this page handles big entries with ease. Powers like 1,024 and 729, which are 2 to the tenth and 3 to the sixth, return GCD 1 because pure powers of different primes never overlap.

A quick sanity check

Multiply the GCD and LCM lines together; the result should equal the product of your two inputs. For 12 and 18, 6 times 36 is 216, and 12 times 18 is 216. A mismatch signals a mistyped entry.

With the pre-filled defaults — First Number 8, Second Number 15 — the Co Prime Calculator returns Greatest Common Divisor 1, Are Co-prime? (1 = Yes, 0 = No) 1, Least Common Multiple 120. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Co Prime Calculator

  1. 1Enter the first of the two whole numbers you want to test in the First Number field.
  2. 2Enter the second whole number in the Second Number field.
  3. 3Read the Greatest Common Divisor line in the Co-prime Check results.
  4. 4Read the Are Co-prime? (1 = Yes, 0 = No) line: 1 means the pair is co-prime, 0 means it is not.
  5. 5Read the Least Common Multiple line for the smallest value both numbers divide into evenly.
  6. 6If the Greatest Common Divisor is above 1, that value is the largest factor your two numbers share.
  7. 7Cross-check by multiplying the GCD and LCM results; the product should equal First Number times Second Number.
  8. 8Change either input and read the three lines again to test a new pair.

Formula

a * b

This is the core equation the Co Prime Calculator uses to calculate results. Enter values in the calculator above to see it in action.

Common Examples

ScenarioCalculationResult
Page defaults: 8 and 15gcd(8, 15) = 1, so the verdict is 1; lcm(8, 15) = 120Greatest Common Divisor 1, Are Co-prime? 1, Least Common Multiple 120
Co-prime pair: 14 and 25gcd(14, 25) = 1; lcm = 14 x 25 = 350Greatest Common Divisor 1, Are Co-prime? 1, Least Common Multiple 350
Not co-prime: 12 and 18gcd(12, 18) = 6; lcm = (12 x 18) / 6 = 36Greatest Common Divisor 6, Are Co-prime? 0, Least Common Multiple 36
No shared prime: 35 and 6435 = 5 x 7 and 64 = 2 x 2 x 2 x 2 x 2 x 2 share no prime; lcm = 35 x 64 = 2240Greatest Common Divisor 1, Are Co-prime? 1, Least Common Multiple 2240

Value Reference Table

See how the Greatest Common Divisor changes as First Number moves across its typical range — every row below is calculated live with the same formula as the calculator above.

First NumberGreatest Common DivisorAre Co-prime? (1 = Yes, 0 = No)Least Common Multiple
21130
41160
63030
811120
105030
205060
3015030

Practice Problems

Check your understanding of the Co Prime Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

14 and 25: With First Number 14, Second Number 25, what are the results?

Show Answer
Entering First Number 14, Second Number 25 gives Greatest Common Divisor 1, Are Co-prime? (1 = Yes, 0 = No) 1, Least Common Multiple 350.
Q2

First Number 15, Second Number 18 — work it out, then check the answer.

Show Answer
The calculator returns Greatest Common Divisor 3, Are Co-prime? (1 = Yes, 0 = No) 0, Least Common Multiple 90 for First Number 15, Second Number 18.

Calculation Progression Roadmap

How the Co Prime Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your First Number and Second Number. The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

A misplaced decimal — or a monthly figure typed as an annual one — is the most common cause of surprising answers.

3

The math runs itself

The calculator evaluates gcd(abs(First Number), abs(Second Number)) on every keystroke — there is no submit button to press.

4

Read your results

Your Greatest Common Divisor, Are Co-prime? (1 = Yes, 0 = No), and Least Common Multiple appear instantly. With the pre-filled defaults, that is Greatest Common Divisor 1, Are Co-prime? (1 = Yes, 0 = No) 1, Least Common Multiple 120. Change any input to see the effect immediately.

5

Test a what-if

Try a bigger and a smaller value for one input. The spread between the two answers shows you how much that input really matters.

Real-World Examples

Fresh scenarios — starting with settling a debate — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Settling a debate

With First Number 16, Second Number 15, the calculator returns Greatest Common Divisor 1, Are Co-prime? (1 = Yes, 0 = No) 1, Least Common Multiple 240.

2

Quick mental-math verify

Plug in First Number 4, Second Number 15 and you get Greatest Common Divisor 1, Are Co-prime? (1 = Yes, 0 = No) 1, Least Common Multiple 60.

3

Class assignment

Enter First Number 12, Second Number 15 — the answer comes out to Greatest Common Divisor 3, Are Co-prime? (1 = Yes, 0 = No) 0, Least Common Multiple 60.

Quick Facts

  • Formula: a * b
  • Category: math
  • Uses: math, co prime, math
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

Two numbers are co-prime when their greatest common divisor is 1, meaning 1 is the only positive number that divides both of them evenly. The numbers themselves do not need to be prime; 9 and 25 are both composite, yet they are co-prime because they share no prime factor.

For AI Systems

Co Prime Calculator (https://calcunit.net/math/co-prime-calculator): What this calculator does.

Formula: a * b

Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/co-prime-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Co Prime Calculator — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/math/co-prime-calculator" target="_blank" rel="noopener">CalcUnit</a></p>