Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
Modulo Calculator

Modulo Calculator

Find the remainder of a ÷ b (a mod b). Enter a dividend and divisor to get the modulo instantly, with a step-by-step breakdown of the quotient and remainder.

Modulo Calculator

The modulo operation, written a mod b, returns the remainder left after dividing a (the dividend) by b (the divisor). This calculator gives the remainder the moment you type and walks you through the division step by step, so it fits programming, math homework, and anyone learning how remainders work.

Formula: if a = b × q + r, then a mod b = r. For example, 17 mod 5 = 2 because 17 = 5 × 3 + 2.

Where the Modulo Operation Is Used

Even / Odd Checks

A number is even when n mod 2 = 0 and odd when n mod 2 = 1 — a one-line test in any language.

Clock Arithmetic

Hours, days, and cyclic patterns wrap around with modulo, e.g. 14 mod 12 = 2 on a 12-hour clock.

Hashing & Cryptography

Hash tables and cryptographic algorithms rely on modular arithmetic to map and secure data.

How to Calculate a mod b

1

Enter the Dividend (a)

Type the number you want to divide. Whole numbers and decimals are both accepted.

2

Enter the Divisor (b)

Type the number to divide by. The remainder of a ÷ b is what the calculator returns.

3

Read a mod b

The remainder appears on the formula line instantly and recalculates as you change either value.

4

Check the Explanation

The explanation panel shows a ÷ b, the integer quotient, the verification (quotient × b), and the remainder subtraction.

Sign matters: with a negative dividend the remainder follows the dividend's sign, so −17 mod 5 = −2, not 3. Check the explanation to confirm the convention.

Features

Instant Remainder

The remainder updates live as you type the dividend or divisor — no button to press.

Step-by-Step Explanation

See a ÷ b, the integer quotient, the verification quotient × b, and the remainder — not just the final answer.

Decimals & Negatives

Handles fractional and negative values, so 17.5 mod 3 = 2.5 and −17 mod 5 = −2 both work.

Divide-by-Zero Guard

A divisor of 0 is rejected with a clear message, since a mod 0 is undefined.

Worked Examples

ExpressionResultWhy
17 mod 5217 = 5 × 3 + 2
10 mod 3110 = 3 × 3 + 1
15 mod 5015 divides evenly
7 mod 217 is odd
−17 mod 5−2Remainder takes the dividend's sign
17.5 mod 32.5Decimals are supported
Private by design: every calculation runs locally in your browser — nothing you type is uploaded.

Frequently Asked Questions

What is the modulo operation?

Modulo (mod) gives the remainder after division. For example, 17 mod 5 = 2 because 17 = 5 × 3 + 2. It answers "what is left over?" once the divisor has gone in as many whole times as possible.

What is the difference between modulo and remainder?

For positive numbers they are the same value. The terms diverge only with negative operands, where different conventions can give different signs. This tool computes the remainder that takes the sign of the dividend.

How does modulo work with negative numbers?

This calculator follows the convention where the remainder takes the sign of the dividend, so −17 mod 5 = −2. Some languages such as Python floor instead and return 3, so always check how your specific language defines the operation.

Can I use decimals in the modulo calculator?

Yes. Both the dividend and divisor accept fractional values, so 17.5 mod 3 = 2.5. The remainder is the amount left after the divisor fits a whole number of times.

Can the divisor be zero?

No. Division by zero is undefined, so a mod 0 has no valid result. The calculator rejects a divisor of 0 with a clear message — always use a non-zero divisor.

log₁₀(x) = ?
-
n! = ?
-
Calculation Steps
|x| = ?
-
0
round()
Nearest
-
floor()
Round Down
-
ceil()
Round Up
-
trunc()
Truncate
-
mod
a mod b = ?
-
Explanation
Enter dividend (a) and divisor (b) — the result updates as you type
a mod b = the remainder left after dividing a by b
Read the explanation for the quotient, verification, and remainder
Works with decimals and negative numbers (step "any")
A divisor of 0 is rejected — you cannot divide by zero
Want to learn more? Read documentation →
1/6
Start typing to search...
Searching...
No results found
Try searching with different keywords