Modulo Calculator

Enter a number and a modulus to find the remainder, or add an exponent for a power mod n.

Any whole number, positive or negative.

A whole number other than 0.

Try

Result

You entered100 mod 7100 \bmod 7

100 mod 7=2\displaystyle 100 \bmod 7 = 2

Quotient

14\displaystyle 14

Truncated remainder

2\displaystyle 2

Congruence

100≡2(mod7)\displaystyle 100 \equiv 2 \pmod{7}
Show the work
  1. Division algorithm

    Dividing aa by nn and rounding the quotient down to a whole number qq leaves a remainder rr that is never negative. Here a=100a = 100 and n=7n = 7.

    Using a=n×q+r,0≤r<na = n \times q + r, \quad 0 \le r < n

    q=⌊1007⌋=14\begin{aligned} q &= \left\lfloor \frac{100}{7} \right\rfloor \\ &= 14 \end{aligned}
  2. Remainder from the quotient

    The remainder is what is left of aa after taking away qq whole copies of nn. Here q=14q = 14, so rr lands between 00 and 66.

    r=a−n×q=100−7×14=100−98=2\begin{aligned} r &= a - n \times q \\ &= 100 - 7 \times 14 \\ &= 100 - 98 \\ &= 2 \end{aligned}
  3. Result

    So 100 mod 7=2100 \bmod 7 = 2.

Worked examples