What Is Modular Arithmetic?

Learn what modular arithmetic is, how to perform it, and how it’s used in the real world.

Jason Marshall, PhD
5-minute read
Episode #53

What is Modular Arithmetic?

Modular arithmetic is one of those things in math that sounds like it should be really hard but actually isn’t too tough once you know what it is. In fact, I guarantee that modular arithmetic is something that you use every single day. Don’t believe me? Well, keep on reading because today we’re talking about what modular arithmetic is, how to do it, and where it shows up in the real world.

What Is Cyclical Arithmetic?

If you can tell time, then you can perform modular arithmetic. Time keeps going on and on (possibly forever), but as you’ve probably noticed, clocks don’t have an infinite number of numbers on them. On a normal 12-hour clock, the time goes from 1 to 2, then 2 to 3, then 3 to 4, and so on, up until it goes from 11 to 12, and then from 12 back to 1 again. In other words, we use a system with only 12 numbers for keeping track of hours of time. After the clock’s hand swings around those 12 hours, it starts over at 1 again.

And it’s not just the numbering of the hours that goes in a cycle, the numbering of the minutes in an hour and the seconds in a minute are cyclical too—both of these count from 1 up to 60 and then come back to 1 again. Want more examples? Well, the numbering of the days in a week goes from 1 to 7 and then back to 1 again. The numbering of days in a year goes from 1 to 365 (except in a leap year) and then back to 1 again. And the utility of this type of cyclical arithmetic isn’t just confined to keeping track of time—it has many other uses too.

What Is Modular Arithmetic?

But what does all this have to do with math? Well, it turns out that each example of cyclical counting that we’ve talked about so far can be described in terms of a type of math called modular arithmetic. Here’s the gist: You can think of modular arithmetic as a system of arithmetic for integers where the number line isn’t an infinitely long and straight line (as we’ve talked about in past discussions of integers), but is instead a line that curves around into a circle. In other words, modular arithmetic is a method for doing addition, subtraction, multiplication, and division with integers where the numbers curve around the number line cyclically instead of continuing on forever.

The length of the circular number line in modular arithmetic is called the modulus. For example, what’s the modulus when we tell time with a 12 hour clock? Well, for the hours, the modulus is 12 since there are 12 different numbers that the hour hand swings through before starting over again. And for the minutes and seconds, the modulus is 60 since there are 60 numbers that each of those hands swing through.


About the Author

Jason Marshall, PhD

Jason Marshall is the author of The Math Dude's Quick and Dirty Guide to Algebra. He provides clear explanations of math terms and principles, and his simple tricks for solving basic algebra problems will have even the most math-phobic person looking forward to working out whatever math problem comes their way.