Modulo Calculator

Find the remainder and quotient when dividing one number by another.

Advertisement
Advertisement

What Is the Modulo Calculator?

The modulo operation finds the remainder after dividing one number by another. This calculator uses the mathematical (floored) definition, which always returns a remainder with the same sign as the divisor — the convention used in most math and computer science contexts.

Formula

a mod n = a − n × ⌊a ÷ n⌋, where ⌊⌋ denotes rounding down to the nearest integer (floor).

How to Use This Calculator

Worked Example

17 mod 5 = 2, since 5 × 3 = 15 and 17 − 15 = 2. For negative numbers, −7 mod 3 = 2 (not −1), because this calculator uses the floored definition.

Tips

Programming languages don't always agree on how modulo handles negative numbers — some (like JavaScript's % operator) return a different sign than the floored definition used here.

Frequently Asked Questions

What does the modulo operation calculate?

The remainder after dividing one number by another — 17 mod 5 = 2.

Where is modulo used practically?

Programming, cryptography, and scheduling patterns like clock arithmetic.

How does modulo work with negative numbers?

Conventions vary by system, so check which convention this calculator follows.

Suggest a Calculator

👋 We noticed you might be using an ad blocker. This site is free thanks to ads — consider allowing them here to support us. Thanks!