mod Modulo Calculator

Calculate the mathematical modulo of one number by another using the floor-based definition.

No ratings yet — be the first

Enter details

Modulo
mod= ?
  • Number
  • Modulus — Enter a non-zero modulus.

Log in or create a free account to save your inputs and results, so you don't have to enter them again next time.🔒 No spam, ever. We never sell or share your details, and you can delete your history or account at any time. Privacy policy

Fill in the details and click Calculate to see your results.

Formula at a glance

Modulo formula: q = floor(n ÷ m); n mod m = n − m × floor(n ÷ m)
How the modulo works: q = floor(n ÷ m)

Rate this calculator

Was it useful? A quick star rating helps others — and you can leave a comment too.
Rate it: ★ ★ ★ ★ ★

📘 About the Modulo Calculator

Modulo describes the remainder under a mathematical floor-based definition.

It is useful for repeating cycles, divisibility and modular arithmetic.

🧮 Formula

Floor quotient
q = floor(n ÷ m)
Modulo
n mod m = n − m × floor(n ÷ m)

Where

  • n = number
  • m = modulus
The modulus should be non-zero.

✏️ Worked examples

123 mod 10

You enter
Number123
Modulus10
You get
123 mod 103
Quotient12
Check123 = 10 × 12 + 3
Remainder in C, Java, JavaScript (a % m)3

3.

17 mod 5

You enter
Number17
Modulus5
You get
17 mod 52
Quotient3
Check17 = 5 × 3 + 2
Remainder in C, Java, JavaScript (a % m)2

2.

−7 mod 3

You enter
Number-7
Modulus3
You get
-7 mod 32
Quotient-3
Check-7 = 3 × -3 + 2
Remainder in C, Java, JavaScript (a % m)-1

2 (programming % gives -1).

🧭 How to use this calculator

What you enter

  • Number
  • ModulusEnter a non-zero modulus.

What you get

  • Modulo Result
  • Floor Quotient

💡 Common uses

  • Checking whether numbers divide evenly.
  • Repeating schedules and cycles.
  • Modular arithmetic.
  • Computer science and programming concepts.

❓ Frequently asked questions

What does modulo mean?

Modulo gives the remainder under a specified mathematical definition of division.

What is 17 mod 5?

It is 2.

Can modulo work with negative numbers?

Yes. This calculator uses the floor-based mathematical definition.

What is 123 mod 10?

3. 123 ÷ 10 = 12 remainder 3, so 123 mod 10 = 3. Any number mod 10 is its last digit.

What is −7 mod 3?

2 in mathematics (−7 = 3 × −3 + 2). Many programming languages return −1 for −7 % 3.