Get App

Modulo Calculator

mod
Remainder
2

Formula

remainder = dividend − (quotient × divisor)

The modulo operation finds the remainder after division. 17 mod 5 = 2 because 17 ÷ 5 = 3 remainder 2.

How to use

  1. Enter the number being divided in the Dividend field.
  2. Enter the number you divide by in the Divisor field.
  3. Read the leftover Remainder and whole-number Quotient.

Example

With Dividend 17 and Divisor 5, the tool computes 17 - (3 x 5) = 2. So 17 mod 5 = 2, with a quotient of 3.

Frequently Asked Questions

What is 17 mod 5?
17 mod 5 = 2. (17 = 3×5 + 2)
What is modulo used for?
Programming (even/odd checks, circular arrays), cryptography, clock arithmetic, and more.
How does modulo handle negative numbers?
The result depends on the definition used, which is why answers can differ between calculators and programming languages. This tool uses the floored method, so -7 mod 5 = 3 because floor(-7/5) is -2 and -7 - (-2 x 5) = 3. Many languages like C and Java instead return -2, so always check which convention your environment uses.
What is the difference between modulo and the remainder?
For positive numbers they give the same value, so 17 mod 5 and the remainder of 17 divided by 5 are both 2. The difference only appears with negative operands, where modulo follows the sign of the divisor and remainder follows the sign of the dividend. In everyday math with whole positive numbers, you can treat the two terms as interchangeable.

Related Calculators

esc