yCalculator

Modulo Calculator

Last updated: April 2026

Modulo calculator

a mod n is the remainder when a is divided by n. In programming it is often written as a % n.

Modulo result

17 mod 5 = 2

Quotient

3

Remainder

2

Verification

5 x 3 + 2 = 17

Modulo with negative numbers varies by programming language

-7 mod 3 in Python
2 (floored)

-7 % 3 in JavaScript
-1 (truncated)

-7 mod 3 in mathematics
2 (Euclidean)

Step-by-step working
  1. Step 1: 17 / 5 = 3.4.
  2. Step 2: Truncated division gives quotient q = 3.
  3. Step 3: r = a - n x q = 17 - 5 x 3 = 2.
  4. Result: 17 mod 5 = 2.
  5. Verify: 5 x 3 + 2 = 17.

What is modulo?

Modulo is the remainder after division. For example, 17 divided by 5 gives quotient 3 with remainder 2, so 17 mod 5 equals 2.

Modulo in programming

Many programming languages use the % symbol for modulo or remainder. Be careful with negative numbers: JavaScript uses truncated division, while Python uses floored division.

Clock arithmetic and modular arithmetic

Clock arithmetic is modular arithmetic in daily life. After 12 o'clock, the next hour wraps back to 1 instead of continuing to 13.

Negative numbers and modulo

Different systems choose different quotients for negative divisions, which changes the remainder. Euclidean modulo keeps the remainder non-negative, which is often the cleanest choice in mathematics.

What does this mean?

This calculator is designed to help you understand the likely number before you make a decision or start an application.

Your result should be checked against official UK guidance, especially if your circumstances include dependants, exemptions, prior leave, or a complex immigration history.

Treat the figure as a planning tool rather than legal advice. Where the answer affects an application deadline or major payment, speak to an authorised adviser.

Related Math calculators

math calculators

Triangle Calculator

Solve any triangle using SSS, SAS, ASA, AAS, SSA, right triangle, and Pythagorean theorem modes

Calculate →

math calculators

Area Calculator

Calculate the area of common 2D shapes with formula substitutions and unit conversions

Calculate →

math calculators

Volume Calculator

Calculate the volume and surface area of common 3D shapes with full working and practical litre conversions

Calculate →