Home Math Modulo Calculator (Remainder)

Modulo Calculator (Remainder)

Find the remainder when one whole number is divided by another, and see the two conventions for negative numbers.

Advertisement

How it works

Type the dividend and the divisor, then pick the floored or truncated convention. The page gives the remainder, the quotient, the remainder the other convention would give, and the check line.

Advertisement

Formula

Quotient q = the whole part of a divided by n, floored or truncated.
Remainder r = a - n x q.
Check: a = n x q + r.

Sources

Example

Dividend a: -17; Divisor n: 5. Remainder: 3

Frequently asked questions

Why do I get two different answers?

For negative numbers, maths floors the quotient and many programming languages truncate it. The page shows both so you can match the tool you are using.

What is the check line for?

It puts the numbers back together as a = n x q + r. If that line is true, the quotient and remainder belong to each other.

Advertisement

Related calculators

Percentage Calculator

Find a percent of a number, what percent one number is of another, and percent change, all at once.

Fraction Calculator

Add, subtract, multiply and divide fractions, with the answer simplified.

Scientific Calculator

Online scientific calculator with trig, logs, powers, roots, factorial and degree or radian mode.

Quadratic Formula Calculator

Solve ax² + bx + c = 0, with the discriminant and the vertex.