Cramer's Rule Calculator

    Solve square systems from 2x2 to 5x5 with Cramer's rule, main and replacement determinants, step output, and a substitution check.

    3 × 3
    Enter coefficients and the constants column. Fractions use a slash. Variables: x, y, z. For 4x4 and 5x5 systems, determinants are calculated numerically, so fractional input is shown as rounded numbers.
    x
    y
    z
    B
    |
    |
    |
    Virtual keypad for the selected cell
    Choose an example to load the data and show the steps below.
    💡 x=1, y=2, z=3
    Solution
    x1
    y2
    z3
    Δ
    7
    Δ1
    7
    Δ2
    14
    Δ3
    21
    Main determinant
    Matrix
    1
    1
    1
    2
    -1
    1
    1
    2
    -1
    Value of Δ: 7
    The value is shown from a first-row expansion for 2x2 and 3x3 systems.
    Δ1 - column 1 replaced by B
    Matrix Δ1
    6
    1
    1
    3
    -1
    1
    2
    2
    -1
    Value of Δ1: 7
    The constants column is already substituted in the matrix above.
    x: 1 from determinants Δ1 7 and Δ 7
    Δ2 - column 2 replaced by B
    Matrix Δ2
    1
    6
    1
    2
    3
    1
    1
    2
    -1
    Value of Δ2: 14
    The constants column is already substituted in the matrix above.
    y: 2 from determinants Δ2 14 and Δ 7
    Δ3 - column 3 replaced by B
    Matrix Δ3
    1
    1
    6
    2
    -1
    3
    1
    2
    2
    Value of Δ3: 21
    The constants column is already substituted in the matrix above.
    z: 3 from determinants Δ3 21 and Δ 7

    Cramer's rule solves square systems through the main determinant and replacement determinants. The replacement column is highlighted in each auxiliary matrix. If the main determinant is zero, use Gaussian elimination to classify the system.

    What Cramer's rule does

    Cramer's rule solves a square linear system by comparing the main determinant of the coefficient matrix with replacement determinants built for each variable.

    A is the coefficient matrix, x is the unknown vector, and b is the constants column.

    Delta is the main determinant of the coefficient matrix.

    Delta_i is the determinant after replacing column i with the constants column.

    x_i is found from Delta_i divided by the nonzero Delta.

    1. Calculate the main determinant
    2. Replace one coefficient column at a time with the constants column
    3. Calculate each replacement determinant
    4. Divide replacement determinants by the main determinant

    When Cramer's rule applies

    ConditionMeaningAction
    main determinant is nonzerothe square system has a unique solutionapply Cramer's rule
    main determinant is zeroCramer's rule cannot classify the systemuse Gaussian elimination and ranks
    system is not squareCramer's rule is not defineduse another linear-system method
    Zero determinant
    A zero main determinant alone does not tell whether there is no solution or infinitely many solutions. Gaussian elimination is needed for classification.

    Replacement matrices

    For each unknown, the original coefficient matrix is copied and one column is replaced by the constants column. The calculator highlights that replacement column in the determinant blocks.

    A_1 and A_2 are replacement matrices for a 2x2 system.

    Step display
    For 2x2 and 3x3 systems, the page shows determinant expansion. Larger systems are calculated numerically.

    Benefits and limits

    Best fit
    Cramer's rule is clear for small square systems and determinant practice. For larger systems or zero-determinant cases, Gaussian elimination is usually more practical.
    • Works only for square systems
    • Requires a nonzero main determinant for a unique solution
    • Shows determinant expansion for 2x2 and 3x3 systems
    • Uses numerical determinant calculation for 4x4 and 5x5 systems
    • Accepts fractions as, but displays rounded numeric results

    Frequently Asked Questions

    Sources and References

    Calculations are based on the listed reference sources. Links open in a new tab.

    Updated:

    Related Tools