Skip to main content

Modulo Calculator

Calculate the remainder of integer division.

Reviewed for accuracy by the Math Ora X team Last updated

Result

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

  1. Enter the dividend, the number you want to divide, as \(a\).
  2. Enter the divisor, the number you are dividing by, as \(b\).
  3. Click calculate to find the remainder \(r\).
  4. 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

  1. Divide \(a\) by \(b\) and find the whole-number quotient.
  2. Multiply the quotient by \(b\).
  3. Subtract that product from \(a\) to get the remainder.

Worked example

Problem. Find \(47 \mod 5\).

  1. Divide 47 by 5. The quotient is 9 because \(5 \times 9 = 45\).
  2. Subtract 45 from 47, so \(47 - 45 = 2\).
  3. 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

You Might Also Like

Popular tools from other categories

Can't Find the Right Calculator?

Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.

Try AI Solver

Browse All Categories

Home Mathematics Current Tool
Facebook Twitter WhatsApp