Your files stay on your device Modulo calculator Compute a mod n with quotient and remainder under Euclidean, floored, or truncated rules, plus modular powers and inverses for very large numbers. Enter a number and a divisor. The three conventions disagree only when a is negative, which is the whole lesson: JavaScript, Java, and C truncate toward zero so the remainder takes the sign of a; Python and Excel MOD floor so it takes the sign of n; mathematics (Euclidean division) keeps the remainder in 0..|n|−1 no matter what. All three are shown for every run so the difference is visible, not described. The modular inverse exists only when gcd(a, n) is 1, and this tool refuses instead of guessing when it is not. Options More unit & math tools - Primes, GCD, and LCM (/converters/primes) - Fraction calculator (/converters/fractions) All unit & math tools (/converters) Was this tool useful? YesNo Canonical HTML: https://nutter.tools/converters/modulo-calculator Markdown version: https://nutter.tools/converters/modulo-calculator.md Plain-text version: https://nutter.tools/converters/modulo-calculator.txt Agent index: https://nutter.tools/llms.txt