MatrixCalc

Matrix Calculator

Add, subtract, multiply, transpose, determinant, inverse, rank, trace and power. Up to 50×50.

Matrix A
rows: 3
cols: 3
Matrix B
rows: 3
cols: 3
Operations
Result
Pick an operation to see the result here. Errors will show up in this area.

Tips: adjust sizes (max 50×50). For A×B, cols(A)=rows(B). det/inverse/trace/power require square matrices.

React, Tailwind & shadcn/ui. No external math deps. — English

How to use this matrix calculator

  1. Set the size. Use the plus and minus buttons above each matrix to add or remove rows and columns, up to 50×50. Matrix B only matters for operations that need two matrices.
  2. Type the numbers. Move between cells with the arrow keys, as in a spreadsheet. Decimals and negatives are fine. Random fills the matrix if you just want to experiment.
  3. Pick an operation. The result appears immediately. Press Show steps to see how it was reached — and, where more than one method exists, to switch between them.

What you can compute

Everything below runs in the calculator above — nothing here is a separate tool, and the tabs group the operations by what they do rather than by how hard they are.

Arithmetic

The Basics tab adds and subtracts matrices of matching size, multiplies A by B in either order, and transposes either one. Scalars multiplies every entry by a number of your choosing, and Power raises a square matrix to an integer exponent by repeated squaring. The matrix multiplication calculator walks through all of these, including why AB and BA are usually different matrices and why (A·B)ᵀ reverses the order.

Elimination

Row reduction is the engine underneath most of the rest. The RREF calculator takes any matrix — square or rectangular — to reduced row echelon form, stops at plain row echelon form if you prefer, solves a linear system entered as an augmented matrix, and counts the pivots to give you the rank. The step-by-step panel names every operation as it happens, in the R2 → R2 − 3·R1 notation your course uses.

Square-matrix properties

The Advanced tab holds the numbers that only square matrices have: the determinant, the trace, the inverse, and the eigenvalues and eigenvectors. The trace and the determinant are worth computing together — one is the sum of the eigenvalues and the other their product, which pins down both eigenvalues of a 2×2 matrix without solving anything.

Decompositions

LU decomposition splits a square matrix into triangular factors you can reuse against many right-hand sides, and Cholesky does the same in half the work when the matrix is symmetric and positive definite. The characteristic polynomial lives in the same tab, computed exactly rather than by expanding a symbolic determinant.

A complete worked example

Take A = [[4, 7], [2, 6]] and ask for the inverse. Gauss-Jordan writes the identity next to A and reduces the left half until it becomes the identity:

4710
2601
103/5−7/10
01−1/52/5

The right half is A⁻¹. The step-by-step panel shows each row operation that got there — R1 → (1/4)·R1, R2 → R2 − 2·R1, and so on — in exact fractions, because the engine works in rational arithmetic rather than floating point. Multiply A × B after pasting the result into B and you should get the identity back, which is how you check any inverse.

Determinant, rank or inverse — which do you need?

These three describe the same underlying property from different angles, and it is easy to reach for the wrong one.

  • The determinant is a single number and only exists for square matrices. Use it when you need a yes-or-no answer about invertibility, or a scaling factor.
  • The rank works on any shape, square or not, and counts how many rows carry independent information. Use it for rectangular matrices and for deciding whether a linear system has solutions.
  • The inverse is a whole matrix and exists only when the determinant is non-zero. Use it when you actually need to undo the transformation — but to solve Ax = b, row-reducing [A | b] is faster and more accurate.

For a square matrix the three line up exactly: non-zero determinant ⟺ full rank ⟺ an inverse exists.

Frequently asked questions

Is this calculator free?
Yes, with no account and no limit on how many calculations you run. It is funded by advertising.
Do my matrices get uploaded anywhere?
No. Every calculation runs in your browser in JavaScript; the numbers never leave your device. Closing the tab discards them.
Why are the steps shown as fractions instead of decimals?
The step-by-step engine uses exact rational arithmetic, so 3/5 stays 3/5 instead of drifting to 0.6000000001. You can switch the panel to decimals whenever you prefer.
What is the largest matrix supported?
50×50 for results. Step-by-step solutions stop at 8×8, above which the working would run to hundreds of matrices and teach nothing.
Why is there no step-by-step for eigenvalues?
They are computed with iterative numeric algorithms — Jacobi and QR. Their intermediate values are rounding artefacts, not reasoning you could reproduce by hand.
Can I share a calculation with someone?
Yes. Press “Copy link” next to the result and the URL will carry your matrices with it.

Learn the methods

Each of the six pages below carries the full explanation of its operation — what the result means, how to reproduce it by hand, which method to choose, and the mistakes that cost marks: determinants, the inverse matrix, Gaussian elimination and rank, multiplication, transpose and powers, eigenvalues and eigenvectors and LU and Cholesky decomposition.