Math

Modulo Calculator

Remainder after division.

Enter your values

ⓘ Live results

Results
a mod n
3
Programming remainder (a % n)
3
Quotient (floor)
6
Exact division
6.75
Divides evenly?
No

Quick answer

The modulo operation returns the remainder left after dividing one number by another.

a mod n = a − n⌊a/n⌋

How to use the Modulo Calculator

  1. 1Enter the number being divided.
  2. 2Enter the divisor.
  3. 3Compare the true modulus with the programming remainder.

Worked example

Using the values the calculator loads with:

Inputs

  • Dividend a27
  • Divisor n4

Results

  • a mod n3
  • Programming remainder (a % n)3
  • Quotient (floor)6
  • Exact division6.75
  • Divides evenly?No

Frequently asked questions

Why do negatives differ?

Most programming languages keep the sign of the dividend; mathematics returns a non-negative result.

What is modulo used for?

Clock arithmetic, hashing, cycling through lists and checking divisibility.

About this calculator

Results are estimates for general information. For medical, legal, structural or financial decisions, confirm with a qualified professional.