Modulo Calculator

Written by:
PK

Calculate the remainder of division, also known as modulo or mod. Enter two numbers and see the remainder, quotient, and the equation breakdown.

Modulo calculator

Using the calculator

Enter a Dividend (the number being divided) and a Divisor (the number you're dividing by). The calculator updates in real-time.

You'll see:

  • Remainder (Modulo) - the main result, what's left after division
  • Quotient - how many times the divisor fits into the dividend (integer part)
  • Exact division - the full decimal result
  • Equation breakdown - shows the relationship: dividend = divisor × quotient + remainder

What is modulo?

Modulo (or "mod") gives you the remainder after division. When you divide 17 by 5:

  • 5 goes into 17 three times (5 × 3 = 15)
  • That leaves 2 remaining (17 - 15 = 2)
  • So 17 mod 5 = 2

Written mathematically:

17 \mod 5 = 2

Or using the programming notation:

17\ \%\ 5 = 2

The division equation

Every division can be expressed as:

dividend = divisor \times quotient + remainder

The modulo operation extracts just the remainder part.

Common uses

Checking divisibility - if a mod b = 0, then a is divisible by b. For example, 15 mod 5 = 0, so 15 is divisible by 5.

Even/odd check - if n mod 2 = 0, n is even. If n mod 2 = 1, n is odd.

Clock arithmetic - 14:00 in 12-hour format is 14 mod 12 = 2 (2 PM).

Cryptography - modular arithmetic is fundamental to encryption algorithms like RSA.

Programming - cycling through arrays, distributing items, hash functions.

Negative numbers

This calculator uses floored division, which keeps the remainder the same sign as the divisor. For -17 mod 5, you get 3 (not -2). This matches the mathematical convention and languages like Python.

Some programming languages (C, Java, JavaScript's %) use truncated division instead, which can give negative remainders. If you're debugging code, be aware of which convention your language uses.

      

PK

PK started DQYDJ in 2009 to research and discuss finance and investing and help answer financial questions. He's expanded DQYDJ to build visualizations, calculators, and interactive tools.

PK lives in New Hampshire with his wife, kids, and dog.

Don't Quit Your Day Job...

DQYDJ may be compensated by our partners if you make purchases through links. See our disclosures page. As an Amazon Associate we earn from qualifying purchases.
Sign Up For Emails
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram