All Tools

Matrix Calculator

Enter a matrix and choose an operation to see step-by-step solutions. Supports addition, multiplication, determinants, inverses, and row reduction for matrices up to 5×5. All calculations run in your browser.

Matrix A×
A
Result

Reference Guide

Matrix Operations

Matrix addition and subtraction work element by element. Both matrices must have the same dimensions. Scalar multiplication multiplies every entry by the same number.

Addition
(A+B)ij=aij+bij(A + B)_{ij} = a_{ij} + b_{ij}
Scalar multiplication
(cA)ij=caij(cA)_{ij} = c \cdot a_{ij}

The transpose flips a matrix over its diagonal, swapping rows and columns so that (AT)ij=aji(A^T)_{ij} = a_{ji}.

Matrix Multiplication

Each entry of the product is the dot product of a row from the first matrix and a column from the second. The number of columns in A must equal the number of rows in B.

Product formula
(AB)ij=kaikbkj(AB)_{ij} = \sum_{k} a_{ik} \, b_{kj}
Dimension rule
Am×nBn×p=Cm×pA_{m \times n} \cdot B_{n \times p} = C_{m \times p}

Matrix multiplication is not commutative. In general, ABBAAB \ne BA even when both products are defined.

Determinant and Inverse

The determinant is a single number computed from a square matrix. For a 2×2 matrix it is adbcad - bc. Larger matrices use cofactor expansion along a row or column.

Invertibility condition
A1 exists    det(A)0A^{-1} \text{ exists} \iff \det(A) \ne 0
Inverse identity
AA1=A1A=IA \cdot A^{-1} = A^{-1} \cdot A = I

When the determinant is zero, the matrix is singular and has no inverse. The rows (or columns) are linearly dependent.

Row Reduction

Row reduction uses three elementary operations: swap two rows, multiply a row by a nonzero scalar, and add a multiple of one row to another. These operations do not change the solution set of a system.

Row Echelon Form (REF) has all zeros below each leading entry (pivot). Reduced Row Echelon Form (RREF) goes further by making each pivot equal to 1 and clearing all entries above the pivots as well.

Applications Solving linear systems, finding matrix rank, and computing inverses
Rank
rank(A)=number of nonzero rows in REF\text{rank}(A) = \text{number of nonzero rows in REF}