Start typing to discover tools…

Modulo Calculator

Calculate the remainder of a division operation accurately. Enter a dividend and divisor to view the modulo result, quotient, formula, and calculation steps.

Calculate a Modulo

Enter positive or negative whole numbers.

A
The number that will be divided.
B
The divisor must not be zero.
Calculation Result
0
Remainder
Integer quotient 0
Positive modulus 0

Calculation step

What Is a Modulo Calculator?

A Modulo Calculator finds the remainder left after dividing one whole number by another. The modulo operation is commonly represented by the word mod or the percentage symbol % in programming.

For example, dividing 17 by 5 produces a quotient of 3 with 2 remaining. Therefore, 17 mod 5 = 2. When the result is zero, the dividend is completely divisible by the divisor.

Instant Calculation

Get the modulo result, quotient, and calculation steps immediately.

Accurate Integers

BigInt technology helps calculate very large whole numbers accurately.

Useful for Coding

Modulo is widely used in loops, validation, scheduling, and algorithms.

How to Use the Modulo Calculator

  1. Enter the dividend, which is the number you want to divide.
  2. Enter the divisor. It can be positive or negative, but it cannot be zero.
  3. Select Calculate Modulo to process the numbers.
  4. Review the remainder, integer quotient, modulus, and calculation step.

How Does the Modulo Operation Work?

The calculator determines how many complete times the divisor fits into the dividend. It then subtracts that multiplied value from the dividend. The amount left after subtraction is the modulo result.

The relationship can be written as:

Dividend = Divisor × Integer Quotient + Remainder

For 23 mod 7, the number 7 fits completely into 23 three times. Multiplying 7 by 3 gives 21, and subtracting 21 from 23 leaves 2. Therefore, 23 mod 7 = 2.

Expression Division Remainder Modulo result
10 mod 3 10 = 3 × 3 + 1 1 1
25 mod 4 25 = 4 × 6 + 1 1 1
48 mod 8 48 = 8 × 6 + 0 0 0
100 mod 9 100 = 9 × 11 + 1 1 1

Common Uses of Modulo

The modulo operation is useful in mathematics, computer science, data processing, and everyday calculations. Common applications include:

  • Checking whether a number is even or odd.
  • Determining whether one number is divisible by another.
  • Repeating values within a fixed cycle.
  • Converting large time values into hours, minutes, or seconds.
  • Alternating rows, colors, or positions in programming.
  • Working with calendars, clocks, and circular data structures.
  • Creating hashing, encryption, and validation algorithms.

Checking Even and Odd Numbers

A number is even when its modulo result with 2 is zero. It is odd when the result is 1. For example, 18 mod 2 = 0, so 18 is even. The expression 19 mod 2 = 1, so 19 is odd.

Checking Divisibility

A modulo result of zero means that the dividend is exactly divisible by the divisor. For example, 35 mod 7 = 0, so 35 is divisible by 7.

This calculator uses a non-negative Euclidean remainder. When a negative dividend is entered, the displayed result remains between zero and one less than the positive modulus.

Frequently Asked Questions

Learn more about modulo calculations, remainders, divisibility, and negative numbers.

Modulo is a mathematical operation that returns the remainder after one number is divided by another. For example, 11 mod 4 equals 3.

Division normally returns a quotient, while modulo returns only the remainder. For 17 divided by 5, the integer quotient is 3 and the modulo result is 2.

No. Division and modulo operations are undefined when the divisor is zero. You must enter a non-zero divisor.

Yes. This calculator accepts negative integers and returns a non-negative Euclidean remainder based on the absolute value of the divisor.

Calculate the number modulo the possible divisor. When the result is zero, the number is exactly divisible by that divisor.

Yes. The calculator uses JavaScript BigInt, allowing it to process whole numbers larger than the standard JavaScript safe-integer limit.