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

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 operation has a guide explaining the mathematics behind it: determinants, the inverse matrix, Gaussian elimination, rank, matrix multiplication and LU decomposition.