Matemática

Cramer's Rule Calculator: Solve Any 2×2 Linear System

Solve ax+by=e, cx+dy=f instantly with Cramer's Rule. Enter the 6 coefficients and get x, y, and the determinant — plus a step-by-step explanation.

🗓️ Updated June 2026 Reviewed by
Calculator Free · Private
Reviewed by: (editorial policy ) · Last reviewed:
Have a website? Embed this calculator for free Free — copy the code and paste it on your website Embed on your site
<iframe src="https://hacecuentas.com/embed/2x2-linear-system-cramer-rule" width="100%" height="560" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px" loading="lazy" title="Cramer's Rule Calculator: Solve Any 2×2 Linear System"></iframe>
<p style="font-size:13px;text-align:center;margin:8px 0">Powered by <a href="https://hacecuentas.com" target="_blank" rel="noopener">Hacé Cuentas</a> — <a href="https://hacecuentas.com/2x2-linear-system-cramer-rule" target="_blank" rel="noopener">Cramer's Rule Calculator: Solve Any 2×2 Linear System</a></p>
Preview →

Paste it on your site. Keep the credit link — thanks for sharing. More widgets →

Cramer's Rule is a closed-form method for solving 2×2 linear systems using determinants. Given the system ax + by = e and cx + dy = f, the solution is x = (ed − bf)/(ad − bc) and y = (af − ce)/(ad − bc), where D = ad − bc is the determinant of the coefficient matrix. If D ≠ 0, the system has exactly one unique solution (the two lines intersect at one point). If D = 0, the system is either inconsistent (parallel lines, no solution) or dependent (same line, infinitely many solutions). Enter your six coefficients below to solve instantly.

When to use this calculator

  • Finding the exact intersection point of two straight lines in coordinate geometry (e.g., supply and demand curves in economics)
  • Solving electrical circuit equations from Kirchhoff's Voltage Law where two loop currents are unknown
  • Computing 2D affine transformation coefficients (scale/shear) when two control-point pairs are given
  • Determining break-even quantities for two competing products with shared resource constraints in operations research

Cramer's Rule answer key — solved 2×2 systems with their determinants

Plug these coefficients into the calculator to verify it, or check your hand-worked solution against a known-correct result. Every D, x and y below is exact.

SystemabcdefD = ad − bcxy
x + y = 5 ; 2x + 3y = 131123513123
2x + 3y = 12 ; 4x − y = 10234-11210-1432
5x + 2y = 16 ; 3x + 7y = 27523716272923
x − 4y = −9 ; 6x + y = 41-461-94250.282.32
4I₁ − 2I₂ = 12 ; −2I₁ + 6I₂ = 04-2-26120203.61.2
x + y = 3 ; 2x + 2y = 81122380no solution (parallel)
x + y = 3 ; 2x + 2y = 61122360∞ solutions (same line)

Solutions computed as x = (ed − bf)/D and y = (af − ec)/D with D = ad − bc. When D = 0 the system is degenerate: if Dₓ or D_y is non-zero the lines are parallel (no solution); if both are zero the lines coincide (infinitely many solutions). The Kirchhoff row (I₁, I₂) shows two mesh currents in amps from a resistor network.

How it works

How Cramer's Rule Works

Given the 2×2 linear system:

a·x + b·y = e
c·x + d·y = f

Step 1 — Compute the coefficient determinant (D):

D = |a  b| = a·d − b·c
    |c  d|

Step 2 — Compute Dₓ (replace the x-column with the constants):

Dₓ = |e  b| = e·d − b·f
     |f  d|

Step 3 — Compute D_y (replace the y-column with the constants):

D_y = |a  e| = a·f − e·c
      |c  f|

Step 4 — Apply Cramer's Rule:

x = Dₓ / D = (e·d − b·f) / (a·d − b·c)
y = D_y / D = (a·f − e·c) / (a·d − b·c)

If D = 0 and Dₓ ≠ 0 or D_y ≠ 0inconsistent (parallel lines, no solution).
If D = 0 and Dₓ = 0 and D_y = 0dependent (same line, infinitely many solutions).

