Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Modulo Calculator

How to use Modulo Calculator
  1. Pick an operation in the Operation dropdown. Thirteen are listed, from basic modulo to GCD and coprime checks; the boxes below change to two or three. Learn more about the operations
  2. Type the numbers: First Number (a), then the Modulus (m) or Second Number (b), and for three-number operations the modulus in the third box. Whole numbers, negatives and decimals are accepted. Learn more about the inputs
  3. Click Calculate. The result appears in the blue box under the buttons; a red message appears instead when a number is missing, the modulus is zero, or an inverse does not exist. Learn more about the results
  4. The panel on the right explains the chosen operation with a definition and an example, and its link opens the section below that explains it in full. Learn more about the panel
  5. Click Reset to clear the boxes and the result; the operation stays selected. Learn more about getting started

Basic Modulo Operation

The modulo operation finds the remainder when one number is divided by another. Mathematically, if we have a ÷ b = q with remainder r, then a mod b = r. The result is always in the range 0, b-1] for positive b. This operation is fundamental in computer science, appearing in hash functions, random number generation, and cryptography. [Learn more about basic modulo
Example: 17 mod 5 = 2 because 17 = 5×3 + 2, where 2 is the remainder

Tip: Understanding modular arithmetic is fundamental to many areas, including cryptography, computer science, and number theory.







Getting Started with the Calculator

DemoA first modulo and Reset
Step 0 of 4
Select an operation from the dropdown menu to begin. The calculator offers 13 different modular arithmetic operations, from basic modulo to advanced cryptographic functions. The interface automatically adjusts based on your selection, showing either two or three input fields depending on the operation's requirements.

Enter your numbers in the input fields. The calculator accepts integers, negative numbers, and decimal values. For basic modulo operations like a mod ba \bmod b, you'll enter two values. For operations like modular addition (a+b) mod m(a + b) \bmod m, you'll enter three values including the modulus.

Click the Calculate button to compute your result. The answer appears in a highlighted box below the inputs, and the right panel updates with a detailed explanation of the operation including mathematical definitions and concrete examples. If you encounter an error, the calculator displays a clear message in red explaining the issue.

Use the Reset button to clear all inputs and start fresh with new calculations. The operation type remains selected, allowing you to quickly try different values with the same operation. A first example to try is 17 mod 5=217 \bmod 5 = 2; what the remainder means is explained in what is modular arithmetic.

Understanding the 13 Operation Types

DemoTwo-number and three-number operations
Step 0 of 4
The calculator provides thirteen distinct operations covering the full spectrum of modular arithmetic. Basic Modulo computes the remainder a mod ba \bmod b, the foundation of all modular operations. Negative Number Modulo demonstrates proper handling of negative inputs to ensure results stay within [0,m−1][0, m-1].

Decimal/Float Modulo extends operations to non-integer values using the formula a−b×⌊a/b⌋a - b \times \lfloor a/b \rfloor. The arithmetic operations—Modular Addition, Subtraction, and Multiplication—perform standard calculations while keeping results within modular bounds.

Modular Division finds (a×b−1) mod m(a \times b^{-1}) \bmod m where b−1b^{-1} is the multiplicative inverse. Modular Exponentiation computes ab mod ma^b \bmod m efficiently using fast algorithms. Modular Inverse finds a−1a^{-1} such that (a×a−1) mod m=1(a \times a^{-1}) \bmod m = 1.

Congruence Check verifies if a≡b(modm)a \equiv b \pmod{m}. GCD and LCM calculate the greatest common divisor and least common multiple. Coprime Check determines if two numbers share only 1 as a common factor. Each operation includes educational content explaining theory and applications. Operations on three numbers show a third box for the modulus: Modular Addition, for example, computes (8+7) mod 10=5(8 + 7) \bmod 10 = 5. Which operation fits which problem is discussed in when to use each operation.

Working with Different Number Types

DemoNegative and decimal inputs
Step 0 of 5
The calculator handles three types of numerical inputs seamlessly. Integer operations accept whole numbers and provide exact results for all thirteen operation types. Enter values like 17, 42, or 100 directly.

Negative numbers require special handling in modular arithmetic. When you enter −7-7 with modulus 55, the calculator applies the formula ((a mod b)+b) mod b((a \bmod b) + b) \bmod b to ensure the result falls within [0,4][0, 4]. The "Negative Number Handling" operation provides detailed explanations of this adjustment process.

Decimal numbers work with most operations, though GCD, LCM, and coprime checks require integers. For float modulo, the calculator uses a−b×⌊a/b⌋a - b \times \lfloor a/b \rfloor to compute remainders with fractional values, for example 7.5 mod 2=1.57.5 \bmod 2 = 1.5. This is useful for wrapping coordinates in graphics or handling periodic functions with non-integer periods. How negative inputs are reduced is explained in negative number modulo.

The calculator processes large numbers up to JavaScript's numerical limits. For operations involving very large numbers (common in cryptography), consider the efficiency of modular exponentiation, which avoids computing massive intermediate values.

Reading and Interpreting Results

DemoA result and an error message
Step 0 of 5
Results appear in the blue-highlighted box immediately after calculation. For simple operations like basic modulo, you'll see a single numerical answer. For operations like congruence checking, you'll see a statement confirming whether a≡b(modm)a \equiv b \pmod{m} or a≢b(modm)a \not\equiv b \pmod{m}.

The right panel updates simultaneously with each calculation, displaying the operation's title, mathematical definition, and a concrete example. This contextual information helps you understand not just the answer, but the underlying mathematics.

Error messages appear in red when something goes wrong. Common errors include division by zero (when modulus is 0), attempting modular division when numbers aren't coprime, or using non-integers for operations that require whole numbers. Each error message explains exactly what went wrong and how to fix it.

For modular inverse operations, if no inverse exists, the calculator clearly states that the numbers aren't coprime and no unique solution is available: the inverse of 33 modulo 1010 is 77, while 44 has no inverse modulo 1010. This immediate feedback helps you understand the mathematical constraints of each operation. The condition is explained in modular inverse.

Exploring Modular Arithmetic Operations

DemoModular addition and subtraction
Step 0 of 5
Experiment with the four basic arithmetic operations under modular constraints. Try modular addition: compute (8+7) mod 10=5(8 + 7) \bmod 10 = 5, observing how results wrap around like clock arithmetic. Compare this to regular addition where 8+7=158 + 7 = 15.

Test modular subtraction with examples where results would be negative: (3−7) mod 10=6(3 - 7) \bmod 10 = 6. Switching from addition to subtraction keeps your numbers, so 88, 77 and 1010 give (8−7) mod 10=1(8 - 7) \bmod 10 = 1. The calculator automatically adjusts negative results to the proper range, demonstrating how modular arithmetic maintains consistency. The rules are proved in modular addition.

Explore modular multiplication with larger numbers. Calculate (6×7) mod 10=2(6 \times 7) \bmod 10 = 2 and observe how even large products reduce to values within [0,9][0, 9]. This property prevents overflow in computer arithmetic.

Try modular division, but note it requires coprime numbers. Attempt 8÷3 mod 108 \div 3 \bmod 10 (which works) versus 8÷4 mod 108 \div 4 \bmod 10 (which fails because 4 and 10 aren't coprime). Understanding when division is possible is crucial for cryptographic applications.

Using Advanced Cryptographic Operations

DemoModular exponentiation and a coprime check
Step 0 of 5
Modular exponentiation is essential for cryptography. Calculate 413 mod 497=4454^{13} \bmod 497 = 445 and observe how the calculator handles this efficiently without computing 413=67,108,8644^{13} = 67,108,864 first. The fast exponentiation algorithm applies modular reduction at each step, keeping numbers manageable.

Explore modular multiplicative inverses, the foundation of RSA encryption. Find the inverse of 3 mod 103 \bmod 10, which is 77 because (3×7) mod 10=1(3 \times 7) \bmod 10 = 1. Try finding inverses for different values and observe when they exist (only when numbers are coprime).

Test the coprime checker to verify relationships before attempting division or finding inverses. Check if 2525 and 3636 are coprime (they are, with GCD=1\text{GCD} = 1), then verify if 1212 and 1818 are coprime (they aren't, with GCD=6\text{GCD} = 6); 44 and 1313 are coprime too. The fast method is explained in modular exponentiation.

Practice with congruence checking to verify equivalences: confirm that 17≡2(mod5)17 \equiv 2 \pmod{5} because both leave remainder 22 when divided by 55. This operation helps verify solutions to modular equations.

What is Modular Arithmetic

Modular arithmetic is a system where numbers wrap around after reaching a certain value called the modulus. Think of a 12-hour clock: after 12 comes 1, not 13. Mathematically, we say 13≡1(mod12)13 \equiv 1 \pmod{12} because both leave the same remainder when divided by 12.

The modulo operation a mod ma \bmod m finds the remainder when aa is divided by mm. This remainder always falls within [0,m−1][0, m-1]. For example, 17 mod 5=217 \bmod 5 = 2 because 17=5×3+217 = 5 \times 3 + 2.

Modular arithmetic appears throughout mathematics and computer science. In cryptography, it forms the basis of RSA encryption. In programming, it handles cyclic structures, array indexing with wraparound, and hash table implementations. Understanding modular arithmetic is essential for computer science, cryptography, and advanced mathematics.

In the calculator this is the Basic Modulo operation. The definition and the method are in what is modulo, how to compute a remainder and the range of remainders.

Negative Number Modulo

A negative dividend still leaves a remainder in the range [0,m−1][0, m-1], but a calculator or a programming language may report a different value. This calculator uses the floored convention: −7 mod 5=3-7 \bmod 5 = 3, because −7=5×(−2)+3-7 = 5 \times (-2) + 3. Each step down by one lowers the remainder by one and wraps: −1 mod 5=4-1 \bmod 5 = 4, −10 mod 5=0-10 \bmod 5 = 0.

To compute it by hand, take the remainder as if the sign were absent, then subtract it from the modulus: 7 mod 5=27 \bmod 5 = 2, so −7 mod 5=5−2=3-7 \bmod 5 = 5 - 2 = 3. When the first remainder is 00 the answer stays 00. The calculator applies ((a mod b)+b) mod b((a \bmod b) + b) \bmod b, which gives the same result and never returns a negative number.

The common mistake is to answer −2-2, which is what truncated division gives: −7=5×(−1)−2-7 = 5 \times (-1) - 2. Both conventions agree on positive numbers and differ only for negative ones, so always say which one you mean.

The two conventions are compared in two conventions and floored division; the short version is in negative dividends.

Decimal Modulo

The modulo operation extends to decimals with the same idea: subtract the largest whole-number multiple of the divisor that fits, and keep what is left. The formula is a−b×⌊a/b⌋a - b \times \lfloor a / b \rfloor, where ⌊x⌋\lfloor x \rfloor rounds down. For 7.5 mod 27.5 \bmod 2: 7.5/2=3.757.5 / 2 = 3.75, round down to 33, and 7.5−2×3=1.57.5 - 2 \times 3 = 1.5. For 5.5 mod 1.55.5 \bmod 1.5: 5.5/1.5≈3.675.5 / 1.5 \approx 3.67, round down to 33, and 5.5−1.5×3=15.5 - 1.5 \times 3 = 1.

Decimal modulo is used for anything that repeats with a non-integer period: an angle reduced to [0,360)[0, 360), a time of day in hours, or a wave with period 2π2\pi.

The common mistake is a rounding surprise: a computer stores most decimals approximately, so the raw result of 7.5 mod 2.27.5 \bmod 2.2 is 0.89999999999999950.8999999999999995 rather than 0.90.9. The calculator rounds the result to twelve significant digits, so it shows 0.90.9; when you compute by hand or in code, read such a result as 0.90.9, since the difference is floating-point error, not mathematics.

The floor formula is the same one that defines the modulo of negative numbers; see floored division and how to compute a remainder.

Modular Addition

Modular addition adds two numbers and reduces the sum: (a+b) mod m(a + b) \bmod m. It is clock arithmetic: on a clock with mm hours, moving bb hours past aa lands on (a+b) mod m(a + b) \bmod m.

Example: (8+7) mod 10(8 + 7) \bmod 10. First 8+7=158 + 7 = 15, then 15 mod 10=515 \bmod 10 = 5. On a 1212-hour clock, (23+19) mod 12=42 mod 12=6(23 + 19) \bmod 12 = 42 \bmod 12 = 6: 1919 hours after 2323 o'clock is 66 o'clock.

The numbers can be reduced before adding without changing the answer: (a mod m+b mod m) mod m(a \bmod m + b \bmod m) \bmod m gives the same result, which keeps the arithmetic small when aa and bb are large. The common mistake is to forget the final reduction and report 1515 instead of 55; the result must lie in [0,m−1][0, m-1].

The rule and its proof are in addition and the core principle; clock questions are solved in clock problems.

Modular Subtraction

Modular subtraction computes (a−b) mod m(a - b) \bmod m and, when the difference is negative, adds the modulus to bring it back into [0,m−1][0, m-1].

Example: (3−7) mod 10(3 - 7) \bmod 10. The difference is −4-4; adding 1010 gives 66, so the answer is 66. On a 1212-hour clock, 99 hours before 22 o'clock is (2−9) mod 12=−7+12=5(2 - 9) \bmod 12 = -7 + 12 = 5 o'clock. The calculator computes ((a−b) mod m+m) mod m((a - b) \bmod m + m) \bmod m, which handles both signs.

A check: 6+7=136 + 7 = 13 and 13 mod 10=313 \bmod 10 = 3, the number we started from, so subtracting 77 really did undo adding 77. The common mistake is to stop at −4-4: a negative value is not a valid remainder.

See subtraction for the rule and negative dividends for why the modulus is added.

Modular Multiplication

Modular multiplication computes (a×b) mod m(a \times b) \bmod m: multiply, then take the remainder.

Example: (6×7) mod 10=42 mod 10=2(6 \times 7) \bmod 10 = 42 \bmod 10 = 2. With a prime modulus: (13×17) mod 11=221 mod 11=1(13 \times 17) \bmod 11 = 221 \bmod 11 = 1, since 221=11×20+1221 = 11 \times 20 + 1. The factors may be reduced first: 13 mod 11=213 \bmod 11 = 2 and 17 mod 11=617 \bmod 11 = 6, and (2×6) mod 11=12 mod 11=1(2 \times 6) \bmod 11 = 12 \bmod 11 = 1, the same answer with smaller numbers.

Reducing first matters in practice: multiplying very large numbers directly overflows a computer's integers, while (a mod m)×(b mod m)(a \bmod m) \times (b \bmod m) stays small. The common mistake is to reduce the factors and forget the product; the final result always needs one more reduction.

The rule is in multiplication; the last-digit trick, which is multiplication modulo 1010, is in last digit problems.

Modular Division

Division modulo mm is not a division at all: a÷b mod ma \div b \bmod m means (a×b−1) mod m(a \times b^{-1}) \bmod m, where b−1b^{-1} is the number whose product with bb leaves remainder 11. Such a number exists only when bb and mm are coprime.

Example: 8÷3 mod 108 \div 3 \bmod 10. The inverse of 33 modulo 1010 is 77, because 3×7=213 \times 7 = 21 and 21 mod 10=121 \bmod 10 = 1. Then 8×7=568 \times 7 = 56 and 56 mod 10=656 \bmod 10 = 6. Check: 6×3=186 \times 3 = 18 and 18 mod 10=818 \bmod 10 = 8, the number we divided.

8÷4 mod 108 \div 4 \bmod 10 has no single answer: both x=2x = 2 and x=7x = 7 give 4x mod 10=84x \bmod 10 = 8, because 44 and 1010 share the factor 22. The calculator reports that 44 has no modular inverse modulo 1010. The common mistake is to divide normally and reduce: 8÷4=28 \div 4 = 2 is one of two answers here, and 8÷38 \div 3 is not even a whole number.

Why division behaves differently is explained in why division is different; the condition on the divisor is in coprime numbers.

Modular Exponentiation

Modular exponentiation computes ab mod ma^b \bmod m without ever forming aba^b. The trick is to reduce after every multiplication, because (x×y) mod m(x \times y) \bmod m depends only on x mod mx \bmod m and y mod my \bmod m.

Small example: 34 mod 53^4 \bmod 5. 32=9≡43^2 = 9 \equiv 4, then 34=(32)2≡42=16≡1(mod5)3^4 = (3^2)^2 \equiv 4^2 = 16 \equiv 1 \pmod{5}. Larger example: 413 mod 497=4454^{13} \bmod 497 = 445, which the calculator finds by squaring and reducing, never touching 413=671088644^{13} = 67108864. Also 210 mod 7=1024 mod 7=22^{10} \bmod 7 = 1024 \bmod 7 = 2.

The square-and-multiply method reads the exponent in binary: square the running value for each bit, multiply by the base for each bit that is 11, and reduce each time. It needs about 2log⁡2b2 \log_2 b multiplications instead of bb. The common mistake is to compute the full power first; at cryptographic sizes it fits in no computer. The exponent here must be a non-negative integer.

Powers modulo mm and their cycles are in powers and detecting cycles in powers.

Modular Inverse

The modular inverse of aa modulo mm is the number xx in [0,m−1][0, m-1] with (a×x) mod m=1(a \times x) \bmod m = 1. It plays the role of 1/a1/a in modular arithmetic and exists exactly when gcd⁡(a,m)=1\gcd(a, m) = 1.

Example: the inverse of 33 modulo 1010 is 77, since 3×7=213 \times 7 = 21 and 21 mod 10=121 \bmod 10 = 1. The inverse of 77 modulo 2626 is 1515, since 7×15=105=4×26+17 \times 15 = 105 = 4 \times 26 + 1. The number 44 has no inverse modulo 1010: every multiple of 44 is even, so none of them leaves remainder 11 when divided by 1010.

By hand, the extended Euclidean algorithm writes gcd⁡(a,m)=1\gcd(a, m) = 1 as ax+my=1ax + my = 1; then x mod mx \bmod m is the inverse. For a small modulus, trying x=1,2,3,…x = 1, 2, 3, \dots until ax mod m=1ax \bmod m = 1 is quicker. The common mistake is to expect an inverse for every number; the calculator says when there is none.

The condition is explained in why division is different and properties of coprime numbers; the algorithm in Euclidean algorithm step by step.

Congruence Check

Two numbers are congruent modulo mm when they leave the same remainder on division by mm, written a≡b(modm)a \equiv b \pmod{m}. Equivalently, mm divides a−ba - b.

Example: 17≡2(mod5)17 \equiv 2 \pmod{5}, because 17 mod 5=217 \bmod 5 = 2 and 2 mod 5=22 \bmod 5 = 2; also 17−2=1517 - 2 = 15 is a multiple of 55. Likewise 14≡23(mod9)14 \equiv 23 \pmod{9}, since both leave remainder 55. But 17≢3(mod5)17 \not\equiv 3 \pmod{5}: the remainders are 22 and 33.

The calculator reduces both numbers with the floored rule, so negative inputs work: −7≡3(mod5)-7 \equiv 3 \pmod{5}. Congruence is what makes modular arithmetic consistent: congruent numbers can replace each other in sums and products without changing the result modulo mm. The common mistake is to compare aa with bb directly instead of comparing a mod ma \bmod m with b mod mb \bmod m; the modulus is the third number.

See congruence, properties of congruence and the congruence perspective on negative numbers.

Understanding GCD and LCM

The Greatest Common Divisor (GCD) of two integers is the largest number that divides both without remainder. For GCD(48,18)=6\text{GCD}(48, 18) = 6 because 66 is the largest number dividing both 48=6×848 = 6 \times 8 and 18=6×318 = 6 \times 3. The Euclidean algorithm computes GCD efficiently through repeated division.

The Least Common Multiple (LCM) is the smallest positive integer divisible by both numbers. For LCM(4,6)=12\text{LCM}(4, 6) = 12 because 1212 is the smallest number where both 44 and 66 divide evenly. The relationship LCM(a,b)=a×bGCD(a,b)\text{LCM}(a,b) = \frac{a \times b}{\text{GCD}(a,b)} connects these concepts.

These functions are fundamental to modular arithmetic. GCD determines if numbers are coprime (when GCD=1\text{GCD} = 1), which controls whether modular inverses exist. LCM appears in problems involving periodic cycles, fraction arithmetic, and scheduling when multiple cycles must align.

The calculator offers both as separate operations, explained in greatest common divisor and least common multiple. The lessons what is GCD and what is LCM treat each in full, and GCD and LCM shows where they sit among divisibility topics.

Greatest Common Divisor

The greatest common divisor of two integers is the largest positive integer that divides both. gcd⁡(48,18)=6\gcd(48, 18) = 6: the divisors of 1818 are 1,2,3,6,9,181, 2, 3, 6, 9, 18, and 66 is the largest of them that also divides 4848.

The Euclidean algorithm finds it without listing divisors: divide and keep the remainder until the remainder is 00; the last non-zero remainder is the GCD. For 4848 and 1818: 48=2×18+1248 = 2 \times 18 + 12, 18=1×12+618 = 1 \times 12 + 6, 12=2×6+012 = 2 \times 6 + 0, so the GCD is 66. Each line is a modulo operation, which is why the GCD belongs in this calculator.

gcd⁡(a,b)=1\gcd(a, b) = 1 means the numbers are coprime; that is the test behind modular division and inverses. The common mistake is to stop at any common divisor: 22 and 33 divide both 4848 and 1818, but the greatest one is 66. The calculator takes absolute values, so negative inputs give the same GCD.

The three methods are in what is GCD and Euclidean algorithm step by step.

Least Common Multiple

The least common multiple of two integers is the smallest positive integer that both divide. lcm(4,6)=12\mathrm{lcm}(4, 6) = 12: the multiples of 66 are 6,12,18,…6, 12, 18, \dots, and 1212 is the first that is also a multiple of 44.

The quickest method uses the GCD: lcm(a,b)=a×bgcd⁡(a,b)\mathrm{lcm}(a, b) = \frac{a \times b}{\gcd(a, b)}. For 4848 and 1818: gcd⁡=6\gcd = 6, so lcm=48×186=8646=144\mathrm{lcm} = \frac{48 \times 18}{6} = \frac{864}{6} = 144. For 44 and 66: gcd⁡=2\gcd = 2 and 242=12\frac{24}{2} = 12. When the numbers are coprime the LCM is simply their product.

The LCM is the common denominator for adding fractions and the first moment two repeating cycles coincide: two lights blinking every 44 and every 66 seconds blink together every 1212 seconds. The common mistake is to take the product a×ba \times b as the LCM; it is a common multiple but not the least one unless the numbers are coprime.

See what is LCM, using GCD and the GCD and LCM relationship.

Why Coprime Numbers Matter

Two numbers are coprime (relatively prime) when their only common factor is 1, meaning GCD(a,m)=1\text{GCD}(a, m) = 1. For example, 2525 and 3636 are coprime despite both being composite, because they share no prime factors: 25=5225 = 5^2 and 36=22×3236 = 2^2 \times 3^2.

Coprimality determines when modular division and inverses exist. The number aa has a multiplicative inverse modulo mm if and only if aa and mm are coprime. This is why 33 has an inverse mod 1010 (they're coprime), but 44 doesn't have an inverse mod 1010 (they share factor 22).

In cryptography, choosing coprime numbers ensures key generation succeeds. Understanding coprimality is essential for working with modular division and inverse operations in this calculator. The Check if Coprime operation runs this test. See coprime numbers and properties of coprime numbers.

Common Mistakes and How to Avoid Them

Forgetting the modulus cannot be zero is the most common error. Division by zero is undefined, so always ensure your modulus is at least 1. The calculator will alert you with an error message if you try this.

Expecting modular division to always work leads to confusion. Remember that modular division only works when the divisor and modulus are coprime. Check the GCD first—if it's not 1, division won't have a unique solution.

Mishandling negative numbers causes incorrect results. In modular arithmetic, −7 mod 5-7 \bmod 5 should give 33, not −2-2. The calculator automatically handles this, but when doing manual calculations, remember to add the modulus to negative remainders.

Using decimals for GCD and LCM won't work because these operations require integers. The calculator will reject decimal inputs for these specific operations. If you need to work with decimals, use the float modulo operation instead. More pitfalls with negative numbers are listed in common pitfalls.

Practical Tips for Using This Calculator

Start simple with basic modulo operations before moving to advanced functions. Try 17 mod 517 \bmod 5 to understand remainders, then progress to modular addition and multiplication.

Use the right panel explanations as learning tools. Each time you calculate, read the explanation to understand the mathematical principles behind the operation. The examples shown match the type of calculation you're performing.

Verify your homework by first calculating manually, then checking your answer with the calculator. This helps you learn the concepts while ensuring accuracy. The detailed explanations can also help you understand where you went wrong if answers don't match.

Experiment with different values to see patterns. Try the same operation with various moduli to observe how results change. Notice how modular addition with modulus 10 behaves like a clock counting from 0 to 9. Worked problems to practise with are in worked examples.

When to Use Each Operation

Use Basic Modulo for finding simple remainders in division problems, checking if numbers are divisible, or working with cyclic patterns. This is your starting point for all modular arithmetic.

Choose Modular Addition, Subtraction, or Multiplication when performing arithmetic that needs to stay within bounds, such as clock calculations, circular buffer indexing, or preventing integer overflow in programming.

Select Modular Division or Inverse when solving equations in cryptography, implementing encryption algorithms, or working with fraction arithmetic in modular systems. Remember these only work with coprime numbers.

Pick GCD and LCM for simplifying fractions, finding common denominators, or determining if modular inverses exist. Use Coprime Check before attempting division or inverse operations to avoid errors. The operations are summarised in the operations toolkit, and the uses of modulo in why modulo matters.