Matrix Calculator (Add, Multiply, Determinant & Inverse)
AlgebraFreeNo sign-up
The matrix calculator multiplies by taking each row of A times each column of B. For A = [[1, 2, 3], [4, 5, 6]] and B = [[7, 8], [9, 10], [11, 12]], the top-left entry is 1·7 + 2·9 + 3·11 = 58, and A × B = [[58, 64], [139, 154]]. The same tool finds determinants, inverses, rank, RREF, powers and solutions of AX = B.
Show steps (6)
- A is 2 × 3 and B is 3 × 2. The inner sizes match (3 = 3), so A × B is defined and the result is 2 × 2 (the outer sizes).
- Each entry cᵢⱼ is row i of A times column j of B: multiply matching entries and add.
- c₁₁ = row 1 · column 1 = 1·7 + 2·9 + 3·11 = 58.
- c₁₂ = row 1 · column 2 = 1·8 + 2·10 + 3·12 = 64.
- c₂₁ = row 2 · column 1 = 4·7 + 5·9 + 6·11 = 139.
- c₂₂ = row 2 · column 2 = 4·8 + 5·10 + 6·12 = 154.
How to use the matrix calculator
- Choose an operation: add, subtract, scalar multiple, multiply, transpose, determinant, inverse, rank, RREF, power or solve AX = B.
- Set the size of each matrix (up to 6 × 6) with the row and column menus, then type the entries. Integers, decimals and fractions such as 3/4 all work, and answers stay exact.
- Read the result. Open Show steps to see each entry calculation, cofactor expansion or row operation, with the matrix after every column is cleared.
- Press Use result as A to keep working with the answer, for example to multiply by another matrix next.
Matrix size rules: when an operation is defined
| Operation | Requirement | Size of the result |
|---|---|---|
| A + B, A − B | A and B the same size | same as A |
| kA | any matrix | same as A |
| A × B | columns of A = rows of B | rows of A × columns of B |
| Aᵀ | any matrix | m × n becomes n × m |
| det A, A⁻¹, Aⁿ | A square (n × n) | a number (det) or n × n |
| AX = B | A and B have the same number of rows | X has the columns of A as rows |
If the sizes do not fit, the calculator tells you which numbers must match instead of returning an error code.
How to multiply matrices
Each entry of the product is a row of A times a column of B: multiply matching entries and add. For a 2 × 3 matrix times a 3 × 2 matrix, the inner sizes (3 and 3) match and the result is 2 × 2.
- c₁₁ = 1·7 + 2·9 + 3·11 = 7 + 18 + 33 = 58
- c₁₂ = 1·8 + 2·10 + 3·12 = 64
- c₂₁ = 4·7 + 5·9 + 6·11 = 139
- c₂₂ = 4·8 + 5·10 + 6·12 = 154
Order matters. Here B × A is also defined, but it is a 3 × 3 matrix, so A × B and B × A are not even the same size. Even for square matrices, AB and BA are usually different.
Determinant of a matrix
For a 2 × 2 matrix [[a, b], [c, d]], the determinant is ad − bc. For [[2, 1], [5, 3]], det = 2·3 − 1·5 = 1.
For larger matrices, use cofactor expansion: pick a row or column, multiply each entry by its sign (+ or −, in a checkerboard pattern starting with + in the top-left) and by its minor (the determinant left after deleting that entry’s row and column), then add. Choose the row with the most zeros. For [[2, 1, 1], [1, 3, 2], [1, 0, 0]], row 3 has two zeros, so det = +1 × det[[1, 1], [3, 2]] = 1·2 − 1·3 = −1.
The other method is row reduction: use row replacements, which do not change the determinant, to reach an upper triangular matrix, then multiply the diagonal entries. Each row swap flips the sign. Row reduction is much faster for 4 × 4 and larger matrices, and the calculator offers both methods.
How to find the inverse of a matrix
A square matrix has an inverse exactly when its determinant is not 0. For a 2 × 2 matrix, A⁻¹ = (1/det A)[[d, −b], [−c, a]]. With A = [[2, 1], [5, 3]] and det A = 1, A⁻¹ = [[3, −1], [−5, 2]].
For any size, use Gauss-Jordan elimination: write [A | I], row reduce until the left side is the identity, and read A⁻¹ on the right. For A = [[1, 2, 3], [0, 1, 4], [5, 6, 0]], three column clearings give A⁻¹ = [[−24, 18, 5], [20, −15, −4], [−5, 4, 1]]. Check by multiplying: A × A⁻¹ = I.
Solving a system of equations with matrices
The system 2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3 is AX = B with A = [[2, 1, −1], [−3, −1, 2], [−2, 1, 2]] and B = [[8], [−11], [−3]]. Row reducing [A | B] gives the identity on the left and the solution on the right: x = 2, y = 3, z = −1.
Row reduction also shows the other two cases. A row that reads 0 = c with c not zero means there is no solution. A column with no pivot means a free variable and infinitely many solutions; the calculator writes them with parameters such as x₁ = 3 − 2t, x₂ = t.
Rank and reduced row echelon form (RREF)
In reduced row echelon form, every pivot is 1, each pivot is to the right of the one above it, and every other entry in a pivot column is 0. The rank is the number of pivots. For [[1, 2, −1, 3], [2, 4, 1, 0], [3, 6, 0, 3]], the RREF is [[1, 2, 0, 1], [0, 0, 1, −2], [0, 0, 0, 0]], so the rank is 2. The third row was a combination of the first two.
Powers and the transpose
To square a matrix, multiply it by itself: for A = [[1, 1], [1, 0]], A² = [[2, 1], [1, 1]]. It is not the same as squaring each entry. Higher powers can be found by repeated squaring; for this matrix, A¹⁰ = [[89, 55], [55, 34]], which contains Fibonacci numbers. A negative power uses the inverse: A⁻² = (A⁻¹)².
The transpose Aᵀ turns rows into columns. A square matrix is symmetric when Aᵀ = A, that is, when the entry in row i, column j equals the entry in row j, column i, as in [[1, 7], [7, 3]].
Common matrix mistakes
- Multiplying entry by entry instead of row by column.
- Assuming AB = BA. Matrix multiplication is not commutative.
- Dividing by a matrix. There is no matrix division; multiply by the inverse instead, on the correct side.
- Forgetting the sign pattern in cofactor expansion, or the sign change from a row swap.
- Rounding fractions during row reduction. Keep exact fractions until the end.
Using the matrix calculator for homework
Work the problem by hand, then enter it and compare with the steps. The step list shows the matrix after each column is cleared, so you can find the exact row operation where your work changed. Check the sizes before you start, and finish every inverse or system with a multiplication check.
Matrices practice quiz: 10 questions
Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.
The inner sizes (3 and 3) match, so the product exists, and its size is the outer sizes: 2 × 4.
det = 2·3 − 1·5 = 1. Swap a and d, change the signs of b and c, and divide by 1.
Row 1 becomes column 1 and row 2 becomes column 2, so the 2 × 3 matrix becomes 3 × 2.
A² = A × A: row 1 times column 2 is 1·2 + 2·1 = 4, and the other entries stay 1, 0 and 1. Doubling every entry gives [[2, 4], [0, 2]], which is 2A, not A².
Row 2 is twice row 1, so row reduction leaves one nonzero row: rank 1.
Each row swap multiplies the determinant by −1. Adding a multiple of one row to another leaves it unchanged.
Row reduce [[1, 1 | 5], [1, −1 | 1]]: R₂ → R₂ − R₁ gives −2y = −4, so y = 2 and x = 3.
Quiz complete
Frequently asked questions
How do you multiply matrices?
Multiply each row of the first matrix by each column of the second: multiply matching entries and add. The number of columns in the first matrix must equal the number of rows in the second, and the result has the rows of the first and the columns of the second.
How do you find the inverse of a matrix?
For a 2 × 2 matrix, swap a and d, change the signs of b and c, and divide by ad − bc. For larger matrices, row reduce [A | I] until the left side is I; the right side is A⁻¹.
How do you calculate a matrix determinant?
Use ad − bc for 2 × 2 matrices. For 3 × 3 and larger, expand by cofactors along a row or column with many zeros, or row reduce to triangular form and multiply the diagonal, changing the sign for each row swap.
How do you know if a matrix is invertible?
A square matrix is invertible exactly when its determinant is not 0. Equivalently, its rank equals its size, or its RREF is the identity matrix. [[1, 2], [2, 4]] is not invertible because det = 1·4 − 2·2 = 0.
How do you square a matrix?
Multiply the matrix by itself, A² = A × A, using row-by-column multiplication. Only square matrices can be squared.
How can you tell if a matrix is symmetric?
Compare it with its transpose. If Aᵀ = A, the matrix is symmetric: the entries mirror each other across the main diagonal. The Transpose tab reports this for square matrices.
Related calculators
- Eigenvalue calculator: eigenvalues and eigenvectors of 2 × 2 and 3 × 3 matrices
- Cramer's rule calculator: solve systems with determinants
- System of equations calculator: substitution, elimination and graphs
- Fraction calculator: arithmetic with the fractions that appear in inverses
More algebra calculators
Related to This Article
More math articles
- Grade 2 Math Practice for North Carolina Second Graders
- Grade 5 Math Workbooks: Compare 3 Practice Options
- Competitive Wage: Market Supply, Demand and One Firm’s Hiring
- The Best Grade 5 ELA Practice Tests for New York Students
- What Kind of Math Is on the ACT Test?
- Ecosystems: Producers, Consumers, and Decomposers
- How to Find Even and Odd Functions?
- Area and Perimeter of Any Shape: Complete Formula Guide
- Correlation Is Not Causation
- Work, Occupations, Professions, and Segmented Labor Markets









What people say about "Matrix Calculator: Add, Multiply, Determinant, Inverse"?
No one replied yet.