---

Quick Reference Table — Common Systems

SystemabcdefDxy
x+y=5, 2x+3y=131123513123
3x−y=4, x+2y=133−112413735
4I₁−2I₂=12, −2I₁+6I₂=04−2−26120203.61.2
0.5x+1.5y=4, 2x−y=10.51.52−141−3.5≈1.571≈2.143
x+y=3, 2x+2y=81122380— (no solution)
x+y=3, 2x+2y=61122360— (∞ solutions)

---

Determinant Interpretation

D valueDₓ / D_yGeometric meaningSolution type
D ≠ 0AnyLines intersect at exactly one pointUnique solution
D = 0Dₓ = 0, D_y = 0Lines are identical (coincident)Infinite solutions
D = 0Dₓ ≠ 0 or D_y ≠ 0Lines are parallel (never meet)No solution

---

Detailed Worked Examples

Example 1 — Classic textbook system


System: x + y = 5 and 2x + 3y = 13

  • D = (1)(3) − (1)(2) = 3 − 2 = 1

  • Dₓ = (5)(3) − (1)(13) = 15 − 13 = 2 → x = 2/1 = 2

  • D_y = (1)(13) − (5)(2) = 13 − 10 = 3 → y = 3/1 = 3

  • Solution: x = 2, y = 3 ✓ (verify: 2+3=5 ✓, 4+9=13 ✓)
  • Example 2 — Kirchhoff circuit loop equations


    System: 4I₁ − 2I₂ = 12 and −2I₁ + 6I₂ = 0

  • D = (4)(6) − (−2)(−2) = 24 − 4 = 20

  • Dₓ = (12)(6) − (−2)(0) = 72 − 0 = 72 → I₁ = 72/20 = 3.6 A

  • D_y = (4)(0) − (12)(−2) = 0 + 24 = 24 → I₂ = 24/20 = 1.2 A
  • Example 3 — No solution (parallel lines)


    System: 2x + 4y = 6 and x + 2y = 5

  • D = (2)(2) − (4)(1) = 4 − 4 = 0

  • Dₓ = (6)(2) − (4)(5) = 12 − 20 = −8 ≠ 0

  • Result: Inconsistent — no solution (lines are parallel, different y-intercepts)
  • ---

    Common Mistakes

    1. Swapping rows vs. columns when forming Dₓ and D_y. The constants (e, f) replace the column of the target variable, not a row.
    2. Sign errors. Remember: D = ad − bc, NOT ad + bc. A single missed minus sign flips the entire solution.
    3. Dividing by zero without checking D first. Always verify D ≠ 0 before computing x and y.
    4. Assuming D = 0 always means no solution. Check Dₓ and D_y to distinguish inconsistent from dependent systems.
    5. Not rewriting in standard form. If the system is written as y + 2x = 7, rewrite it as 2x + y = 7 before extracting coefficients.

    ---

    Related Calculators

  • 3×3 Linear System Solver (Cramer's Rule)

  • Matrix Determinant Calculator

  • Quadratic Equation Solver

  • Slope and Line Equation Calculator

  • Worked Example

    System: x + y = 5 and 2x + 3y = 13
    Enter: a=1, b=1, e=5, c=2, d=3, f=13
    D = (1)(3) − (1)(2) = 3 − 2 = 1
    x = (5·3 − 1·13) / 1 = (15 − 13) / 1 = 2
    y = (1·13 − 5·2) / 1 = (13 − 10) / 1 = 3
    Verify: 2+3=5 ✓ and 2(2)+3(3)=13 ✓
    x = 2, y = 3

    Frequently asked questions

    What is Cramer's Rule and how do you apply it to a 2×2 system?
    Cramer's Rule (published by Gabriel Cramer in 1750) expresses each variable as a ratio of two determinants. For ax+by=e, cx+dy=f: first compute D = ad−bc. Then x = (ed−bf)/D and y = (af−ec)/D. If D ≠ 0 you get exactly one solution; if D = 0 the system is degenerate.
    What is the formula for solving a 2×2 system with Cramer's Rule?
    Given ax+by=e and cx+dy=f, the formulas are: D = ad−bc, x = (ed−bf)/D, y = (af−ec)/D. These are derived by replacing the target variable's column in the coefficient matrix with the constant column (e, f) and dividing by D.
    When does a 2×2 system have no solution vs. infinitely many solutions?
    Both cases arise when D = ad−bc = 0. If D = 0 and at least one of Dₓ=(ed−bf) or D_y=(af−ec) is non-zero, the system is inconsistent (parallel lines, no solution). If D = 0 and both Dₓ = 0 and D_y = 0, the system is dependent (same line, infinitely many solutions). Always check both auxiliary determinants.
    How do I verify the solution x, y is correct?
    Substitute x and y back into both original equations. For x+y=5, 2x+3y=13 with solution x=2, y=3: check 2+3=5 ✓ and 2(2)+3(3)=4+9=13 ✓. Both equations must balance — one equation passing is not sufficient.
    Can Cramer's Rule handle decimal or fractional coefficients?
    Yes. The rule works for any real-number coefficients. For example, 0.5x+1.5y=4 and 2x−y=1 gives D=(0.5)(−1)−(1.5)(2)=−3.5, x=(4·(−1)−1.5·1)/(−3.5)=−5.5/−3.5≈1.571, y=(0.5·1−4·2)/(−3.5)=−7.5/−3.5≈2.143. The calculator handles all real-valued inputs automatically.
    Is Cramer's Rule the most efficient method for 2×2 systems?
    For exactly 2×2 systems, Cramer's Rule, substitution, and elimination all require roughly the same arithmetic effort. However, for n×n systems with n ≥ 4, Gaussian elimination (O(n³)) drastically outperforms Cramer's Rule (O(n·n!)), which is why numerical software like MATLAB or NumPy uses LU decomposition instead. Cramer's Rule excels when you need a clean, symbolic closed-form answer for one variable at a time.
    What does the determinant D represent geometrically?
    For a 2×2 matrix with row vectors u=(a,b) and v=(c,d), |D| = |ad−bc| equals the area of the parallelogram spanned by those two vectors. When D=0 the vectors are collinear (linearly dependent), meaning the lines either overlap or are parallel — matching the degenerate cases. This connects Cramer's Rule to cross products and area calculations in physics and engineering.
    How do I enter a system where a variable has an implied coefficient of 1 or is missing?
    An implied coefficient of 1 is still the number 1. For example, x + 3y = 7 is entered as a=1, b=3, e=7. If a variable is missing (e.g., −y = 2, meaning 0·x + (−1)·y = 2), enter a=0, b=−1, e=2. Always make every coefficient explicit before inputting values. The system must be in the form ax+by=e before extracting the six coefficients.
    Why does the calculator show determinant 0 for x+y=3, 2x+2y=6?
    Because D = (1)(2)−(1)(2) = 2−2 = 0. The second equation is exactly 2 times the first (multiply x+y=3 by 2 to get 2x+2y=6), so both equations describe the same line. Since Dₓ=(3·2−1·6)=0 and D_y=(1·6−3·2)=0, the system is dependent with infinitely many solutions y=(3−x)/2 for any real x.

    Methodology & trust

    Editorial

    Calculadora de matemática revisada por el equipo editorial de Hacé Cuentas, contrastada con Wikipedia — Cramer's Rule, según nuestra política editorial y metodología.

    Updates

    Última revisión: June 22, 2026. Los parámetros se verifican periódicamente con las fuentes citadas.

    Privacy

    Calculations run 100% in your browser. We do not store or transmit your data.

    Limitations

    Indicative results. For critical decisions, consult a professional.

    📌 How to cite this calculator

    Rodríguez, M. (2026). Cramer's Rule Calculator: Solve Any 2×2 Linear System. Hacé Cuentas. https://hacecuentas.com/2x2-linear-system-cramer-rule

    Contenido bajo licencia CC-BY 4.0 — reutilizable citando la fuente con enlace a Hacé Cuentas.

    ✉️ Reportar un error en esta calculadora