NordVPN
SponsoredStrict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →A free online modulo calculator that computes a mod b, the remainder left after dividing a by b. Enter a dividend and a non-zero divisor to get the result instantly.
Enter a value for a and a non-zero value for b.
The modulo operation, written a mod b, returns the remainder after dividing a by b. For example, 17 mod 5 equals 2, because 17 divided by 5 is 3 with 2 left over.
The divisor b must not be zero, since division by zero is undefined.
Modulo is everywhere in math and programming: checking even or odd numbers, wrapping array indices, building hash tables, and clock arithmetic.
It is also the foundation of modular arithmetic used in cryptography and number theory.
It is the remainder left after dividing a by b. For example, 17 mod 5 equals 2.
Division by zero is undefined in mathematics, so the divisor b must be a non-zero number.
Results follow standard math conventions; the sign of the remainder may differ from some programming languages.
For positive operands, the remainder is always between 0 and b minus 1.
Common uses include checking even or odd numbers, cycling through indices, and hashing.
Strict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Managed cloud hosting for WordPress and web apps on DigitalOcean, Vultr, and AWS. Fast setup, no server headaches.
Try Cloudways →