🔲

Matrix Calculator

Add, subtract, multiply matrices and find determinant and transpose for 2×2 and 3×3 matrices.

Matrix A
Matrix B

Results

Matrix Operations

A matrix is a rectangular array of numbers arranged in rows and columns. Matrix operations are fundamental to linear algebra and appear in computer graphics, machine learning, physics, and engineering. This matrix calculator handles the most common operations for 2×2 and 3×3 matrices.

Matrix Addition and Subtraction

Matrices of the same size can be added or subtracted element-wise: (A+B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ. Both matrices must have the same number of rows and columns. This is analogous to adding two arrays of the same shape.

Matrix Multiplication

The product (AB)ᵢⱼ = Σₖ AᵢₖBₖⱼ — each result element is the dot product of the corresponding row from A and column from B. Matrix multiplication is NOT commutative (AB ≠ BA in general). For A (m×n) × B (n×p): the inner dimensions must match, and the result is m×p.

Determinant

For a 2×2 matrix [[a,b],[c,d]]: det = ad−bc. For 3×3, expand along the first row using cofactors. The determinant tells you: if det=0, the matrix is singular (non-invertible); |det| is the area (2D) or volume (3D) scaling factor of the linear transformation.

Transpose

The transpose Aᵀ flips rows and columns: (Aᵀ)ᵢⱼ = Aⱼᵢ. A symmetric matrix satisfies A = Aᵀ. Transposes appear in least-squares regression (AᵀA), orthogonal matrices, and covariance matrices.

Worked Example: 2×2 Matrix Multiplication

Multiply A = [[2, 1], [3, 4]] by B = [[5, 0], [2, 3]].

Result[0][0] = (2×5) + (1×2) = 10 + 2 = 12.

Result[0][1] = (2×0) + (1×3) = 0 + 3 = 3.

Result[1][0] = (3×5) + (4×2) = 15 + 8 = 23.

Result[1][1] = (3×0) + (4×3) = 0 + 12 = 12.

So A × B = [[12, 3], [23, 12]]. Note: B × A gives a different result, confirming that matrix multiplication is not commutative.

Frequently Asked Questions

[[a,b],[c,d]] × [[e,f],[g,h]] = [[ae+bg, af+bh],[ce+dg, cf+dh]]. Each element of the result is a dot product of a row from A with a column from B.

det([[a,b],[c,d]]) = ad − bc. For [[3,1],[2,4]]: det = 3×4 − 1×2 = 12 − 2 = 10.

Aᵀ swaps rows and columns. [[1,2,3],[4,5,6]] transposed = [[1,4],[2,5],[3,6]]. Each element [i][j] moves to [j][i].

A (m×n) × B (n×p) — the inner dimensions must match (n=n). The result is m×p. Two 2×2 matrices can always be multiplied; a 2×3 matrix can multiply a 3×4 matrix (result: 2×4).

det=0 means the matrix is singular: non-invertible. The rows/columns are linearly dependent. The transformation collapses space — a 2D matrix with det=0 maps all points to a line.

The identity matrix I has 1s on the main diagonal and 0s elsewhere: for 2×2 it is [[1,0],[0,1]]. Multiplying any matrix A by the identity gives A unchanged: A × I = I × A = A. It is the matrix equivalent of multiplying by 1.

For A = [[a,b],[c,d]] with det = ad−bc ≠ 0: A⁻¹ = (1/det) × [[d,−b],[−c,a]]. For [[2,1],[5,3]]: det = 6−5 = 1. Inverse = [[3,−1],[−5,2]]. Verify: [[2,1],[5,3]] × [[3,−1],[−5,2]] = [[1,0],[0,1]] ✓.

Formula sources & accuracy standards: Calculator Methodology · Editorial Policy