Introduction
A matrix is a grid of numbers arranged in rows and columns. Matrices are used all the time in linear algebra to solve systems of equations, transform shapes, and work with data. This matrix calculator lets you perform common matrix operations quickly and easily. You can add, subtract, and multiply matrices, find determinants, calculate inverses, and more — all without doing the math by hand. Whether you are a student learning linear algebra for the first time or just need a fast way to check your work, this tool will save you time and help you get accurate results.
How to Use Our Matrix Calculator
Enter values into Matrix A and Matrix B, choose an operation or type an expression, and the calculator will give you the result instantly. It handles everything from basic arithmetic to advanced linear algebra operations like determinants, inverses, eigenvalues, and decompositions.
Matrix A and Matrix B Dimensions: Set the number of rows and columns for each matrix using the + and − buttons or by typing a number directly. Each matrix can be up to 10 × 10 in size.
Matrix Cell Values: Click on any cell in the grid to type a number. You can enter whole numbers, decimals, fractions like 1/3, or even expressions like sqrt(2). Click a cell and it will highlight so you can type right away.
Grid and Text Input Tabs: Use the Grid tab to fill in values one cell at a time, or switch to the Text tab to type or paste an entire matrix at once. In text mode, separate values with commas and put each row on a new line, then click Apply.
Quick Fill Buttons: Use the buttons below each matrix to quickly fill it with zeros, ones, an identity matrix, or random values. You can also clear all cells, copy the matrix to your clipboard, or paste one in from another source.
Swap Button (A ↔ B): Click this button between the two matrices to swap all the values and dimensions of Matrix A and Matrix B instantly.
Expression Input Bar: Type any supported expression at the top, such as A * B, det(A), inv(A), A^T, 3 * A + B, or eigenvalues(A). Press the = button or hit Enter to evaluate it. As you type, suggestions will appear to help you pick the right operation.
Operation Buttons: Instead of typing an expression, you can click any button in the Operations panel. Basic operations include A + B, A − B, A × B, scalar multiplication, and matrix power. Unary operations for Matrix A or B include transpose, determinant, inverse, trace, rank, RREF, adjugate, cofactor matrix, minor matrix, eigenvalues, Frobenius norm, LU decomposition, and Cholesky decomposition.
Scalar × A and An: When you click Scalar × A, a prompt will ask you to enter a number to multiply every element of Matrix A by. When you click An, a prompt will ask for the power to raise the matrix to. If you need help with exponents, our dedicated tool can assist.
Result Section: The computed answer appears at the bottom. If the result is a matrix, it displays in a grid. If it is a single number like a determinant or trace, it shows as a large value. For decompositions and eigenvalues, the result appears as formatted text.
Copy Result, Result → A, and Result → B: Click Copy Result to copy the answer to your clipboard. Click Result → A or Result → B to load a matrix result directly into Matrix A or Matrix B so you can use it in your next calculation.
Show Steps: When available, a Show Steps button appears below the result. Click it to see a step-by-step breakdown of how the answer was computed, which is helpful for learning or checking your work.
Matrix Calculator: Perform Matrix Operations Online
A matrix is a grid of numbers arranged in rows and columns. Matrices are one of the most important tools in a branch of math called linear algebra. Scientists, engineers, computer programmers, and economists use matrices every day to solve systems of equations, transform shapes, analyze data, and much more.
What Can You Do With Matrices?
This matrix calculator lets you perform a wide range of operations on one or two matrices at a time. Here are the key operations and what they mean:
- Addition and Subtraction (A + B, A − B): You can add or subtract two matrices only if they have the same number of rows and columns. The calculator combines matching entries to produce a new matrix of the same size.
- Multiplication (A × B): Matrix multiplication combines two matrices to produce a new one. For this to work, the number of columns in the first matrix must equal the number of rows in the second. Unlike regular number multiplication, A × B does not always equal B × A.
- Scalar Multiplication: This means multiplying every entry in a matrix by a single number (called a scalar). For example, multiplying a matrix by 3 triples every value inside it. You can use our percentage calculator if you need to scale values by a percent instead.
- Transpose (Aᵀ): The transpose flips a matrix over its diagonal, turning its rows into columns and its columns into rows. A 2×3 matrix becomes a 3×2 matrix after transposing.
- Determinant (det): The determinant is a single number calculated from a square matrix. It tells you whether the matrix has an inverse and is used to solve systems of linear equations. A determinant of zero means the matrix is singular and cannot be inverted.
- Inverse (A⁻¹): The inverse of a matrix is like dividing by that matrix. When you multiply a matrix by its inverse, you get the identity matrix (a matrix with 1s on the diagonal and 0s everywhere else). Only square matrices with a non-zero determinant have an inverse.
- Trace: The trace is simply the sum of the diagonal entries of a square matrix.
- Rank: The rank tells you how many rows (or columns) in a matrix are truly independent — that is, not just copies or combinations of other rows. It helps you understand how much unique information a matrix holds.
- RREF (Reduced Row Echelon Form): RREF is the simplest form of a matrix after performing row operations. It is the standard method for solving systems of linear equations by hand or by computer.
- Eigenvalues: Eigenvalues are special numbers tied to a square matrix. They show up in physics, stability analysis, and data science (for example, in principal component analysis). An eigenvalue λ satisfies the equation Av = λv, where v is a non-zero vector. Finding eigenvalues for 2×2 and 3×3 matrices involves solving quadratic or cubic equations.
- LU Decomposition: This breaks a square matrix into a lower triangular matrix (L) and an upper triangular matrix (U). It is a fast way to solve multiple systems of equations that share the same matrix.
- Cholesky Decomposition: This is a special factoring that works only on symmetric, positive definite matrices. It splits the matrix into L × Lᵀ and is widely used in statistics and simulations.
- Adjugate, Cofactor, and Minor Matrices: These are intermediate matrices used when computing determinants and inverses. The cofactor matrix applies sign changes to each minor, and the adjugate is the transpose of the cofactor matrix.
- Frobenius Norm (‖A‖): This measures the overall "size" of a matrix by taking the square root of the sum of all squared entries. Think of it like finding the length of a vector, but for an entire matrix. The dot product calculator can help when you need to work with individual vectors instead.
Key Rules to Remember
Matrix math follows rules that are different from regular number math. Order matters in multiplication — A × B usually gives a different result than B × A. You can only add or subtract matrices that are the same size. And you can only multiply two matrices when the column count of the first matches the row count of the second. A square matrix (same number of rows and columns) is required for operations like determinant, inverse, trace, eigenvalues, and decompositions.
If you are working with related mathematical concepts, you might also find our standard deviation calculator helpful for statistical analysis, our slope calculator for finding the slope between points, or our combination and permutation calculators for counting problems. For calculus-related work that often accompanies linear algebra, try our derivative calculator or integral calculator.
If you are a student learning linear algebra, try using the "Show Steps" feature to see how each calculation is carried out. This can help you check homework or understand the process behind each operation. Tools like the sig fig calculator can also help ensure your final answers use the correct level of precision.