MT Math Tools

Matrix Calculator

Add, subtract, multiply, transpose, invert and find the determinant of matrices with mathjs.

🔒 Runs entirely in your browser — nothing is uploaded

Result

Press compute

Matrix algebra runs locally with mathjs.

Advertisement

Working with matrices in the browser

A matrix is a rectangular grid of numbers, and matrix algebra is the backbone of linear systems, computer graphics, statistics and machine learning. This calculator accepts two matrices, A and B, typed as rows on separate lines with the entries separated by commas or spaces. It then applies the operation you select using the mathjs linear-algebra engine, so the results are consistent with standard mathematical definitions. Binary operations combine A and B, while unary operations such as transpose, determinant and inverse use matrix A only.

Addition and subtraction work entry by entry and require both matrices to have the same number of rows and columns. Multiplication follows the row-by-column rule, so the number of columns in A must equal the number of rows in B, and the result has A's rows and B's columns. The transpose flips a matrix across its diagonal, turning rows into columns. These operations are defined for any compatible shapes, and the calculator reports a clear error when the dimensions do not line up.

Determinant and inverse

The determinant is a single number defined only for square matrices. It measures how the matrix scales area or volume and tells you whether the matrix is invertible: a determinant of zero means the rows are linearly dependent and no inverse exists. The inverse of a square matrix A is the matrix that multiplies with A to give the identity. The calculator computes it with mathjs and will warn you if the matrix is singular. Inverses are central to solving systems of equations, where they let you isolate the unknown vector directly.

Tips and privacy

Keep your rows the same length so each matrix is rectangular, and use a minus sign for negative entries. Results are shown with sensible rounding, but inverses of nearly singular matrices can accumulate floating-point error, so treat tiny non-zero entries with care. Everything happens in your browser; the numbers you type are never uploaded, stored or sent to any external service, so you can experiment freely with sensitive data.

How to use

  1. Enter matrix A and BType rows on separate lines and separate numbers with commas or spaces.
  2. Pick an operationChoose add, subtract, multiply, transpose, determinant or inverse.
  3. Read the resultBinary operations use both matrices; unary operations use matrix A only.

Frequently asked questions

What size matrices are supported?
Any rectangular matrix, as long as the dimensions are valid for the chosen operation.
When can I add or multiply?
Addition and subtraction need matching dimensions. Multiplication needs A's columns to equal B's rows.
When is an inverse or determinant available?
Only for square matrices. A determinant of zero means the matrix has no inverse.
Is my data uploaded?
No. Matrices are parsed and computed entirely in your browser with mathjs.
Advertisement