Math

Matrix Calculator

Add, subtract, multiply matrices. Calculate determinant, transpose, and inverse for square matrices.

Quick Answer

Matrix addition/subtraction requires same dimensions. Multiplication of A(m×n) × B(n×p) gives C(m×p). Determinant and inverse only work on square matrices. A matrix with determinant 0 is "singular" and has no inverse.

Matrix A
2x2
+
Matrix B
2x2

Result

6
8
10
12

About This Tool

Matrices are fundamental mathematical objects used throughout science, engineering, computer graphics, machine learning, and statistics. This calculator handles the most common matrix operations for matrices up to 5x5, providing instant results for addition, subtraction, multiplication, transposition, determinants, and inverses.

Matrix Operations Explained

Addition and subtraction are element-wise operations requiring matrices of the same dimensions. Multiplication is more complex: to multiply A(m×n) by B(n×p), A's column count must equal B's row count, and the result has dimensions m×p. Each element of the result is the dot product of the corresponding row from A and column from B. Matrix multiplication is not commutative: A×B generally does not equal B×A.

Determinants and Invertibility

The determinant is a scalar value computed from a square matrix that encodes important geometric and algebraic properties. A non-zero determinant means the matrix is invertible (has an inverse). The inverse of a matrix A is the matrix A' such that A×A' = I (the identity matrix). Inverse matrices are crucial for solving systems of linear equations, computing transformations in computer graphics, and many machine learning algorithms.

Applications in the Real World

Computer graphics use 4×4 transformation matrices for rotation, scaling, and translation of 3D objects. Machine learning relies on matrix multiplication for neural network computations. Google's original PageRank algorithm used matrix operations on the web link graph. Quantum mechanics describes physical systems using matrix operators. Economics uses input-output matrices to model industry relationships.

Frequently Asked Questions

When can I multiply two matrices?
You can multiply matrix A (m x n) by matrix B only if B has n rows (n x p). The result will be an m x p matrix. For example, a 3x2 matrix can multiply a 2x4 matrix, giving a 3x4 result. The inner dimensions must match.
What does it mean if a matrix has determinant 0?
A determinant of 0 means the matrix is 'singular' or 'degenerate.' It has no inverse, its rows/columns are linearly dependent (one row is a combination of others), and the system of equations it represents has either no solution or infinitely many solutions.
Is matrix multiplication commutative?
No. In general, A x B does not equal B x A. This is one of the key differences from regular number multiplication. The order of matrix multiplication matters and can produce completely different results or may not even be possible if dimensions don't match both ways.
What is the identity matrix?
The identity matrix I is a square matrix with 1s on the main diagonal and 0s everywhere else. It is the matrix equivalent of the number 1: multiplying any matrix by the identity matrix returns the same matrix (A x I = A). For a 2x2 identity matrix: [[1,0],[0,1]].
What are eigenvalues and eigenvectors?
Eigenvalues are scalar values that, when multiplied by certain vectors (eigenvectors), produce the same result as multiplying the matrix by those vectors. They reveal important properties of a matrix: eigenvalues of a rotation matrix tell you the rotation angle, and eigenvalues in principal component analysis identify the most important data dimensions.

Was this tool helpful?