Matrix Calculator

Multiply, add, transpose, and find determinants of matrices.

A×
B×

What It Does

Enter values into two matrices and choose an operation. The calculator handles addition, subtraction, scalar multiplication, matrix multiplication, transpose, and determinant — instantly showing the result with step-visible formatting. Supports matrices from 1×1 up to 4×4.

Operation Rules at a Glance

  • Add / Subtract — Both matrices must have the same dimensions (m×n).
  • Multiply (A × B) — Columns of A must equal rows of B. Result is m×p where A is m×n and B is n×p.
  • Scalar multiply — Multiplies every element by a constant. Any size matrix works.
  • Transpose — Turns an m×n matrix into an n×m matrix by swapping rows and columns.
  • Determinant — Only defined for square matrices (2×2, 3×3, 4×4).

2×2 Determinant Formula

For a 2×2 matrix [[a, b], [c, d]], the determinant is ad - bc. A result of 0 means the matrix has no inverse and its rows (or columns) are linearly dependent.

Common Mistakes

  • Matrix multiplication is not commutative — A × B usually differs from B × A.
  • You cannot add matrices of different sizes; check dimensions before adding.
  • The identity matrix I (1s on the diagonal, 0s elsewhere) is the matrix equivalent of 1 — A × I = A.

Frequently Asked Questions

What matrix operations does this calculator support?
The calculator supports addition, subtraction, scalar multiplication, matrix multiplication, transposition, and determinant calculation for matrices up to 4x4 in size. These cover the most common operations needed in linear algebra courses and practical engineering work.
When can two matrices be multiplied together?
Matrix multiplication A × B is only defined when the number of columns in A equals the number of rows in B. The result has the same number of rows as A and the same number of columns as B. For example, a 2×3 matrix multiplied by a 3×4 matrix produces a 2×4 result.
What does the determinant of a matrix tell you?
The determinant is a scalar value that describes certain properties of a square matrix. A non-zero determinant means the matrix is invertible (non-singular). In geometry it represents the scale factor of the linear transformation — a determinant of zero means the transformation collapses space into a lower dimension.
What is the difference between a matrix transpose and an inverse?
Transposing a matrix flips it along its main diagonal — rows become columns. The inverse A⁻¹ is the matrix such that A × A⁻¹ = I (the identity matrix). Every matrix has a transpose, but only square matrices with a non-zero determinant have an inverse.
Where are matrix operations used in software development?
Matrices are fundamental in computer graphics (transformations, projections), machine learning (weight tensors, backpropagation), game physics (collision detection), image processing (convolution kernels), and computer vision (homography, camera calibration).