Modulo-Rechner

Berechne den Rest einer Division — die Modulo-Operation

Modulo Calculator

Calculate the remainder of a division

Modulo Calculator

Find A mod B

Formula
A mod B = A - B x floor(A/B)

What is a Modulo Calculator?

A Modulo Calculator is a math tool that finds the remainder of a division. The modulo operation is written as a mod b (or sometimes a % b in programming). It tells you what’s left over when a is divided by b.

For example, when you divide 17 by 5, you get 3 with a remainder of 2. So: 17 mod 5 = 2. The modulo operation returns that remainder.

Modulo is used in many practical situations:

  • Determining if a number is even or odd (n mod 2)
  • Working with time and cycles (like clocks, repeating patterns)
  • Computer science tasks such as hashing, indexing, and cryptography
  • Finding repeating patterns in math (modular arithmetic)

This calculator makes it easy to compute remainders quickly, especially with large numbers.

How to Use This Modulo Calculator

  1. Enter the dividend (A) -- the number you want to divide (example: 17)
  2. Enter the divisor (B) -- the number you divide by (example: 5)
  3. Click 'Calculate' -- to compute the modulo result
  4. Review the result -- the output shows both the remainder (A mod B) and the quotient (how many times B fits into A)
  5. Try other values -- explore patterns like mod 2, mod 10, or mod 60

Tips:

  • The divisor B should not be 0 (division by zero is undefined)
  • Modulo is commonly used to 'wrap around' within a range (like 0–59 for minutes)
  • If you’re using negative numbers, different systems can handle modulo slightly differently—this calculator follows JavaScript’s convention consistently

Modulo Formulas

Division with Remainder

Any division can be expressed as:

a = b × q + r

a = dividend

b = divisor

q = quotient (whole number result)

r = remainder

Modulo Result

a mod b = r

The remainder from division

Remainder Range

0 ≤ r < |b|

Remainder is always less than the absolute value of b

Common Modulo Patterns

Even / Odd Check

n mod 2

0 → even, 1 → odd

Last Digit

n mod 10

Returns the last digit of n

Time Wrapping

minutes mod 60

Minute-hand position in a cycle

Example Calculations

Example 1: Basic Modulo

Compute: 17 mod 5

Division: 17 ÷ 5 = 3 remainder 2

Check: 5 × 3 = 15, and 17 − 15 = 2

Result: 17 mod 5 = 2

Example 2: Check Even or Odd

Compute: 29 mod 2

Division: 29 ÷ 2 = 14 remainder 1

Reasoning: Remainder is 1 → 29 is odd

Result: 29 mod 2 = 1

Example 3: Modulo 10 (Last Digit)

Compute: 347 mod 10

Division: 347 ÷ 10 = 34 remainder 7

Reasoning: The remainder matches the last digit

Result: 347 mod 10 = 7

Example 4: 'Wrap Around' Time

Problem: A digital clock uses a 12-hour cycle. It’s 9 o’clock now. What time is it in 8 hours?

Calculation: (9 + 8) = 17

Modulo: 17 mod 12 = 5

Result: 5 o’clock

Frequently Asked Questions

What does 'mod' mean?

'Mod' means modulo, which returns the remainder after division. For example, 10 mod 3 = 1 because 10 ÷ 3 leaves a remainder of 1.

Is modulo the same as division?

Not exactly. Division gives the quotient (how many times a number fits), while modulo gives the remainder. You often use them together when you need both the quotient and what’s left over.

Why is modulo useful?

Modulo is useful for repeating cycles (time, rotations, repeating patterns), checking even/odd, limiting values to a range (like 0–59), and many programming and math applications.

What happens if the divisor is 0?

Modulo by 0 is undefined, because division by 0 is undefined. The calculator will not return a result if you enter 0 as the divisor.

How does modulo work with negative numbers?

Different systems define negative modulo differently (some use the sign of the dividend, some the divisor). If you use negative numbers, make sure you understand the convention used by the calculator and keep it consistent in your work.

Embed This Modulo Calculator on Your Website

Want to add this modulo calculator to your website? Get a custom embed code that matches your site's design and keeps visitors engaged.

Responsive design
Custom styling
Fast loading
Mobile optimized

Was ist die Modulo-Operation?

Die Modulo-Operation findet den Rest, wenn eine Zahl durch eine andere geteilt wird. Sie wird als a mod n geschrieben (oder a % n in der Programmierung) und gibt zurueck, was uebrig bleibt, nachdem a so oft wie moeglich durch n geteilt wurde. Zum Beispiel: 17 mod 5 = 2, weil 17 = 3x5 + 2. Das Ergebnis ist immer eine nicht negative ganze Zahl kleiner als der Divisor — mod 5 liefert also immer einen Wert zwischen 0 und 4.

