Advanced Extended GCD Calculator

Find gcd values and Bezout coefficients quickly. Check inverses, equations, remainders, tables, and downloadable reports. Use clean steps for confident modular math decisions today.

Enter Values

Example Data Table

a b gcd x y Identity
240 46 2 -9 47 240(-9) + 46(47) = 2
99 78 3 -11 14 99(-11) + 78(14) = 3
35 12 1 -1 3 35(-1) + 12(3) = 1
0 18 18 0 1 0(0) + 18(1) = 18

Formula Used

Bezout identity: ax + by = gcd(a, b)

Euclidean division: ri-1 = qiri + ri+1

Coefficient update: si+1 = si-1 - qisi

Second coefficient update: ti+1 = ti-1 - qiti

Diophantine scaling: if gcd(a, b) divides c, multiply x and y by c / gcd(a, b).

General solution: x = x0 + (b / g)t, y = y0 - (a / g)t.

How to Use This Calculator

Enter two integers in the a and b fields. Negative values are allowed.

Enter c when you want to solve ax + by = c. Leave c blank to use the gcd as the target.

Enter any integer t to inspect another solution from the general Diophantine solution family.

Press the calculate button. The result appears above the form and below the header.

Use the CSV button for spreadsheet work. Use the PDF button for printable notes.

Why Extended GCD Matters

The extended Euclidean algorithm is more than a gcd shortcut. It finds the greatest common divisor and the numbers that build it. Those numbers are called Bezout coefficients. They prove that ax plus by equals gcd(a,b). This calculator keeps every division row visible. That makes the method easier to audit, teach, and reuse.

Useful Number Theory Work

Many modular arithmetic tasks need this result. A modular inverse exists when two numbers are coprime. The coefficient beside the chosen value becomes the inverse after modulus normalization. Linear Diophantine equations also depend on the same idea. If c is divisible by the gcd, then ax plus by equals c has integer solutions. If not, no integer solution exists.

How the Method Builds Answers

The algorithm repeatedly divides the larger active remainder by the smaller active remainder. Each pass records a quotient and a new remainder. At the same time, it updates two coefficient chains. These chains track how every remainder came from the original inputs. When the last nonzero remainder appears, its stored coefficients become the Bezout pair.

Advanced Result Checks

This page adds checks that help prevent silent mistakes. It accepts negative values and zero where valid. It converts signs after running the core remainder process. It verifies the final identity directly. It also reports lcm, inverse status, a selected Diophantine solution, and the complete general solution. The optional parameter t lets you inspect another point on the solution line.

Practical Input Advice

Enter integers only. Avoid decimals, because the theorem is about whole numbers. Use target c when you want a linear equation result. Leave it unchanged when you only need gcd and coefficients. Review the check line before trusting any inverse. The identity should match exactly.

Export and Study Benefits

The CSV export is useful for spreadsheets and worksheets. The PDF export is useful for reports and class notes. The step table shows quotient, remainder, and coefficient changes. You can compare each row with hand calculations. The example table gives known cases for quick testing. Use small inputs first. Then move to larger values once the pattern is clear. The tool is designed for algebra, cryptography practice, contest preparation, daily practice, and discrete mathematics review.

FAQs

What is the extended gcd?

It is the gcd with extra coefficients x and y. These coefficients satisfy ax + by = gcd(a, b).

Can this calculator handle negative numbers?

Yes. It runs the remainder process on absolute values. Then it adjusts coefficient signs for the original inputs.

What are Bezout coefficients?

They are integers x and y that combine the inputs into their gcd. They are useful in proofs and modular arithmetic.

When does a modular inverse exist?

A modular inverse exists when the two numbers are coprime. That means their gcd equals 1.

What does c mean in the form?

The c value is the target in ax + by = c. Integer solutions exist only when gcd(a, b) divides c.

Why is there a t parameter?

The t value selects one solution from the general solution family. Change it to view another valid integer pair.

Can both inputs be zero?

No. gcd(0, 0) is undefined. At least one input must be a nonzero integer.

Why use the step table?

The step table shows each quotient and coefficient update. It helps verify work and learn the algorithm clearly.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.