Quotient and remainder with a = q times b + r, long division written out, and the sign conventions for negative numbers.
Procedure
How it works
Euclidean division splits a whole number $a$ by a non-zero $b$ into a quotient $q$ and a remainder $r$ with $a = q \cdot b + r$ and $0 \le r < |b|$. These two conditions fix $q$ and $r$ uniquely: $1234 = 176 \cdot 7 + 2$.
For small numbers the quotient comes from long division as taught at school: take digits from the left until $b$ fits, write down how often it fits, subtract, bring down the next digit, and repeat. The last difference is the remainder.
With negative numbers the quotient must be rounded, and there are several habits. The Euclidean convention keeps $r \ge 0$, so $-17 = -4 \cdot 5 + 3$. C and Java round toward zero and get $-17 = -3 \cdot 5 - 2$; Python rounds down, which gives the remainder the sign of $b$. The nearest convention gives the smallest remainder in absolute value, between $-|b|/2$ and $|b|/2$; lattice cryptography uses it to round coefficients to the centre.
Everything is calculated in your browser. Nothing you type leaves your device.