Matrix Calculator

Result
\operatorname{rref}(A) = \begin{bmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix}

Rank 2 (pivots in columns 1, 2).

  • Type: Reduced row echelon form
  • Method: Matrices
  • Rank: 2

Step-by-step solution

The problem

A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix},\quad \text{rref }A
1

Start with \displaystyle A

\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}

Work column by column: make a leading 1 (pivot), then zeros above and below it.

2

Clear the rest of column 1

R_2 \to R_2 - 4R_1,\quad R_3 \to R_3 - 7R_1
\begin{bmatrix} 1 & 2 & 3 \\ 0 & -3 & -6 \\ 0 & -6 & -12 \end{bmatrix}

Subtract multiples of the pivot row so every other entry in this column becomes 0.

3

Make the pivot in column 2 equal to 1

R_2 \to \frac{1}{-3}R_2
\begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \\ 0 & -6 & -12 \end{bmatrix}

Divide the row by its first non-zero entry.

4

Clear the rest of column 2

R_1 \to R_1 - 2R_2,\quad R_3 \to R_3 + 6R_2
\begin{bmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix}

Subtract multiples of the pivot row so every other entry in this column becomes 0.

Matrix A

Matrices as [[1, 2], [3, 4]]; name them A = …, B = … and write an expression like 2A − B^T, A*B or A^-1.

Fill in a matrix up to 6×6 to get its determinant, inverse, RREF, rank, characteristic polynomial or eigenvalues, or add, subtract and multiply two matrices – with cofactor expansion, Gauss–Jordan elimination and each row-by-column sum written out.

What each operation shows

OperationWorking shownNeeds
Determinantad - bc for 2×2; cofactor expansion along the row or column with the most zeros for 3×3; row reduction to triangular form for largerSquare matrix
InverseThe 2×2 formula, or Gauss–Jordan elimination on [A \mid I], then a check that AA^{-1} = ISquare, determinant ≠ 0
MultiplyEach entry as row × column: products, then sumsColumns of A = rows of B
Add / subtractEntry by entrySame size
PowerRepeated multiplication A^2, A^3, \dotsSquare matrix
RREF and rankRow operations column by column: pivot to 1, zeros above and belowAny size
EigenvaluesCharacteristic polynomial \det(A - \lambda I), its roots, and an eigenvector for each rational eigenvalueSquare, up to 4×4

Determinant of a 2×2 and a 3×3 matrix

\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc

For a 3×3 matrix, expand along a row: each entry times the determinant of the 2×2 matrix left when its row and column are crossed out, with alternating signs +\,-\,+.

Example: \det\begin{bmatrix} 2 & 0 & 1 \\ 1 & 3 & 2 \\ 1 & 1 & 1 \end{bmatrix} along row 1

2(3 \cdot 1 - 2 \cdot 1) - 0 + 1(1 \cdot 1 - 3 \cdot 1) = 2 \cdot 1 + 1 \cdot (-2) = 0

The determinant is 0, so this matrix has no inverse.

Inverse of a matrix

For a 2×2 matrix swap the diagonal entries, change the signs of the other two, and divide by the determinant:

\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

For larger matrices, write the identity matrix next to A and use row operations until the left half is the identity; the right half is then A^{-1}. If a row of zeros appears on the left, the matrix is singular and has no inverse.

Matrix multiplication

The entry in row i, column j of AB is row i of A times column j of B: multiply matching entries and add. An m × n matrix times an n × p matrix gives an m × p matrix. Order matters – AB and BA are usually different.

To solve a system of linear equations directly, use the system of equations calculator; for lengths, angles and cross products, the vector calculator.

Frequently asked questions

Why can’t I multiply these two matrices?

AB exists only when the number of columns of A equals the number of rows of B. A 2×3 matrix can multiply a 3×4 matrix (giving 2×4), but not a 2×3 matrix.

Is AB the same as BA?

Usually not – matrix multiplication is not commutative. Try A = [[1, 2], [3, 4]] and B = [[0, 1], [1, 0]]: AB − BA is not the zero matrix.

How are eigenvalues found?

Solve det(A − λI) = 0. The determinant is a polynomial in λ (the characteristic polynomial); its roots are the eigenvalues. For each one, the solutions of (A − λI)v = 0 are its eigenvectors.

Can I enter fractions?

Yes. Type 1/2, −3/4 or 0.25 in a cell. All the working uses exact fractions, so answers like 3/5 stay exact.