Skip to main content
Online
Linear algebra · step-by-step

Matrix Calculator with Steps

Paste a matrix (one row per line) and choose an operation. Every row operation is shown with exact fractions, so you can follow or check your homework line by line.

Up to 6 × 6. Fractions such as 1/3 are kept exact.

Complete guide

Matrix operations explained: determinant, inverse, row echelon form and rank

4 min read Reviewed By the GetCalcMaster team · Editorial policy

Matrices encode linear transformations, systems of equations, networks and data tables. Four operations come up constantly: the determinant (does the matrix collapse space, and by how much does it scale area or volume?), the inverse (how do you undo the transformation?), the reduced row echelon form (what does the matrix look like after Gaussian elimination?) and the rank (how many independent rows or columns it has).

The calculator performs each operation with exact fractions and lists every row operation, so you can follow along or find exactly where your hand calculation went wrong.

Key formulas

2 × 2 determinant
det [[a, b], [c, d]] = ad − bc
The signed area scale factor of the transformation.
Determinant by elimination
det A = (−1)^(swaps) · Π pivots
Reduce to upper-triangular form without scaling rows, then multiply the diagonal.
2 × 2 inverse
A⁻¹ = (1/(ad − bc)) · [[d, −b], [−c, a]]
Exists only if ad − bc ≠ 0.
Gauss–Jordan inverse
[A | I] → [I | A⁻¹]
Row-reduce the augmented matrix; the right block becomes the inverse.
Rank–nullity
rank A + nullity A = number of columns
Connects pivots with free variables.

Worked examples

Example 1: Inverse of a 2 × 2 matrix

Find the inverse of [[4, 7], [2, 6]].

  1. det = 4·6 − 7·2 = 10.
  2. Swap a and d, negate b and c: [[6, −7], [−2, 4]].
  3. Divide by 10.
Answer: [[3/5, −7/10], [−1/5, 2/5]].
Example 2: 3 × 3 determinant

det [[1, 2, 3], [4, 5, 6], [7, 8, 10]].

  1. R2 ← R2 − 4R1, R3 ← R3 − 7R1 gives rows (0, −3, −6) and (0, −6, −11).
  2. R3 ← R3 − 2R2 gives (0, 0, 1).
  3. det = 1 · (−3) · 1 = −3.
Answer: −3.
Example 3: Rank of a matrix

Rank of [[1, 2, −1, 3], [2, 4, 1, 0], [−1, −2, 3, 4]].

  1. Column 2 is twice column 1, so it never gets its own pivot.
  2. Row reduction leaves pivots in columns 1, 3 and 4.
Answer: Rank 3.
Example 4: Multiplying two 2 × 2 matrices

Compute AB for A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]].

  1. Entry (row i, column j) = row i of A · column j of B.
  2. Row 1: 1·5 + 2·7 = 19 and 1·6 + 2·8 = 22.
  3. Row 2: 3·5 + 4·7 = 43 and 3·6 + 4·8 = 50.
  4. Check with determinants: det A = −2, det B = −2, and det(AB) = 19·50 − 22·43 = 4 = (−2)(−2).
Answer: AB = [[19, 22], [43, 50]].
Example 5: Solving a system with the inverse

Solve 4x + 7y = 1 and 2x + 6y = 2 using A⁻¹.

  1. A = [[4, 7], [2, 6]] has det = 4·6 − 7·2 = 10, so A⁻¹ = (1/10)[[6, −7], [−2, 4]] = [[3/5, −7/10], [−1/5, 2/5]].
  2. x = 3/5·1 − 7/10·2 = 3/5 − 7/5 = −4/5.
  3. y = −1/5·1 + 2/5·2 = 3/5.
Answer: x = −4/5, y = 3/5 — the same answer the system solver gives by elimination.

What the determinant tells you

  • det A = 0 ⇔ A is singular: no inverse, and Ax = b has either no solution or infinitely many.
  • |det A| is the factor by which A scales area (2D) or volume (3D).
  • A negative determinant means the transformation flips orientation (like a mirror).
  • det(AB) = det A · det B and det(Aᵀ) = det A.

Why not compute the inverse to solve equations?

To solve Ax = b, Gaussian elimination on [A|b] is faster and more accurate than computing A⁻¹ and then multiplying. Inverses are still valuable for theory, for small matrices, and when the same A is used with many different right-hand sides.

Useful determinant rules

  • Swapping two rows changes the sign of the determinant.
  • Multiplying one row by k multiplies the determinant by k.
  • Adding a multiple of one row to another leaves the determinant unchanged — the basis of elimination.
  • det(AB) = det(A)·det(B) and det(Aᵀ) = det(A).
  • For a triangular matrix the determinant is the product of the diagonal entries.

Common mistakes to avoid

  • Multiplying matrices element by element instead of row-by-column.
  • Assuming AB = BA — matrix multiplication is not commutative.
  • Scaling a row during a determinant calculation without adjusting the result.
  • Trying to invert a non-square or singular matrix.

Frequently asked questions

What size matrices are supported?
Up to 6 rows and 7 columns, with exact fractions. For larger or floating-point work use the linear algebra toolkit.
What is RREF used for?
RREF reveals the rank, pivot columns, a basis for the column space and the general solution of Ax = 0 at a glance.
Can I enter fractions?
Yes, type entries like 1/3 or -2/5. Results stay exact.
Is AB the same as BA?
Usually not. Matrix multiplication is not commutative: with A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], AB = [[19, 22], [43, 50]] but BA = [[23, 34], [31, 46]]. Their determinants are still equal, because det(AB) = det(A)·det(B) = det(BA).
What does a negative determinant mean?
Geometrically the absolute value is the factor by which the matrix scales areas (2 × 2) or volumes (3 × 3); a negative sign means the transformation also flips orientation, like a mirror reflection.

Related tools and guides

Educational content. Results are computed in your browser with standard double-precision arithmetic; double-check anything with legal, financial, medical, or safety consequences. Spotted an error? Tell us and we will correct it.