Modulo Calculator
Calculate the remainder of integer division.
About Modulo Calculator
The modulo operation returns the remainder after integer division. It is fundamental in number theory and programming.
$$a \mod b = r$$
How to use this calculator
- Enter the dividend, the number you want to divide, as \(a\).
- Enter the divisor, the number you are dividing by, as \(b\).
- Click calculate to find the remainder \(r\).
- Use the result to see how many are left over after equal groups are made.
The formula explained
The formula \(a \mod b = r\) computes the remainder \(r\) after dividing \(a\) by \(b\). If the division is exact, the remainder is 0.
- a = the dividend, the number being divided
- b = the divisor, the number dividing into the dividend
- r = the remainder left after division
Step by step method
- Divide \(a\) by \(b\) and find the whole-number quotient.
- Multiply the quotient by \(b\).
- Subtract that product from \(a\) to get the remainder.
Worked example
Problem. Find \(47 \mod 5\).
- Divide 47 by 5. The quotient is 9 because \(5 \times 9 = 45\).
- Subtract 45 from 47, so \(47 - 45 = 2\).
- The remainder is 2.
Answer. \(47 \mod 5 = 2\)
Tips and common mistakes
- The remainder is always smaller than the divisor when the divisor is positive.
- If a number divides evenly, the modulo result is 0. For example, \(24 \mod 6 = 0\).
Frequently asked questions
How do I use a modulo calculator to find the remainder of two numbers?+
Enter the dividend as a and the divisor as b, then the calculator returns r, the remainder after dividing a by b. For example, 17 mod 5 gives 2 because 17 = 5 × 3 + 2.
What does a mod b = r mean?+
It means when a is divided by b, the leftover amount is r. In other words, a = bq + r for some whole number q, and the remainder r is what the modulo operation returns.
What happens if the dividend is smaller than the divisor?+
Then the remainder is just the dividend itself, as long as the dividend is nonnegative. For example, 3 mod 10 = 3 because 10 does not fit into 3 even once.
Can modulo be negative?+
In many math contexts, the remainder is taken to be a nonnegative number, so the result is adjusted to stay between 0 and b - 1 when b is positive. If you are working with negative numbers, be aware that different programming languages can define modulo slightly differently.
How is modulo different from division or division with remainder?+
Division gives the quotient, while modulo gives the remainder. For example, 20 divided by 6 is 3 with remainder 2, so 20 mod 6 = 2.
More Mathematics Tools
Explore related calculators in this category
Absolute Value Calculator
Calculate the absolute value of any number. Use this free calculator for fast, accurate answers, complete with the formula and a worked example.
Absolute Value Equation Solver
Solve equations of the form |ax + b| = c.
Adding Fractions Calculator
Add two fractions with step-by-step simplification.
One-Way ANOVA Calculator
Perform one-way ANOVA on multiple groups.
You Might Also Like
Popular tools from other categories
AC to DC Converter Calculator
Convert AC voltage to DC voltage for different rectifier configurations. Free online calculator with instant, step-by-step results.
Acid-Base Titration Calculator
Calculate concentration from titration data. Get quick, accurate results with this free online calculator, including formulas and worked examples.
ABV Calculator
Calculate alcohol by volume from original and final gravity. Free calculator with instant calculations, the underlying formula, and an easy-to-follow example.
Amortization Schedule Calculator - Free Online
Free Generate a complete amortization schedule. Step-by-step solutions and formulas included. Free, accurate results with step-by-step explanations.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.