Add matrices
With A = [[3, 7], [4, 9]] and B = [[8, 2], [4, 7]], add the entries in the same position: 3 + 8, 7 + 2, 4 + 4, and 9 + 7.
Add, subtract, and multiply matrices, or find a determinant, inverse, rank, transpose, or row reduced form. Choose an operation, type your matrices, and see the answer with every step.
Calculated with exact fractions, so nothing is rounded.
A is 2 × 2 and B is 2 × 2. The inner sizes match (2), so the product is 2 × 2.
Each entry is a row of the first matrix times a column of the second. The entry in row 1, column 1 is 3·8 + 7·4 = 52.
A matrix is a rectangular grid of numbers arranged in rows and columns. A matrix with m rows and n columns is an m × n matrix, and aᵢⱼ means the entry in row i and column j. Matrices describe linear transformations such as rotations and scalings, store data, and let you solve many linear equations at once. This free matrix calculator adds, subtracts, and multiplies matrices, and finds the transpose, determinant, inverse, rank, trace, powers, and reduced row echelon form. It shows the steps, uses exact fractions, and checks determinants and inverses with a second method.
1/2. Press the up and down arrow keys to move between rows.| Operation | What it does and what it needs |
|---|---|
| Add: A + B | Adds matching entries. A and B must be the same size. |
| Subtract: A − B | Subtracts matching entries. A and B must be the same size. |
| Multiply: A × B | The number of columns in A must equal the number of rows in B. |
| Transpose: Aᵀ | Swaps the rows and columns of A. |
| Determinant: det(A) | A must be square (same number of rows and columns). |
| Inverse: A⁻¹ | A must be square, and its determinant must not be 0. |
| Rank of A | Counts the independent rows of A. |
| Trace: tr(A) | Adds the diagonal entries. A must be square. |
| Row reduce (RREF) | Gauss-Jordan elimination to reduced row echelon form. |
| Power: Aⁿ | A must be square. The power n is a whole number from 0 to 10. |
| Multiply by a number: k·A | Multiplies every entry of A by the number k. |
These results come straight from the calculator, so you can compare them with your own work.
With A = [[3, 7], [4, 9]] and B = [[8, 2], [4, 7]], add the entries in the same position: 3 + 8, 7 + 2, 4 + 4, and 9 + 7.
Subtract the entries in the same position instead: 3 − 8, 7 − 2, 4 − 4, and 9 − 7.
Each entry is a row of A times a column of B. The top-left entry is 3·8 + 7·4 = 52.
Swap rows and columns. A 2 × 3 matrix [[1, 2, 3], [4, 5, 6]] becomes a 3 × 2 matrix.
For A = [[3, 7], [4, 9]] the determinant is a·d − b·c = 3·9 − 7·4 = −1.
Because the determinant is −1 and not 0, A has an inverse: (1/det) times [[d, −b], [−c, a]].
The rows of [[1, 2, 3], [4, 5, 6], [7, 8, 9]] are not independent: the third row is twice the second minus the first. Row reduction leaves two nonzero rows.
Row reducing an augmented matrix solves the system. Here the last column holds the right-hand sides, and the left side becomes the identity.
Three row operations never change the solutions of a linear system: swap two rows, multiply a row by a number that is not 0, and add a multiple of one row to another. Gauss-Jordan elimination uses them to turn a matrix into reduced row echelon form, where each pivot is 1 and is the only nonzero entry in its column. The number of pivots is the rank. To find an inverse, the calculator writes A next to the identity matrix and row reduces: when the left side becomes the identity, the right side is A⁻¹. If a column has no pivot, A is singular and has no inverse.
It does not find eigenvalues, eigenvectors, or LU, QR, and other decompositions, and it does not accept symbols, variables, or complex numbers as entries.
Working through calculus too? Try the derivative calculator, the integral calculator, or thelimit calculator.
A matrix is a rectangular grid of numbers arranged in rows and columns. A matrix with m rows and n columns is called an m × n matrix, and the entry in row i, column j is written aᵢⱼ. Matrices are used to describe linear transformations and to solve systems of linear equations.
Both matrices must be exactly the same size. Add or subtract the entries that sit in the same position. For example, adding [[3, 7], [4, 9]] and [[8, 2], [4, 7]] gives [[11, 9], [8, 16]].
The number of columns in the first matrix must equal the number of rows in the second. Each entry of the product is the sum of products of one row of the first matrix with one column of the second. An m × p matrix times a p × n matrix gives an m × n matrix.
Not usually. Matrix multiplication is not commutative, so A × B and B × A can be different, and one of them may not even exist if the sizes do not match. It is associative, so (A × B) × C equals A × (B × C).
The determinant is defined only for square matrices. For a 2 × 2 matrix [[a, b], [c, d]] it is a·d − b·c. For larger matrices you can expand along a row or reduce the matrix to triangular form and multiply the diagonal, keeping track of row swaps. The calculator uses the second method for the steps and checks the result with cofactor expansion.
A square matrix has an inverse exactly when its determinant is not 0. Such a matrix is called invertible or non-singular. If the determinant is 0 the matrix is singular and has no inverse. The inverse A⁻¹ satisfies A × A⁻¹ = I, where I is the identity matrix.
The rank is the number of independent rows (or columns). You find it by row reducing the matrix and counting the nonzero rows, which is the same as counting the pivots. A square n × n matrix is invertible exactly when its rank is n.
The transpose Aᵀ swaps the rows and columns of A. The first row becomes the first column, the second row becomes the second column, and so on. An m × n matrix becomes an n × m matrix.
Matrices can be from 1 × 1 up to 6 × 6. Entries can be whole numbers, decimals, or fractions such as 1/2, and the calculator works with exact fractions, so nothing is rounded along the way. Entries must be numbers, not symbols or variables.
Yes. For addition and multiplication it shows each entry before it is simplified. For determinants, inverses, rank, and row reduction it lists every row operation with the matrix after each one. Determinants and inverses are also checked automatically with a second method.
Not yet. This calculator covers addition, subtraction, multiplication, scalar multiples, powers, transpose, determinant, inverse, rank, trace, and reduced row echelon form. Eigenvalues, eigenvectors, and matrix decompositions are not included.