My Tools Garage

Modulo Calculator

Find the remainder and true modulo of any division.

in-browser

How to use

  1. 1 Enter the dividend (the number being divided).
  2. 2 Enter the divisor (the number you divide by).
  3. 3 Read the remainder, Euclidean modulo and quotient.
  4. 4 Copy the result if you need it elsewhere.

About Modulo Calculator

The Modulo Calculator finds what is left over when one number is divided by another.

Enter a dividend and a divisor and it returns three values at once: the remainder, the mathematical (Euclidean) modulo, and the integer quotient.

The distinction matters more than people expect.

Most programming languages, including JavaScript, treat the percent sign as a remainder whose sign follows the dividend, so -7 % 3 gives -1.

Mathematicians, and many algorithms such as hashing, clock arithmetic and cyclic indexing, want the Euclidean modulo, which is always in the range zero up to but not including the divisor, so -7 mod 3 gives 2.

This tool shows you both so you never have to guess which convention a formula assumes.

It works with negative numbers and decimals, and it tells you plainly when the divisor is zero rather than returning a confusing NaN.

Everything runs locally in your browser with no calls to a server, so your numbers stay on your device and the calculator keeps working offline once loaded.

It is handy for students learning number theory, developers debugging off-by-one wrap-around bugs, and anyone converting between time zones, angles or array indices.

FAQ

Why are the remainder and modulo sometimes different?

The remainder takes its sign from the dividend (like the % operator), while the Euclidean modulo is always non-negative. For positive inputs they match; for negative inputs they can differ.

Does it support decimals and negative numbers?

Yes. You can use negative dividends or divisors and decimal values; only division by zero is rejected.