percent

Modulo Calculator

Calculate the remainder of division (modulo operation). Find mod of any two numbers.

mod
=
?
Try:
help_outline

How to Use

expand_more
  1. Enter the dividend (the number to be divided)
  2. Enter the divisor (the number to divide by)
  3. Click "Calculate" to find the remainder
  4. View the quotient and verification
info

What is Modulo Calculator?

expand_more

The modulo operation (mod) finds the remainder after division of one number by another. For example, 17 mod 5 = 2 because 17 ÷ 5 = 3 remainder 2. It's widely used in computer science, cryptography, and mathematics.

functions

Formula

expand_more

A mod B = Remainder

Verification: Quotient × B + Remainder = A

Example: 17 mod 5 = 2 (because 3 × 5 + 2 = 17)

lightbulb

Examples

expand_more
  • 17 mod 5 = 2 (17 = 3×5 + 2)
  • 100 mod 7 = 2 (100 = 14×7 + 2)
  • 25 mod 4 = 1 (25 = 6×4 + 1)
  • 12 mod 3 = 0 (exactly divisible)
quiz

FAQ

expand_more
What is modulo used for in programming?expand_more
Modulo is used to check if a number is even or odd (n % 2), to wrap around arrays (circular buffers), to limit values within a range, and in hash functions.
How does modulo work with negative numbers?expand_more
Different programming languages handle negative modulo differently. In mathematics, the result typically has the same sign as the divisor. This calculator shows both the programming result and mathematical result when they differ.
What does it mean when the result is 0?expand_more
A result of 0 means the dividend is exactly divisible by the divisor with no remainder. For example, 12 mod 4 = 0 because 12 = 3×4 exactly.