calcula·ro200+
Salary & Work 18 Net salaryGross (from net)Advanced net salaryΣTotal employer costMinimum wageMeal vouchersSalary raise simulator See all (18)
Taxes 17 %VAT calculatorIncome taxDividend taxCar taxRental income taxMicro-company taxCorporate profit tax See all (17)
Credit 16 MortgageConsumer loanCar loanRefinancing%Effective APRHow much can I borrow?Early repaymentAmortization table See all (16)
Finance 20 Compound interestSavings simulatorCurrency converterGold priceInflationTerm deposit%Investment ROICAGREmergency fund See all (20)
Health 19 BMIIdeal weightDaily calories (TDEE)Daily water intakeBMR See all (19)
Math 22 %PercentagesRule of threeAverage & statisticsPower & rootUnit conversionsArea & perimeter See all (22)
Time & Date 23 Date differenceExact ageWorking days±Add / subtract dateCountdownDays until…Sunrise & sunset See all (23)
Education 12 Term averageBaccalaureate averageWeighted averageHigh-school admission scoreNational evaluation averageGraduation average See all (12)
Auto & Travel 15 Fuel consumptionTrip costSpeed / time / distanceRCA insuranceCar taxDistance between cities See all (15)
Real Estate & Business 15 Notary purchase fees%Agent commissionBuilt / usable areaDiscountProfit marginPrice per m² See all (15)
Legal 9 §Legal term (days)%Legal interestChild supportCourt stamp dutyStatute of limitations See all (9)
Insurance & Misc 14 Home insurance (PAD)Life insuranceAC BTUHTML color codePassword generatorSplit the billGenerationTip calculatorZodiac sign See all (14)
All calculators
Home/Math/Modular Arithmetic Calculator
Advertisement 320 × 50 mobile only · sticky top
Math · Updated 2026

Modular Arithmetic Calculator

Instantly calculate the remainder (a mod n) and the modular power (aᵇ mod n), useful in programming and cryptography.

Enter values

The remainder of a divided by n. The result is always between 0 and n−1.

=Result
3
Quotient (a ÷ n)2
Result3

17 mod 7 = 3

Full embed page →

Standard mathematical formulas. Instant in-browser calculation, no account. Exact results for the values you enter.

Advertisement 728 × 90320 × 250 desktop 728×90 sticky · mobile 320×250

iHow it is calculated

The modulo operation gives the remainder of a division. The result is always between 0 and n−1, “wrapping around” like clock hands:

a mod n = a n × ⌊a ÷ n⌋

17 mod 5 = 2 (quotient 3, remainder 2). Modular power: 2¹⁰ mod 7 = 1024 mod 7 = 2.

Advertisement 728 × 90320 × 250 desktop 728×90 sticky · mobile 320×250

?Frequently asked questions

What is the modulo operation (remainder)?

The operation “a mod n” gives the remainder of a divided by n. For example, 17 mod 5 = 2, because 17 = 3 × 5 + 2.

How do I calculate a mod n?

Divide a by n and keep the remainder. The calculator shows it directly, along with the integer quotient.

What is 17 mod 5?

17 mod 5 = 2. The quotient is 3, and the remainder (the modulo result) is 2.

What is modular arithmetic?

A system where numbers “wrap around” after reaching the modulus, like clock hands (mod 12 or 24). 14:00 = 2 in the afternoon.

What is modular power (aᵇ mod n)?

It computes aᵇ and then the remainder modulo n, efficiently even for large exponents. It is essential in cryptography (e.g. RSA).

Why is the remainder always between 0 and n−1?

Because the remainder is what is left after subtracting all whole multiples of n; it cannot reach n, otherwise one more multiple would fit.

How does modulo work with negative numbers?

This calculator always returns a non-negative remainder: −1 mod 5 = 4. This keeps the result within 0…n−1.

What is modular arithmetic used for?

Cryptography, hash functions, pseudo-random number generation, check digits (ISBN, IBAN) and computing days of the week.

Advertisement 728 × 90320 × 250 desktop 728×90 sticky · mobile 320×250

Related tools

200 tools · 12 categories

Explore all calculators

All calculators (200) →
Advertisement 320 × 50