Modulo begegnet uns ueberall in der Programmierung: pruefen ob eine Zahl gerade ist (n % 2 == 0), durch eine Liste von Optionen rotieren (Index % Laenge), Hash-Funktionen aufbauen und Uhrzeiten-Arithmetik (die Zeit laeuft bei 12 oder 24 um). Es ist eine der nuetzlichsten Operationen in der Informatik und Mathematik. Dieser Rechner verarbeitet sowohl positive als auch negative Eingaben und zeigt die vollstaendige Berechnung.

So verwendest du den Modulo-Rechner

  1. Gib den Dividenden ein — die Zahl, die geteilt wird (a).
  2. Gib den Divisor ein — den Modulus (n).
  3. Klicke auf Berechnen.
  4. Lies den Rest ab — das ist dein Modulo-Ergebnis.

Formel und Beispiele

a mod n = a - n x floor(a / n) Beispiele: 17 mod 5 = 2 (17 = 3x5 + 2) 20 mod 4 = 0 (20 = 5x4 + 0, genaue Teilung) 7 mod 3 = 1 (7 = 2x3 + 1) Gerade/ungerade pruefen: n mod 2 = 0 -> gerade n mod 2 = 1 -> ungerade Uhrzeiten-Arithmetik (12-Stunden): 14 mod 12 = 2 -> 14 Uhr = 2:00 PM

Das Ergebnis von a mod n erfuellt immer 0 <= Ergebnis < n (fuer positives n). Das Verhalten bei negativen Zahlen variiert je nach Programmiersprache — einige verwenden die Boden-Division (Python), andere die abgeschnittene Division (C, Java, JavaScript), die negative Reste erzeugen kann.

Praxisbeispiele

100 mod 7 = 2

100 = 14x7 + 2. Nuetzlich, um 100 Elemente gleichmaessig auf 7 Gruppen zu verteilen — du haettest 14 volle Gruppen mit 2 uebrig bleibenden Elementen.

256 mod 16 = 0

256 ist ein genaues Vielfaches von 16, also ist der Rest 0. Das tritt staendig in der Hexadezimal- und Binaermathematik auf — Zweierpotenzen teilen sich gegenseitig ohne Rest.

29 mod 12 = 5

Uhrzeiten-Arithmetik: 29 Stunden nach Mittag ist es 5:00 Uhr am naechsten Morgen. Die Modulo-Operation ist das, was zirkulaere Zeitberechnungen moeglich macht.

Haeufig gestellte Fragen

Was bedeutet mod in der Programmierung?
In den meisten Programmiersprachen ist der Operator % der Modulo- (oder Rest-)Operator. Zum Beispiel gibt 10 % 3 den Wert 1 zurueck, weil 10 geteilt durch 3 einen Rest von 1 laesst. Er wird staendig verwendet, um Teilbarkeit zu pruefen, Indizes einzuwickeln und Werte zu durchlaufen.
Was ist der Unterschied zwischen Modulo und Rest?
Fuer positive Zahlen sind sie identisch. Der Unterschied zeigt sich bei negativen Zahlen. Das mathematische Modulo gibt immer ein nicht negatives Ergebnis zurueck (Boden-Division), waehrend der Rest in der Programmierung negativ sein kann (abgeschnittene Division). Zum Beispiel: -7 mod 3 = 2 mathematisch, aber -7 % 3 = -1 in JavaScript und C.
Was sagt mod 2 ueber eine Zahl aus?
n mod 2 ist der schnellste Test fuer gerade/ungerade. Wenn das Ergebnis 0 ist, ist die Zahl gerade; wenn es 1 ist, ist sie ungerade. Das ist die haeufigste Verwendung von Modulo in der alltaeglichen Programmierung und eines der ersten Dinge, die Anfaenger lernen.
Warum ist Modulo bei zirkulaeren Arrays nuetzlich?
Wenn du ein Array wiederholt durchlaufen musst, kannst du Index % Laenge verwenden, um automatisch zum Anfang zurueckzukehren. Wenn der Index das Ende erreicht, setzt er auf 0 zurueck und erzeugt einen endlosen Zyklus ohne spezielle Logik. Dieses Muster wird in Karussells, Round-Robin-Planern und Ringpuffern verwendet.
Wie wird Modulo in der Kryptographie eingesetzt?
Modulo ist das Herzstuck der Public-Key-Kryptographie. RSA-Verschluesselung basiert auf modularer Exponentiation — Zahlen werden zu grossen Potenzen mod einer grossen Primzahl erhoben. Der Diffie-Hellman-Schluesselaustausch und die elliptische Kurven-Kryptographie haengen davon ab, dass modulare Arithmetik in eine Richtung leicht zu berechnen, aber extrem schwer umzukehren ist.