Why the answers differ
Every convention agrees on one thing: a = qn + r. The dividend is some whole number of copies of the divisor, plus a remainder. What they disagree about is which whole number.
For −7 and 3, the quotient could be −2 (rounding towards zero), leaving −7 = −2×3 + (−1). Or it could be −3 (rounding down), leaving −7 = −3×3 + 2. Both equations are true. The remainder simply follows whichever quotient you chose.
That is the entire disagreement. It is not about mathematics being unsettled — it is about a rounding decision made when the language was designed, and it only ever shows up when something is negative.
Which one your language uses
Truncated — C, C++, Java, JavaScript, Go, Rust, PHP, Swift. The remainder takes the sign of the dividend, so −7 % 3 is −1.
Floored — Python, Ruby, Perl, and Excel’s MOD function. The remainder takes the sign of the divisor, so −7 % 3 is 2 and 7 % −3 is −2.
Euclidean — number theory, and most proofs. The remainder is always non-negative regardless of either sign, which is the property that makes it useful in arguments.
This is a live source of bugs, and it is worth knowing that Excel disagrees with most of the languages people write next to it: MOD(-7, 3) is 2 in a spreadsheet and −1 in the C-family code reading that spreadsheet.
Clock arithmetic is the whole idea
A twelve-hour clock is arithmetic modulo 12. Nine hours after ten o’clock is seven, because 19 mod 12 = 7 — the numbers wrap.
That picture makes the negative case obvious rather than confusing. Three hours before two o’clock is eleven, and −1 mod 12 = 11. Counting backwards past zero simply continues round the circle; it does not produce a negative hour.
The page draws that circle for any modulus small enough to read. Positive numbers walk forwards round it and negative ones walk backwards, and the position you stop at is the answer.
Where modulo actually gets used
Wrapping an index. (i + 1) % length steps through a list and returns to the start. It is the standard idiom for a carousel, a ring buffer, or a turn order.
Days of the week. Weekdays repeat every 7, so any date arithmetic reduces to a modulo. It is why an ordinary year shifts the calendar by one day: 365 mod 7 = 1.
Check digits. ISBNs, IBANs and credit card numbers all end in a digit chosen so that a weighted sum comes out to a fixed value modulo 10, 11 or 97. A single mistyped digit changes the sum and the check fails.
Hashing and cryptography. A hash table maps a key to a bucket with a modulo. RSA and Diffie–Hellman are arithmetic modulo a large number and nothing else — which is what makes the exponent page worth reading.
Modulo is not the remainder
In everyday use the two words are interchangeable, and for positive numbers they are. For negatives they come apart, and the difference is worth naming.
The remainder is what a division leaves. Since division normally rounds towards zero, the remainder normally takes the sign of the dividend.
The modulus is a position on a cycle of n. Positions on a cycle are not negative — there is no “minus one o’clock” — so the modulus is normally taken non-negative.
Most languages named their operator % and implemented the remainder. Most textbooks wrote “mod” and meant the modulus. That mismatch is the whole reason this page shows both.
The rules it obeys
Modular arithmetic keeps the ordinary rules of addition, subtraction and multiplication. You can reduce at any point without changing the answer, which is what makes it practical.
(a + b) mod n = ((a mod n) + (b mod n)) mod n. The same holds for subtraction and multiplication. Reduce early and often; the result is identical and the numbers stay small.
Division is the exception. There is no dividing by 3 modulo 26 in the ordinary sense. You multiply by the modular inverse instead, and it only exists when the divisor shares no factor with the modulus — which is what the inverse page is about.
Exponents reduce too, but by a different modulus. akmod n depends on k modulo φ(n), not modulo n. Getting that wrong is a common slip, and it is why the exponent page names Euler’s theorem explicitly.
Sources and methodology
The conventions are language specifications rather than opinions — these are the specifications.
Method. The three conventions are derived from one division rather than computed separately: the truncated quotient comes first, the floored quotient is it adjusted when the remainder and the divisor disagree in sign, and the Euclidean quotient is the floored one corrected for a negative modulus. Each is returned with its own a = qn + r written out, and the suite asserts that identity across twenty thousand random pairs with negatives on both sides. That engine is verified on every change against 69 hand-written assertions, including that a = qn + r holds in all three conventions across twenty thousand random pairs, and that the Euclidean remainder always lands in [0, n). The count and the per-case breakdown are published on the formula verification page.
Read the guide
If the question is a school division rather than a congruence — how many times does it go in, and what is left — the Remainder Calculator lays it out that way, with the check and the repeated subtraction.