K

Extended Euclidean Calculator

Extended Euclidean algorithm (Bezout)

Client-side computation for analysis, verification, and learning. Do not paste production secrets into untrusted sites; prefer local tooling for key material.

Educational / engineering use. RSA mode uses tiny primes for illustration only—not for real key generation.

a
b

Add Extended Euclidean Calculator Free On Your Website

Paste this HTML on your site.

What is Extended Euclidean Calculator?

An extension of the Euclidean algorithm that, along with the GCD, also computes the Bezout coefficients integers satisfying ax + by = gcd(a, b). Fundamental in modular inverse calculation and number theory.

Extended Euclidean Formula

gcd(a,b)=ax+bygcd(a,b) = ax + by
Recursiverelation:gcd(a,b)=gcd(b,amodb)Recursive relation: gcd(a,b) = gcd(b, a mod b)

Bézout coefficients at each step:

x=y;y=xfloor(a/b)yx = y' ; y = x' − floor(a/b) · y'

Until b = 0, then gcd = a, x = 1, y = 0.

Step-by-Step

  1. Enter integers a and b.
  2. Run Euclidean divisions.
  3. Back-substitute to express gcd as ax + by.
  4. Return gcd, x, and y.
  5. Use x for modular inverse when applicable.

Worked Example

Findgcd(35,15)andBezoutcoefficients.Find gcd(35,15) and Bezout coefficients.
35=215+535 = 2*15 + 5
15=35+015 = 3*5 + 0
Sogcd=5.So gcd = 5.
Backsubstitution:5=35215Back substitution: 5 = 35 - 2*15
Hencex=1,y=2satisfy35x+15y=5.Hence x=1, y=-2 satisfy 35x + 15y = 5.
Verification:35(1)+15(2)=5.Verification: 35(1) + 15(-2) = 5.

Where Extended Euclidean Calculator Is Applied

  • Computing modular inverses for RSA key generation
  • Polynomial GCD in algebra systems
  • Solving Diophantine equations in mathematics
  • Lattice-based cryptography
  • Compiler design (register allocation problems)
  • Chinese Remainder Theorem computations

Related Cryptography Calculators

Explore similar calculators to streamline your workflow.

View all
Calculator By Adil Balti, Content Proofread and Verify by Muhammad Kumail & Gulzar Abbas.

About Calculators.is

At Calculators.is our sole focus is to provide 100% accurate, fast, comprehensive, convenient, easy-to-use free online calculators to everyone to use without spending a single $ on any online Calculators.

All the calculators on our website are designed and developed by our own team, and each one is put through strict, comprehensive testing before being made live on our website.

About, Founder and calculator.is.