Updated on April 21st, 2026

Matrix Calculator

Created By Jehan Wadia

Copied to clipboard!
Expression Input
Supported: A*B, A+B, A-B, inv(A), det(A), transpose(A) or A^T, trace(A), rank(A), rref(A), eigenvalues(A), A^n, 3*A, adj(A), cofactor(A), minor(A), norm(A), LU(A), cholesky(A)
Matrix A
Grid Text
Matrix B
Grid Text
Operations
Basic
Unary (Matrix A)
Unary (Matrix B)
Result

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.


Frequently Asked Questions

What is a matrix calculator used for?

A matrix calculator is used to perform math operations on matrices, which are grids of numbers arranged in rows and columns. You can use it to add, subtract, and multiply matrices, find determinants, calculate inverses, compute eigenvalues, and perform decompositions. It saves time and helps you avoid errors when doing linear algebra problems.

What size matrices can I use with this calculator?

You can use matrices from 1×1 up to 10×10 in size. Use the + and − buttons next to Rows and Cols to change the dimensions of Matrix A or Matrix B. You can also type the size directly into the number fields.

Why does the calculator say my matrices must have the same dimensions?

This error shows up when you try to add or subtract two matrices that do not have the same number of rows and columns. Matrix addition and subtraction only work when both matrices are the exact same size. Make sure Matrix A and Matrix B have matching dimensions before adding or subtracting.

Why does matrix multiplication fail with a dimension error?

Matrix multiplication requires the number of columns in the first matrix to equal the number of rows in the second matrix. For example, if Matrix A is 2×3, then Matrix B must have 3 rows. If this rule is not met, the calculator will show an error.

What does it mean when a matrix is singular?

A singular matrix has a determinant of zero. This means the matrix does not have an inverse. If you try to compute the inverse of a singular matrix, the calculator will show an error. Singular matrices cannot be used to solve certain systems of equations.

Can I enter fractions or special values into the matrix cells?

Yes. You can type fractions like 1/3, constants like pi or e, and even functions like sqrt(2), sin(1), or cos(0.5) into any cell. The calculator will convert these to decimal numbers automatically.

What is the difference between the expression bar and the operation buttons?

They do the same thing in different ways. The expression bar lets you type operations like A * B or det(A) using text. The operation buttons below let you click to run the same operations without typing. Use whichever method is easier for you.

What does RREF mean and when do I use it?

RREF stands for Reduced Row Echelon Form. It is the simplest version of a matrix after performing row operations. You use RREF to solve systems of linear equations. The calculator shows each row operation step by step so you can follow along.

What is the identity matrix?

The identity matrix is a square matrix with 1s along the main diagonal and 0s everywhere else. It works like the number 1 in regular math — any matrix multiplied by the identity matrix stays the same. You can quickly fill a matrix with identity values using the Identity button.

Is A × B the same as B × A?

No. Matrix multiplication is not commutative, which means A × B usually gives a different result than B × A. In some cases B × A might not even be possible if the dimensions do not match. Always pay attention to the order when multiplying matrices.

How do I raise a matrix to a power?

Type A^2 or A^3 in the expression bar, or click the An button and enter the power when prompted. The matrix must be square. You can also use negative powers like A^-1 to get the inverse.

What is the difference between the cofactor matrix and the minor matrix?

The minor matrix contains the determinant of each smaller matrix you get by removing one row and one column. The cofactor matrix is the same thing but with a sign pattern applied — entries alternate between positive and negative based on their position. The adjugate is the transpose of the cofactor matrix.

Why does Cholesky decomposition fail on my matrix?

Cholesky decomposition only works on matrices that are both symmetric (the matrix equals its transpose) and positive definite (all eigenvalues are positive). If your matrix does not meet both conditions, the calculator will show an error. Try LU decomposition instead.

Can I chain multiple operations together in the expression bar?

Yes. You can type compound expressions like 3 * A + B, inv(A) * B, or A * B + A. The calculator follows standard order of operations, handling multiplication before addition and subtraction.

How do I use the result in my next calculation?

After a matrix result appears, click Result → A to load it into Matrix A, or Result → B to load it into Matrix B. This lets you chain calculations without re-entering numbers. You can also click Copy Result to save it to your clipboard.

What does the Frobenius norm tell me about a matrix?

The Frobenius norm measures the overall size of a matrix. It is calculated by squaring every entry, adding them all up, and taking the square root. It is similar to finding the length of a vector but applied to an entire matrix. A larger norm means the matrix has larger values overall.

How do I paste a matrix from a spreadsheet?

Click the Text tab above the matrix grid. Paste your data into the text box — values separated by commas or tabs, with each row on a new line. Then click Apply to load it into the grid. The calculator will automatically adjust the row and column count.


Related Calculators

Dot Product Calculator

Visit Dot Product Calculator