Analyze modular equations with normalization, gcd, inverses. See reduced forms, families, and plotted residue graphs. Export clean reports and check every answer confidently today.
Use the form below to solve a linear congruence of the form ax ≡ b (mod m).
These examples show how different gcd values affect solvability and the number of residue classes.
| a | b | m | gcd(a, m) | Example solution summary |
|---|---|---|---|---|
| 14 | 30 | 100 | 2 | x ≡ 45 and 95 (mod 100) |
| 3 | 7 | 11 | 1 | x ≡ 6 (mod 11) |
| 12 | 18 | 30 | 6 | Six solution classes exist because 6 divides 18 |
| 8 | 5 | 12 | 4 | No solution because 4 does not divide 5 |
Base congruence: ax ≡ b (mod m)
Step 1: Compute d = gcd(a, m).
Step 2: A solution exists only when d | b.
Step 3: Reduce the equation to (a/d)x ≡ (b/d) (mod m/d).
Step 4: Find the inverse of a/d modulo m/d.
Step 5: Compute the principal solution:
x₀ ≡ (a/d)-1(b/d) (mod m/d)
Step 6: Generate all residue solutions modulo m:
x ≡ x₀ + k(m/d), for k = 0, 1, ..., d − 1
A congruence equation states that two expressions give the same remainder when divided by a modulus. In ax ≡ b (mod m), you seek integers x that make both sides equivalent under modulus m.
A solution exists exactly when gcd(a, m) divides b. If that divisibility condition fails, no residue class can satisfy the equation, even if you test many integers manually.
When gcd(a, m) = d > 1, a solvable congruence produces d distinct residue classes modulo m. Those classes are evenly spaced by m/d.
A modular inverse of c modulo n is a value that makes c · c-1 ≡ 1 (mod n). It exists only when gcd(c, n) = 1.
Normalization replaces a and b with equivalent residues between 0 and m−1. That keeps arithmetic cleaner while preserving the original congruence and the same full solution set.
The graph plots (ax − b) mod m across the chosen x range. Points touching zero are solutions, while other heights show how far each x is from satisfying the congruence.
Yes. Negative coefficients, constants, and search ranges are supported. The solver converts equivalent values into standard residues internally, then reports answers in a clean modular format.
CSV is ideal for spreadsheets, audit trails, or coursework logs. PDF gives you a neat report for printing, sharing, or saving alongside your solved modular arithmetic examples.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.