ToolJutsu
All tools
Math & Education Tools

Matrix Calculator

Add, multiply, and invert matrices.

Matrix A2×2
Matrix B2×2
Result: A × B
1051015
Processed on your device. We never see your files.

How to use Matrix Calculator

What this tool does

The matrix calculator lets you build two matrices, resize them up to 6×6, edit every cell, and apply the standard operations of linear algebra: addition, subtraction, multiplication, transpose, determinant, inverse and scalar multiplication. It loads with two sample 2×2 matrices and their product already shown, so the workflow is clear from the first glance. Results appear as a clean grid, and errors — a dimension mismatch or a singular matrix — are explained in plain language instead of producing nonsense.

All the arithmetic is hand-written. The inverse uses Gauss-Jordan elimination, the determinant uses row reduction with partial pivoting, and the rest are direct implementations of the textbook definitions. There is no external library, and nothing leaves your device.

When you would use it

Students taking a first linear algebra course use it to check homework: work a determinant or an inverse by hand, then confirm the answer here. Because the tool refuses impossible operations and says why, it also teaches the rules — attempt to multiply two matrices whose dimensions do not line up and the message states exactly which numbers must match.

Beyond coursework, matrices show up wherever several quantities transform together: solving systems of linear equations, rotating and scaling coordinates in graphics, stepping a model forward in economics or engineering. Whenever you need a quick, reliable matrix result without opening a full mathematics package, this calculator gives it to you.

How to use it

  1. Set the size of Matrix A and Matrix B with the Rows and Columns menus — anything from 1×1 up to 6×6. Existing values are kept when you resize.
  2. Click any cell to type a number into it.
  3. Choose an Operation from the menu. Operations that act on a single matrix are labelled “of A” or “of B”; scalar multiply reveals a box for the scalar.
  4. Press Calculate.
  5. Read the result grid, or the single value for a determinant. Use Copy result to copy it as tab-separated text you can paste into a spreadsheet.

How to read the result

The result panel shows a label such as A × B, Aᵀ or det(A) so you always know what was computed. Matrix results are drawn as a grid; a determinant is shown as one number. If the operation is not valid — adding matrices of different sizes, multiplying with mismatched inner dimensions, inverting a non-square or singular matrix — a red message explains the problem and no result is produced. Results are rounded to clear away floating-point noise, so an inverse of an integer matrix displays as tidy numbers.

For numeric work on plain numbers rather than matrices, the equation solver handles linear and quadratic equations, and the graph plotter draws functions on a coordinate grid. To work a linear equation step by step, see the algebra step-by-step tool.

Privacy

The matrix calculator runs entirely in your browser. Every cell value and every operation is processed locally in JavaScript — there is no upload, no logging and no storage between sessions. Refreshing the page returns the sample matrices. Since no server is involved, the calculator continues to work offline once the page has loaded.

Frequently asked questions

Why does matrix multiplication give a dimension error?
Matrix multiplication only works when the number of columns in the first matrix matches the number of rows in the second. To compute A × B, if A is m×n then B must be n×p, and the result is m×p. If the inner dimensions do not match, the product is simply undefined — there is no way to pair up the rows and columns — so the tool reports the mismatch instead of guessing. Addition and subtraction are stricter still: both matrices must be exactly the same size.
What does it mean when a matrix is singular?
A square matrix is singular when its determinant is zero. A singular matrix has no inverse, the same way the number zero has no reciprocal. Geometrically it collapses space onto a lower dimension, so the transformation cannot be undone. When you ask for the inverse of a singular matrix the tool detects the zero determinant and tells you, rather than returning meaningless numbers. Only square matrices have a determinant or an inverse at all.
How does the tool compute the inverse and determinant?
The inverse is found by Gauss-Jordan elimination: the matrix is augmented with the identity matrix and row operations reduce the left side to the identity, leaving the inverse on the right. The determinant uses row reduction with partial pivoting, multiplying the pivots and tracking sign changes from row swaps. Both methods are numerically stable for the small matrices this tool handles, and both are hand-written — no external linear-algebra library is used.
Why are some result entries tiny numbers like 0.0000000001 instead of zero?
Computers store decimals in binary floating point, which cannot represent every fraction exactly. After a chain of additions and divisions a value that should be exactly zero can come out as a minuscule number instead. The tool rounds results to remove this noise and treats anything smaller than about 1e-10 as zero, so inverses and determinants of clean integer matrices display cleanly. Genuinely small but real values are still shown.
Are the matrices I enter uploaded anywhere?
No. Every entry you type and every operation — multiplication, inversion, determinants and the rest — is computed by JavaScript running in your browser. Nothing is sent to a server, nothing is logged, and nothing is stored between visits. Refreshing the page restores the sample matrices. The calculator works offline once loaded, which confirms there is no server involved.

Related tools