Add, subtract, multiply, transpose, and find the determinant, inverse, rank, trace, RREF and eigenvalues — with the row operations shown.
A matrix calculator performs linear-algebra operations on rectangular arrays of numbers. Enter your matrix below, choose an operation, and it returns the result with the working. It handles addition, subtraction, multiplication, transpose, determinant, inverse, rank, trace, reduced row echelon form and 2×2 eigenvalues, for matrices up to 6×6 — including non-square ones, which many calculators refuse.
A matrix is a rectangular array of numbers arranged in rows and columns. Its order is written rows × columns, so a 2×3 matrix has 2 rows and 3 columns. Each entry is identified by its position, written aij for the value in row i and column j.
Matrices store and transform data compactly. A system of linear equations, a rotation in 3D graphics, and the weights of a neural-network layer are all matrices, which is why linear algebra sits under so much of modern engineering and computing.
What the symbols mean. aij is the entry in row i, column j. The Σ in the multiplication rule means you run across a row of A and down a column of B, multiplying pairs and adding the results — which is why the inner dimensions must match.
Pick an operation, set the dimensions, then type your values. The B matrix appears only for operations that need it, and its dimensions adjust automatically where they are forced — for A + B both must match, and for A × B the rows of B follow the columns of A. Use Identity, Random or Zero to fill a matrix quickly, then press Calculate. Results include the row operations for RREF and inverse, so you can follow the method rather than just copy the answer.
Add or subtract matrices entry by entry. Both must have exactly the same order — a 2×3 cannot be added to a 3×2. For example, [[1,2],[3,4]] + [[5,6],[7,8]] = [[6,8],[10,12]].
To multiply A × B, take each row of A against each column of B: multiply corresponding entries and add. The number of columns in A must equal the number of rows in B, and the answer has A's rows and B's columns. So a 2×3 times a 3×2 gives a 2×2.
Order matters. AB and BA are usually different, and swapping them can make the multiplication impossible.
The determinant is a single number describing how a square matrix scales area or volume. A determinant of 2 doubles areas; a determinant of 0 collapses them flat, which is exactly why such a matrix has no inverse.
This calculator uses LU decomposition with partial pivoting rather than cofactor expansion. Cofactor expansion is fine on paper but becomes both slow and numerically unstable beyond about 4×4.
The inverse A⁻¹ undoes what A does: A × A⁻¹ gives the identity matrix. Only square matrices with a non-zero determinant have one. A matrix with determinant 0 is called singular and cannot be inverted.
Transpose flips a matrix over its diagonal, turning rows into columns. A 2×3 becomes a 3×2.
Rank counts the independent rows — how much genuine information the matrix holds. A 3×3 matrix with rank 2 has one row that is a combination of the others, which means its determinant is 0.
Trace is the sum of the diagonal entries of a square matrix, and it equals the sum of the eigenvalues.
Gaussian elimination uses three row operations — swapping rows, multiplying a row by a non-zero number, and adding a multiple of one row to another — to simplify a matrix without changing the solutions it represents.
Row echelon form (REF) has zeros below each leading entry, forming a staircase. Reduced row echelon form (RREF) goes further: every leading entry is 1 and is the only non-zero value in its column. RREF is unique for a given matrix, which makes it the standard way to solve systems and read off the rank. Gauss-Jordan elimination is the name for carrying elimination all the way to RREF.
Select RREF above and the calculator lists every row operation it performs, in order.
An eigenvector of a matrix is a direction that the matrix does not rotate — it only stretches or shrinks it. The amount of that stretch is the eigenvalue. Formally, Av = λv.
For [[4,1],[2,3]] the trace is 7 and the determinant is 10, so λ² − 7λ + 10 = 0, giving eigenvalues 5 and 2. This calculator computes exact eigenvalues for 2×2 matrices and reports when they are complex. Larger matrices need iterative numerical methods that are beyond a browser tool.
Eigenvalues matter because they reveal a matrix's behaviour: they drive principal component analysis in statistics, vibration modes in engineering, and stability analysis in control systems.
| Type | Definition | Example |
|---|---|---|
| Square | Same number of rows and columns | 2×2, 3×3 |
| Identity (I) | 1s on the diagonal, 0s elsewhere | [[1,0],[0,1]] |
| Zero | Every entry is 0 | [[0,0],[0,0]] |
| Diagonal | Non-zero only on the diagonal | [[3,0],[0,5]] |
| Triangular | Zeros above or below the diagonal | [[1,2],[0,4]] |
| Symmetric | Equal to its own transpose | [[1,2],[2,3]] |
| Singular | Determinant is 0, so no inverse | [[1,2],[2,4]] |
| Non-singular | Determinant is not 0, inverse exists | [[1,2],[3,4]] |
The identity matrix behaves like the number 1: multiplying by it changes nothing.
After every calculation the tool inspects the matrix and labels what it is. A matrix can carry more than one label at once — [[1,2],[2,4]] is both symmetric and singular, and the identity matrix is simultaneously diagonal, symmetric and orthogonal, though it is named simply as the identity.
| Badge | What it means | Example |
|---|---|---|
| Identity matrix | 1s on the diagonal, 0s elsewhere | [[1,0],[0,1]] |
| Zero matrix | Every entry is 0 | [[0,0],[0,0]] |
| Diagonal matrix | Non-zero only on the diagonal | [[3,0],[0,5]] |
| Scalar matrix | Diagonal with every entry the same | [[4,0],[0,4]] |
| Upper triangular | All zeros below the diagonal | [[1,2],[0,4]] |
| Lower triangular | All zeros above the diagonal | [[1,0],[3,4]] |
| Symmetric | Equal to its own transpose | [[1,2],[2,3]] |
| Skew-symmetric | Equal to the negative of its transpose | [[0,2],[−2,0]] |
| Orthogonal | A × Aᵀ gives the identity; preserves lengths | [[0,−1],[1,0]] |
| Singular | Determinant 0, so no inverse | [[1,2],[2,4]] |
| Invertible | Determinant is not 0 | [[1,2],[3,4]] |
Results are colour-coded so the structure is visible rather than something you have to work out:
LU decomposition splits a matrix into a lower and an upper triangular matrix, which makes solving systems and finding determinants much faster. This calculator uses LU internally for its determinant.
QR decomposition splits a matrix into an orthogonal matrix Q and an upper triangular R. It underpins least-squares fitting and eigenvalue algorithms.
AI and machine learning. A neural network layer is a matrix multiplication — inputs times weights. Training a large model is billions of these operations, which is exactly what GPUs are built to do in parallel.
Computer graphics. Every rotation, scale, translation and camera perspective is a 4×4 transformation matrix. Moving a 3D model means multiplying its vertices by matrices.
Engineering. Structural analysis solves large systems of equations as matrices, and finite element analysis is matrix algebra at scale.
Physics. Quantum mechanics represents states as vectors and observables as matrices, where eigenvalues are the measurable quantities.
Data science. Principal component analysis finds eigenvectors of a covariance matrix to reduce dimensions while keeping the most variation.
Cryptography and coding. Some ciphers and error-correcting codes are built on matrix operations in modular arithmetic.
Economics. Input-output models describe how industries feed into each other using large matrices.
1) [[6,8],[10,12]] 2) 10 3) [[1,4],[2,5],[3,6]] 4) 7 5) [[1,0,0],[0,1,0],[0,0,1]]
1) [[2,1],[4,3]] 2) [[0.6,−0.7],[−0.2,0.4]] 3) 1 4) 5 and 2 5) Its determinant is 0, so it is singular
What is a matrix?
A matrix is a rectangular array of numbers arranged in rows and columns. Its size is described as rows by columns, so a 2 by 3 matrix has two rows and three columns.
How do you multiply matrices?
Take each row of the first matrix against each column of the second, multiply the matching entries and add the results. The columns of the first matrix must equal the rows of the second.
How do you add matrices?
Add the entries in matching positions. Both matrices must have exactly the same number of rows and columns, otherwise addition is not defined.
How do you find the determinant?
For a 2 by 2 matrix the determinant is ad minus bc. For larger matrices you can expand by cofactors or, more efficiently, reduce the matrix to triangular form and multiply the diagonal entries.
How do you find the inverse of a matrix?
Attach an identity matrix alongside the original and apply row operations until the original becomes the identity. Whatever the attached half becomes is the inverse. A matrix only has an inverse if it is square and its determinant is not zero.
What is a singular matrix?
A singular matrix has a determinant of zero, which means it has no inverse. Geometrically it collapses space onto a lower dimension, so the transformation cannot be undone.
When is a matrix invertible?
A matrix is invertible when it is square and its determinant is not zero. Equivalently, its rank equals its size and its rows are linearly independent.
What is matrix transpose?
The transpose flips a matrix over its main diagonal, so rows become columns and columns become rows. A 2 by 3 matrix becomes a 3 by 2 matrix.
What is matrix rank?
Rank is the number of linearly independent rows, which is the amount of genuine information a matrix carries. You can find it by reducing the matrix to row echelon form and counting the non-zero rows.
What is the trace of a matrix?
The trace is the sum of the entries on the main diagonal of a square matrix. It also equals the sum of the eigenvalues.
What is Gaussian elimination?
Gaussian elimination simplifies a matrix using three row operations: swapping two rows, multiplying a row by a non-zero number, and adding a multiple of one row to another. It is the standard method for solving systems of linear equations.
What is the difference between row echelon form and reduced row echelon form?
Row echelon form has zeros below each leading entry. Reduced row echelon form goes further, making every leading entry a 1 and the only non-zero value in its column. Reduced row echelon form is unique for a given matrix.
What is Gauss-Jordan elimination?
Gauss-Jordan elimination is Gaussian elimination carried all the way to reduced row echelon form. It is commonly used to find inverses and to solve systems completely.
What is an identity matrix?
An identity matrix has ones along the main diagonal and zeros everywhere else. Multiplying any matrix by a matching identity matrix leaves it unchanged, just as multiplying a number by one does.
What are eigenvalues?
An eigenvalue is the factor by which a matrix stretches or shrinks a particular direction. You find them by solving the equation determinant of A minus lambda times I equals zero.
What are eigenvectors?
An eigenvector is a direction that a matrix does not rotate, only scales. The scaling factor for that direction is its eigenvalue, and together they satisfy A times v equals lambda times v.
Can you divide matrices?
There is no matrix division. Instead of dividing by a matrix you multiply by its inverse, which is only possible when the inverse exists.
Why is AB not the same as BA?
Matrix multiplication combines rows with columns, so changing the order changes which values are paired. In many cases BA is not even defined, because the dimensions no longer line up.
How do engineers use matrices?
Engineers use matrices to solve large systems of equations in structural analysis, finite element modelling, control systems and circuit analysis, where many quantities depend on one another at once.
How do AI models use matrices?
Each layer of a neural network multiplies its inputs by a matrix of weights. Training a large model performs billions of these multiplications, which is why graphics processors, designed for parallel matrix work, are used for AI.
How do graphics engines use matrices?
Every rotation, scaling, translation and camera perspective in 3D graphics is represented as a 4 by 4 transformation matrix. Moving an object means multiplying its coordinates by these matrices.
Is this Matrix Calculator free?
Yes. It is free with no sign-up, works on any device, and runs entirely in your browser so your data stays private.