Modulo Calculator

Enter a dividend and a divisor to find the remainder using the Modulo Calculator. Input any two integers — positive or negative — and get back the modulo result (x mod y), the quotient, and a step-by-step proof showing how the division works.

The number to be divided

The number to divide by (cannot be zero)

Results

Remainder (x mod y)

--

Quotient (floor division)

--

Proof

--

Dividend Breakdown

Frequently Asked Questions

What is a modulo operation?

A modulo operation finds the remainder after dividing one number by another. Written as x mod y, it returns the value r such that x = q × y + r, where q is the integer quotient. For example, 17 mod 5 = 2 because 17 = 3 × 5 + 2.

How do you calculate modulo by hand?

Divide the dividend by the divisor and note the whole-number quotient (ignoring the decimal). Then multiply that quotient by the divisor and subtract from the original dividend. The result is your remainder. For 27 mod 6: 27 ÷ 6 = 4 remainder 3, so 27 mod 6 = 3.

What are the components of modulo division?

There are three key components: the dividend (x) — the number being divided; the divisor (y) — the number you divide by; and the remainder (r) — the result of the mod operation. The relationship is always x = (quotient × y) + r.

How much is 17 mod 3?

17 mod 3 = 2. Dividing 17 by 3 gives a quotient of 5 with a remainder of 2, since 5 × 3 = 15 and 17 − 15 = 2.

What happens when the dividend is smaller than the divisor?

When the dividend is smaller than the divisor (e.g. 1 mod 2), the quotient is 0 and the remainder equals the dividend itself. So 1 mod 2 = 1.

Can modulo work with negative numbers?

Yes, but the result depends on the convention used. This calculator uses the truncated division convention (matching most programming languages like JavaScript and C), where the sign of the remainder follows the sign of the dividend. For example, −7 mod 3 = −1 in this convention.

What is modulo congruence?

Two numbers are said to be congruent modulo n if they have the same remainder when divided by n. Written as a ≡ b (mod n), this concept is foundational in number theory and cryptography.

What are common real-world applications of modulo?

Modulo is widely used in programming (e.g. checking if a number is even or odd), clock arithmetic (12-hour time cycles), cryptography (RSA encryption), hash functions, and determining days of the week from a given date offset.

More Math Tools