Matrix Calculator
- A and B are both 3×3, so they can be added entry by entry.
- Row 1: (1 + 1, 2 + 0, 3 + 2) = (2, 2, 5).
- Row 2: (0 + 3, 1 + 1, 4 + 0) = (3, 2, 4).
- Row 3: (5 + 2, 6 + 4, 0 + 1) = (7, 10, 1).
- A + B = B + A: confirmed.
Matrix Calculator: Add, Multiply, Invert and More
This free matrix calculator works with matrices from 1×1 up to 6×6. Enter the numbers, choose an operation, and you get the result straight away along with its size, determinant, rank and trace. It can add, subtract and multiply matrices, scale a matrix by a number, transpose it, find a determinant or an inverse, and reduce a matrix to its row echelon form. Every answer keeps exact fractions and comes with step-by-step working.
Quick answer: the matrix [[1, 2, 3], [0, 1, 4], [5, 6, 0]] has a determinant of 1, so its inverse exists and is [[−24, 18, 5], [20, −15, −4], [−5, 4, 1]]. Multiplying the two gives the identity matrix, which is how the calculator confirms the result.
What Is a Matrix?
A matrix is a rectangular grid of numbers arranged in rows and columns. A matrix with 3 rows and 2 columns is called a 3×2 matrix. Matrices are used to store data, describe transformations such as rotations and scaling, and write whole systems of equations in a compact form. If you only need to solve equations, the linear equations calculator does that directly.
How Each Operation Works
Addition and subtraction are done entry by entry and need matrices of the same size. Multiplying by a number scales every entry. Matrix multiplication is different: each entry of the result is a row of the first matrix combined with a column of the second, so the number of columns in A must match the number of rows in B. The transpose swaps rows and columns, so a 2×3 matrix becomes 3×2. The table shows a few examples.
| Operation | Example | Result |
|---|---|---|
| Add | A + B with A = [[1, 2, 3], [0, 1, 4], [5, 6, 0]] and B = [[1, 0, 2], [3, 1, 0], [2, 4, 1]] | [[2, 2, 5], [3, 2, 4], [7, 10, 1]] |
| Multiply | [[1, 2], [3, 4]] × [[0, 1], [1, 0]] | [[2, 1], [4, 3]] |
| Multiply (reversed) | [[0, 1], [1, 0]] × [[1, 2], [3, 4]] | [[3, 4], [1, 2]] |
| Determinant | [[4, 7], [2, 6]] | 4×6 − 7×2 = 10 |
| Inverse | [[4, 7], [2, 6]] | [[3/5, −7/10], [−1/5, 2/5]] |
| Rank | [[1, 2, 3], [2, 4, 6], [1, 0, 1]] | 2 |
Order Matters in Multiplication
With ordinary numbers, 3 × 5 and 5 × 3 are the same. With matrices they usually are not. In the examples above, swapping the two matrices swaps the columns of the answer in one case and the rows in the other. Always check which matrix is A and which is B before reading the result.
Determinant and Inverse
The determinant is a single number worked out from a square matrix. When it is zero the matrix is singular and cannot be inverted. When it is not zero, the inverse exists and multiplying a matrix by its inverse gives the identity matrix. For a 2×2 matrix the determinant is ad − bc, and the inverse swaps the diagonal, changes the signs of the other two entries and divides by the determinant. Larger matrices are handled by exact row reduction, so the results stay as clean fractions.
Rank and Row Reduction
Row reduction uses simple operations, such as swapping rows or adding a multiple of one row to another, to bring a matrix to reduced row echelon form. The number of leading entries, called pivots, is the rank of the matrix. A square matrix has full rank exactly when its determinant is not zero. If you are working with polynomials or other expressions rather than grids of numbers, the polynomial calculator may be the better fit.
Who Uses a Matrix Calculator?
Students use it to check homework in algebra and linear algebra. Programmers and engineers use matrices in graphics, simulations and data work. Economists and scientists use them to model systems with many connected variables. For arithmetic with fractions, try the fraction calculator, and for general problems the math solver or the scientific calculator.
How to Use This Matrix Calculator
Pick an operation
Choose from add, subtract, multiply, scale, transpose, determinant, inverse, rank or RREF.
Set the sizes
Use the row and column menus to set each matrix between 1×1 and 6×6.
Enter the numbers
Fill in each cell with a whole number, decimal or negative. The result updates as you type.
Read the result and the working
See the answer, its properties, a check and the steps. Switch between fractions and decimals.