SentientMathWorked examples ↗

Modular
arithmetic.

Solve a congruence, find an inverse, and see the exact division steps behind the answer.

Enter an equation

Use integers of up to 80 digits and a modulus of 2 or greater.

Result

Euclidean algorithm

    When can you divide in modular arithmetic?

    An integer has a modular inverse exactly when it is coprime to the modulus. For a general congruence, the greatest common divisor shows whether solutions exist and how many occur per modulus.

    Work through the three outcomes →

    Modular Arithmetic Calculator with Euclidean Steps | SentientMath

    Find a positive remainder, calculate a modular inverse, and solve ax ≡ b (mod n) with exact integer steps and a residue wheel.

    What you can do on sentientmath.com

    • Enter an equation
    • Result
    • Euclidean algorithm
    • When can you divide in modular arithmetic?
    • Coefficient a
    • Right side b

    Reference guides & documentation

    • Solve a linear congruence — Work through a modular inverse, a congruence with two solutions, and a congruence with no solutions using the extended Euclidean algorithm.