Matrix Calculator
Add, subtract, and multiply matrices, scale a matrix, or calculate its transpose, determinant, inverse, trace, rank, and integer powers. Enter your values and get a clear result instantly.
Enter matrix values
Choose an operation and matrix dimensions. Values can be integers or decimals. Operations run locally in your browser.
Supported matrix dimensions are 1×1 through 4×4. Determinant, inverse, trace, and powers require a square matrix. Addition and subtraction require matching dimensions.
Your result
The result and calculation notes appear here after you calculate.
Calculation details
What is a matrix calculator?
A matrix calculator performs arithmetic and common linear-algebra operations on rectangular arrays of numbers. A matrix's dimensions are written as rows × columns. For example, a 2 × 3 matrix has two rows and three columns.
Matrix formulas
- Addition/subtraction: combine corresponding entries; both matrices must have the same dimensions.
- Multiplication: each output entry is the dot product of a row of A and a column of B. The number of columns in A must equal the number of rows in B.
- Transpose: interchange rows and columns.
- Determinant: a scalar associated with a square matrix. A zero determinant means the matrix is singular and has no inverse.
- Inverse: A⁻¹ satisfies AA⁻¹ = I when A is square and invertible.
- Trace: the sum of the main diagonal entries of a square matrix.
How to use this calculator
- Select the matrix operation.
- Set the dimensions of matrix A and, when needed, matrix B.
- Enter a number in every matrix cell.
- Enter a scalar or integer power if the selected operation needs one.
- Choose Calculate to see the result and method notes. Use “Use result as A” or “Use result as B” to continue with the answer.
Frequently asked questions
Can I add matrices of different sizes?
No. Addition and subtraction require both matrices to have exactly the same number of rows and columns.
When can I multiply two matrices?
The number of columns in matrix A must equal the number of rows in matrix B. The result has the rows of A and columns of B.
Why does a matrix not have an inverse?
A square matrix has no inverse when its determinant is zero. Such a matrix is called singular.
What does the determinant tell me?
The determinant is a scalar property of a square matrix. In particular, a nonzero determinant indicates that the matrix is invertible.
Are my values uploaded?
No. This calculator performs its calculations in your browser; matrix values are not submitted to a calculation server.