Use this free matrix calculator to work with matrices. Enter one or two matrices, choose an operation, and see the result with step-by-step working. You can add, subtract, and multiply matrices, find the transpose, determinant, inverse, rank, trace, and eigenvalues, and solve a system of linear equations. No signup needed.
To solve a system of equations, choose “Solve Ax = b,” enter the coefficient matrix A and the constants b.
A matrix is a rectangular grid of numbers arranged in rows and columns. An m × n matrix has m rows and n columns. Matrices are used to organize data and to describe linear transformations, systems of equations, graphics, networks, and more.
Example of a 2 × 2 matrix:
A = [ 1 2 ; 3 4 ]
(rows are separated by semicolons here)
| Operation | Rule | Size requirement |
|---|---|---|
| Addition and subtraction | Add or subtract matching entries | Same size |
| Scalar multiplication | Multiply every entry by the number | Any size |
| Matrix multiplication | Entry (i, j) = row i of A times column j of B | A is m × n and B is n × p. The result is m × p |
| Transpose (Aᵀ) | Swap rows and columns | Any size |
| Determinant | A single number for a square matrix | Square (n × n) |
| Inverse (A⁻¹) | A⁻¹ × A = I, the identity matrix | Square, with determinant not 0 |
| Trace | Sum of the diagonal entries | Square |
| Rank | Number of independent rows (or columns) | Any size |
Determinant of a 2 × 2 matrix [a b; c d]: det = a × d − b × c
Inverse of a 2 × 2 matrix: A⁻¹ = (1 ÷ det) × [d −b; −c a]
Determinant of a 3 × 3 matrix (expanding along the first row):
det = a(ei − fh) − b(di − fg) + c(dh − eg), for the matrix [a b c; d e f; g h i]
Properties:
Eigenvalues: the values λ that satisfy det(A − λI) = 0. For each eigenvalue, the eigenvectors v satisfy A × v = λ × v.
Solving a system: for Ax = b, if A is invertible, x = A⁻¹ × b.
For the first examples, use these two matrices:
A = [ 1 2 ; 3 4 ] and B = [ 5 6 ; 7 8 ]
This is different from A × B = [ 19 22 ; 43 50 ]. The order matters.
M is 2 × 3 and N is 3 × 2, so M × N is 2 × 2.
M = [ 1 2 3 ; 4 5 6 ] and N = [ 7 8 ; 9 10 ; 11 12 ]
N × M would be 3 × 3, a different size.
D = [ 2 1 3 ; 0 1 4 ; 5 6 0 ]
C = [ 2 0 1 ; 1 3 2 ; 1 1 1 ]
Solve 2x + y = 5 and x − y = 1.
Solve:
The coefficient matrix has a determinant of −21, which is not 0, so there is exactly one solution:
E = [ 2 1 ; 1 2 ]
For a system Ax = b with a square matrix A:
Multiply each row of the first matrix by each column of the second, adding the products. Each entry (i, j) of the result is the sum of row i of A times column j of B. The number of columns in A must equal the number of rows in B.
No. A × B is usually not equal to B × A. For the matrices above, A × B = [ 19 22 ; 43 50 ] and B × A = [ 23 34 ; 31 46 ].
For a 2 × 2 matrix [a b ; c d], det = ad − bc. For larger matrices, expand along a row or column using cofactors.
For a 2 × 2 matrix, swap a and d, change the signs of b and c, and divide by the determinant. For larger matrices, use row reduction or the adjugate method.
When it is not square, or when its determinant is 0. Such a matrix is called singular.
The matrix you get by swapping its rows and columns. The entry in row i, column j becomes the entry in row j, column i.
The number of linearly independent rows (or columns). A square n × n matrix has an inverse only if its rank is n.
The sum of the entries on its main diagonal. The trace of [ 1 2 ; 3 4 ] is 5.
An eigenvector of a matrix A is a vector v that only gets scaled when A acts on it: A × v = λ × v. The scale factor λ is the eigenvalue.
Write it as Ax = b, where A holds the coefficients. If A is invertible, x = A⁻¹ × b. You can also use row reduction.
Addition works entry by entry, so each entry needs a partner in the same position in the other matrix.
Yes. It is free, with no registration and no limits.
It uses standard methods, and results with decimals are rounded for display. Very large or ill-conditioned matrices can have small numerical errors.
A few of the most-used tools in each hub.
This calculator is for general informational and educational purposes only. Results are calculated from the numbers you enter and may include small rounding differences. For engineering, scientific, financial, or other critical work, verify results with an independent method or a qualified professional.