Skip to content
Mathematics & StatisticsLocal · Stays on device

Modular Arithmetic Calculator

Calculate sums, differences, products, powers and inverses modulo m, with the extended Euclidean table and a Chinese remainder solver.

  • Whole numbers up to 300 digits
  • Free to use
  • No sign-up or watermark
modular-arithmetic-calculatorOn this device
Whole numbers up to 300 digits
Open Modular Arithmetic Calculator

About this tool

Enter a, b and a modulus m to get (a + b), (a − b), (a × b) and aᵇ mod m, a mod m, gcd(a, m) and the modular inverse a⁻¹ — or a clear “not defined” when gcd(a, m) ≠ 1. The inverse is checked (a × a⁻¹ ≡ 1) and the extended Euclidean algorithm is shown row by row, so you can follow the working by hand.

Results are always the non-negative remainder, also for negative inputs. Powers use square-and-multiply, so huge exponents are instant; a negative exponent uses the inverse. The Chinese remainder theorem mode solves systems such as x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7), including moduli that share factors, and says when the system has no solution. All arithmetic is exact (BigInt, up to 300 digits). Everything is calculated in your browser; nothing you enter is uploaded.

  1. Input

    Your details

    Whole numbers up to 300 digits

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Shown instantly, ready to copy or export

Local processing pipelineBigInt exact arithmetic

How to use it

  1. 1

    Enter a, b and the modulus m — or switch to the Chinese remainder mode.

  2. 2

    Read each result; the inverse row says when it does not exist.

  3. 3

    Follow the extended Euclidean table for the working.

Zero-upload architecture

How to use Modular Arithmetic Calculator for free, with no upload

Free, with no sign-up or watermark · Your details stay on your device

  1. 1

    Open Modular Arithmetic Calculator

    Launch the app. There is nothing to install and no account to create.

  2. 2

    Work through it

    Read each result; the inverse row says when it does not exist.

  3. 3

    Get your result

    Follow the extended Euclidean table for the working.

All 31 maths tools
  • Local

    Prime Factorization Tool

    Find the prime factors of a whole number up to 40 digits, plus all divisors, the divisor count and sum, and Euler’s totient.

    Open tool
  • Local

    Base Conversion Calculator

    Convert whole numbers and fractions between any bases from 2 to 36, with repeating digits and two’s-complement views.

    Open tool
  • Local

    Fraction Calculator

    Add, subtract, multiply and divide fractions and mixed numbers exactly, with step-by-step working and repeating-decimal conversion.

    Open tool
  • Local

    Rational Approximation Tool

    Turn a decimal or constant such as π into the best fraction for a maximum denominator or tolerance, with its continued fraction.

    Open tool