Do matrix algebra in your browser. This free matrix calculator handles addition, subtraction and multiplication of two matrices, plus the determinant, transpose and inverse of a matrix — up to 6×6.
Matrix A
rows 2
cols 2
Matrix B
rows 2
cols 2
Result
Enter values, then pick an operation
Add, subtract or multiply two matrices, or find the determinant, transpose or inverse of matrix A. Empty cells count as zero. Dimensions must be compatible for the chosen operation.
Use this free matrix calculator to add, subtract and multiply matrices, or find the determinant, transpose and inverse of a matrix. Set the dimensions, enter your values and pick an operation.
What this matrix calculator does
A matrix calculator performs linear-algebra operations on matrices you enter. It handles A + B, A − B, A × B on two matrices, and determinant, transpose and inverse of matrix A — up to 6×6, with automatic dimension checks.
Matrix operations and their rules
Operation
Requirement
Add / subtract
Same dimensions.
Multiply (A × B)
Columns of A = rows of B.
Determinant
Square matrix.
Transpose
Any matrix (rows ↔ columns).
Inverse
Square and non-singular (det ≠ 0).
Worked example: A × B
For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], the product A × B = [[19, 22], [43, 50]]. Each entry is the dot product of a row of A with a column of B.
Determinant and inverse
The determinant of [[1, 2], [3, 4]] is −2, and its inverse is [[−2, 1], [1.5, −0.5]]. A matrix only has an inverse when its determinant is not zero; otherwise it is “singular.”
How to use the matrix calculator
Set the rows and columns for A and B with the + / − steppers.
Type the entries (blank cells count as zero).
Click an operation — the result appears below.
Matrix Calculator FAQ
How do I multiply two matrices?
The number of columns in A must equal the number of rows in B. Each result entry is the dot product of a row of A with a column of B. For [[1,2],[3,4]] × [[5,6],[7,8]] you get [[19,22],[43,50]].
How do I find a determinant?
The matrix must be square. For a 2×2 [[a,b],[c,d]] it's ad − bc; larger matrices expand by minors. This calculator computes it for sizes up to 6×6.
How do I find the inverse of a matrix?
A square matrix has an inverse only if its determinant isn't zero. The calculator uses Gauss-Jordan elimination; if the matrix is singular, it tells you no inverse exists.
What is a transpose?
The transpose swaps rows and columns, so the entry in row i, column j moves to row j, column i. A 2×3 matrix becomes 3×2.
Why am I getting a dimension error?
Each operation has rules: addition and subtraction need equal dimensions, multiplication needs A's columns to match B's rows, and determinant and inverse need a square matrix.
Is the matrix calculator free?
Yes, this matrix calculator is completely free, needs no sign-up, and gives instant results in your browser.