Modulo Calculator
Work out a mod n and the remainder, with the whole-number quotient and the working, exact for huge numbers, negatives and decimals.
Runs in your browser. Nothing leaves this device.
How to use Modulo Calculator
- 1Type the number to divide (a) and the number to divide by (n).
- 2Read a mod n, the quotient and the line of working.
- 3For negative numbers, compare the three answers that different languages give.
Questions
Why are there different answers for negative numbers?
They agree when both numbers are positive. With a negative number, Python and Excel round the quotient down, so the result takes the sign of n. C, Java and JavaScript round toward zero, so the remainder takes the sign of a. The Euclidean answer is never negative.
What is -7 mod 3?
It is 2, because -7 = 3 × (-3) + 2. The % operator in C, Java and JavaScript gives -1 instead, because -7 = 3 × (-2) + (-1).
Does it work with very large numbers and decimals?
Yes. It uses exact whole-number arithmetic with no size limit, and decimals like 5.5 mod 2 are worked out exactly too.
Are my numbers sent anywhere?
No. Everything is worked out in your browser.
Is it free?
Yes. No account, no watermark and no daily limit.
Related tools
- StudyAttendance CalculatorFind your attendance percentage, how many classes you can still miss and stay at 75%, or how many you must attend in a row to get back to it.
- StudyCGPA & GPA CalculatorWork out your SGPA and CGPA on the Indian 10-point scale, or your GPA on the US 4.0 scale, weighted by credits.
- StudyCGPA to Percentage ConverterConvert a CGPA to a percentage, or a percentage to a CGPA, with the CBSE, AICTE, Mumbai University or plain formula.
- StudyCitation Generator (APA, MLA, IEEE, Harvard, Chicago)Make references in APA 7, MLA 9, IEEE, Harvard and Chicago for books, articles, chapters and web pages, and keep a bibliography.
- StudyClass Timetable MakerMake a weekly class timetable with your own days, periods and breaks. Subjects get colour tags. Save it as a PNG or print it.
- StudyExam CountdownCount down the days and hours to each exam, see how many study days you have left, and add every exam to your calendar.