Matrix Calculator
- Free
- No sign-up
- Works on phones
- Shows the working
This matrix calculator multiplies matrices and finds the determinant, inverse and transpose, and adds or subtracts matrices, for sizes up to ( 6 times 6 ). Inverses are shown with exact fractions where possible, and the calculator explains when an operation isn’t possible (for example, when the sizes don’t match for multiplication, or a matrix has no inverse).
It’s free and needs no sign-up.
![Matrix Calculator: The matrix [[2, 1], [1, 2]] maps the unit square (dashed) to the parallelogram with corners (0, 0), (2…](https://www.calculuscalc.com/wp-content/uploads/2026/10/matrix-calculator-diagram.webp)
how to enter a matrix into our matrix calculator
Type the rows separated by semicolons and the entries separated by spaces or commas. So
$$begin{pmatrix}1 & 2 \ 3 & 4end{pmatrix}$$
is typed 1, 2; 3, 4. Matrix B is only needed for multiply, add and subtract.
Operations
| Operation | Requirement | Result size |
|---|---|---|
| ( A times B ) | columns of A = rows of B | rows of A × columns of B |
| ( A pm B ) | same size | same size |
| ( det A ) | square | a number |
| ( A^{-1} ) | square, ( det A neq 0 ) | same size |
| ( A^T ) | any | rows and columns swapped |
Worked example: multiplication
With A and B as loaded above, each entry of AB is a row of A times a column of B:
$$AB = begin{pmatrix}1cdot5 + 2cdot7 & 1cdot6 + 2cdot8 \ 3cdot5 + 4cdot7 & 3cdot6 + 4cdot8end{pmatrix} = begin{pmatrix}19 & 22 \ 43 & 50end{pmatrix}$$
A ( 2 times 3 ) matrix times a ( 3 times 2 ) matrix gives a ( 2 times 2 ): for example ( begin{pmatrix}1&2&3\4&5&6end{pmatrix}begin{pmatrix}7&8\9&10\11&12end{pmatrix} = begin{pmatrix}58&64\139&154end{pmatrix} ). The full method is in matrix multiplication.
Worked example: determinant and inverse
For ( A = begin{pmatrix}4 & 7 \ 2 & 6end{pmatrix} ): ( det A = 4cdot6 – 7cdot2 = 10 ), and
$$A^{-1} = frac{1}{10}begin{pmatrix}6 & -7 \ -2 & 4end{pmatrix} = begin{pmatrix}frac35 & -frac{7}{10} \ -frac15 & frac25end{pmatrix}$$
The ( 3 times 3 ) matrix with rows ( (2, 0, 1) ), ( (1, 3, 2) ), ( (1, 1, 2) ) has determinant 6.
Common mistakes
- Multiplying entry by entry. Matrix multiplication is row-times-column, not position-by-position.
- Assuming ( AB = BA ). However, matrix multiplication is not commutative; usually ( AB neq BA ).
- Inverting a singular matrix. If ( det A = 0 ), there’s no inverse.
- Mismatched sizes. Check columns of A against rows of B before multiplying.
Matrices in calculus
The determinant of the matrix of second partial derivatives (the Hessian) is the D in the second derivative test for functions of two variables, and Jacobian determinants appear when changing variables in double integrals. See multivariable calculus.
Solving a system of equations with the inverse
A system like
$$2x + y = 5, \qquad x + 3y = 10$$
can be written \( A\mathbf{x} = \mathbf{b} \) with \( A = \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} \) and \( \mathbf{b} = \begin{pmatrix} 5 \\ 10 \end{pmatrix} \). Then \( \mathbf{x} = A^{-1}\mathbf{b} \).
- \( \det A = 2 \cdot 3 - 1 \cdot 1 = 5 \)
- \( A^{-1} = \frac{1}{5}\begin{pmatrix} 3 & -1 \\ -1 & 2 \end{pmatrix} \)
- \( x = \frac{3 \cdot 5 - 1 \cdot 10}{5} = 1 \), \( y = \frac{-5 + 20}{5} = 3 \)
Check: \( 2 + 3 = 5 \) and \( 1 + 9 = 10 \). If the determinant is 0, the matrix has no inverse and the system has either no solution or infinitely many. See the system of equations calculator.
Determinant of a 3×3 matrix
Expand along the first row:
$$\det\begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix} = a(ei - fh) - b(di - fg) + c(dh - eg)$$
For \( \begin{pmatrix} 2 & 1 & 0 \\ 1 & 3 & 1 \\ 0 & 1 & 2 \end{pmatrix} \): \( 2(6 - 1) - 1(2 - 0) + 0 = 10 - 2 = 8 \).
Useful properties
| Property | Meaning |
|---|---|
| \( AB \ne BA \) in general | order matters in multiplication |
| \( (AB)^T = B^T A^T \) | transpose reverses the order |
| \( \det(AB) = \det A \cdot \det B \) | determinants multiply |
| \( \det(A^T) = \det A \) | transposing keeps the determinant |
| \( (AB)^{-1} = B^{-1}A^{-1} \) | inverse reverses the order |
| \( AI = IA = A \) | the identity matrix changes nothing |
Where matrices are used
- Computer graphics: rotating a point by an angle \( \theta \) multiplies it by \( \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \). A 90° turn sends \( (1, 0) \) to \( (0, 1) \).
- Systems of equations in engineering, economics and statistics (least-squares regression is a matrix calculation).
- Probability: Markov chains use a matrix of transition probabilities.
- Calculus: the Jacobian matrix of partial derivatives describes how a change of variables stretches area, see the partial derivative calculator.
Step-by-step: inverse of a 2×2 matrix
- First, find the determinant \( ad - bc \). If it is 0, stop: there is no inverse.
- Swap \( a \) and \( d \), change the signs of \( b \) and \( c \).
- Divide every entry by the determinant.
- Check by multiplying: \( AA^{-1} \) should be the identity.
Eigenvalues in brief
An eigenvector of \( A \) is a vector that \( A \) only stretches, \( A\mathbf{v} = \lambda\mathbf{v} \). For \( A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} \), solving \( \det(A - \lambda I) = (2 - \lambda)^2 - 1 = 0 \) gives \( \lambda = 3 \) and \( \lambda = 1 \), with eigenvectors \( (1, 1) \) and \( (1, -1) \). See the eigenvalue calculator.
Special matrices worth knowing
- Identity \( I \): 1s on the diagonal, 0s elsewhere; \( AI = A \).
- Diagonal: only diagonal entries are non-zero; its determinant is the product of the diagonal.
- Symmetric: \( A^T = A \); its eigenvalues are always real numbers.
- Orthogonal: \( A^T A = I \); it rotates or reflects without stretching, and its inverse is simply its transpose.
- Singular: determinant 0; it squashes space flat and has no inverse.
Practice problems
- Find the determinant and inverse of \( \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \).
- Multiply \( \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix}\begin{pmatrix} 3 & 1 \\ 0 & 2 \end{pmatrix} \).
Answers: 1. \( \det = 4 - 6 = -2 \); however, inverse \( \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix} \). 2. \( \begin{pmatrix} 3 & 1 \\ 6 & 4 \end{pmatrix} \).
Using the Matrix Calculator: A Step-by-Step Guide
First, identify the matrix or matrices you need to work with. For operations like multiplication or addition, you will need two matrices. For determinant or inverse, only one matrix is needed.
Next, enter your matrix data into the input fields. Type each row, separating entries with spaces or commas. Use a semicolon to separate rows. For example, a 2×2 matrix with rows (1, 2) and (3, 4) is entered as '1 2; 3 4'.
Then, select the desired operation from the available options. The calculator offers multiplication, addition, subtraction, determinant, inverse, and transpose. Choose the one that matches your calculation goal.
Finally, click the 'Calculate' button. The matrix calculator will display the result. If an operation is not possible, for example, if matrix sizes do not match, the calculator will explain why.
Checking Your Results
After performing a calculation, it is wise to check the result, especially for complex operations. For matrix multiplication, a quick mental check of the first entry can verify your input. Remember, the first entry of A times B is the first row of A multiplied by the first column of B.
When finding an inverse, multiply your original matrix by the calculated inverse. The result should be the identity matrix. This is a robust check for accuracy. For example, for a 2×2 matrix, the identity matrix has 1s on the main diagonal and 0s elsewhere.
For a transpose, simply compare the rows of the original matrix to the columns of the result. Each row in the original should directly correspond to a column in the transposed matrix. Therefore, verifying the first row and column is usually enough.
Tips for Efficient Use
Always double-check your input before calculating. A single misplaced comma or number can lead to an incorrect result. Review the entry format: '1 2; 3 4' for a 2×2 matrix.
Understand the requirements for each operation. Multiplication needs compatible sizes; determinants and inverses require square matrices. The calculator will flag errors, but knowing these rules saves time.
Use the provided examples to quickly grasp the input format and operation types. Also, the loaded default matrices can be a useful starting point for understanding how the calculator works. Experiment with them to build confidence.
Related guides
- Matrix Multiplication, Determinant and Inverse
- Multivariable Calculus
- Partial Derivatives
- Polynomials
Further reading
- Matrix multiplication (Wikipedia) — definition, properties and algorithms.
- Determinant (Wikipedia) — formulas, properties and geometric meaning.
FAQ
How do you multiply two matrices?
Multiply each row of the first by each column of the second (multiply matching entries and add). The number of columns of the first must equal the number of rows of the second.
How do you find the determinant of a 2 × 2 matrix?
( detbegin{pmatrix}a&b\c&dend{pmatrix} = ad – bc ).
When does a matrix have an inverse?
When it’s square and its determinant is not zero.
What is the transpose of a matrix?
The matrix with rows and columns swapped: row 1 becomes column 1, and so on.
