Matrix Calculator

Add, subtract, or multiply two square matrices (2x2 or 3x3).

This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.

Can't find what you need?

Request a Tool

How to Use the Matrix Calculator

Select a matrix size and operation, fill in both matrices, and the result appears instantly.

  1. Choose matrix size. Select 2x2 or 3x3. Both matrices must be the same size.
  2. Choose an operation. Addition, subtraction, or multiplication.
  3. Fill in the matrices. Enter values for each cell in Matrix A and Matrix B. The grids auto-generate based on your size selection.
  4. Read the result. The resulting matrix is displayed in a grid below. The operation label and context confirm what was calculated.

About Matrix Operations

Matrices are rectangular arrays of numbers used throughout linear algebra, physics, computer graphics, and data science. Addition and subtraction work element-by-element: each cell in the result is the sum (or difference) of the corresponding cells in A and B.

Matrix multiplication is different. Each cell in the result is the dot product of a row from A and a column from B. For two NxN matrices, this requires N multiplications and N-1 additions per cell. Matrix multiplication is not commutative: A x B does not necessarily equal B x A.

Frequently Asked Questions

How does matrix multiplication work?

Each element in the result is the dot product of a row from matrix A and a column from matrix B. For a 2x2 matrix, C[0][0] = A[0][0]*B[0][0] + A[0][1]*B[1][0].

Is matrix multiplication commutative?

No. In general, A x B does not equal B x A. The order of multiplication matters in matrix algebra, unlike scalar multiplication.

What is the identity matrix?

The identity matrix has 1s on the diagonal and 0s everywhere else. Multiplying any matrix by the identity matrix returns the original matrix. It is the matrix equivalent of multiplying by 1.