How it works
Divide whole numbers, including negative ones, and get the quotient and remainder with the a = b × q + r check, plus the remainders returned by % in C, Java and JavaScript and by MOD in Python and Excel.
Inputs and units
| Input | Example value | What to enter |
|---|---|---|
| Dividend (a) | 100 | Enter a numeric value. Use a whole number. |
| Divisor (b) | 7 | Enter a numeric value. Use a whole number. |
Worked example
Show example inputs and results
This example is generated by the same calculation engine using the starting values in the form. Your own inputs produce your own result.
- Dividend (a)
- 100
- Divisor (b)
- 7
Complete example results
- Remainder (r)
- 2
- Quotient (q)
- 14
- Check: a = b × q + r
- 100 = 7 × 14 + 2
- Exact quotient a ÷ b
- 14.28571429
- Remainder with % in C, Java, JavaScript
- 2
- Remainder with MOD in Python and Excel
- 2
Reading the result
Use quantities on the same basis. The starting value in percentage change, the denominator in a ratio and the length unit in geometry determine the meaning of the answer. Check the formula conditions alongside the example.
How to find the remainder
Find how many whole times the divisor fits into the dividend, then subtract. For 100 ÷ 7, 7 fits 14 times (7 × 14 = 98), so the remainder is 100 − 98 = 2. The check line confirms it: 100 = 7 × 14 + 2. The remainder is always smaller than the divisor; if it is not, the quotient was too small.
Remainder of a negative number
Conventions differ once a number is negative. For −15 ÷ 7, the mathematical (Euclidean) remainder is 6, because −15 = 7 × (−3) + 6 and remainders are kept between 0 and the divisor. The % operator in C, Java and JavaScript gives −1 instead, because it truncates the quotient to −2. Python’s % and Excel’s MOD give 6 here; with a negative divisor they follow the divisor’s sign. The calculator shows all three so you can match the tool you use.
Modulo in everyday problems
Clocks, calendars and repeating cycles are remainder problems. 5 hours after 10 o’clock is 15 mod 12 = 3 o’clock. 100 days after a Monday is a Wednesday, because 100 mod 7 = 2. A number is even when n mod 2 = 0, and n mod 10 is its last digit.
Remainder or decimal part?
100 ÷ 7 = 14.2857…, but the remainder is 2, not 0.2857. The two are linked: the decimal part multiplied by the divisor gives the remainder (0.2857… × 7 = 2). Use the remainder for leftover items or cycle positions, and the exact quotient when you need a fraction of a whole.
Compare different scenarios
Inputs held constant: Divisor (b): 7.
| Dividend (a) | Remainder (r) | Quotient (q) | Remainder with % in C, Java, JavaScript |
|---|---|---|---|
| 15 | 1 | 2 | 1 |
| 100 | 2 | 14 | 2 |
| -15 | 6 | -3 | -1 |
| -100 | 5 | -15 | -2 |
Questions and answers
Can I use the example values for my own calculation?
The example values illustrate the calculation. Replace every input with your own information, especially dates, rates and the selected operation.
Why are some results rounded?
Results display up to 8 decimal places. Calculations use the unrounded values; very small values use scientific notation. JavaScript floating-point arithmetic can introduce tiny rounding differences.
Are my inputs sent to a server?
The calculator processes inputs in your browser. Its code does not send your values to a server.