Matrix Calculator

Matrix A

  1. det = (1)(4) − (2)(3) = -2
det(A) = -2

det([[a,b],[c,d]]) = ad − bc

Matrix Operations Explained

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices represent linear transformations, systems of equations, computer graphics rotations, and network adjacency structures. This calculator handles 2×2 and 3×3 matrices for the most common student and engineering operations: addition, subtraction, scalar multiplication, matrix multiplication, transpose, determinant, and inverse.

Matrix addition and subtraction require identical dimensions — add or subtract corresponding entries. Scalar multiplication multiplies every entry by a constant. The transpose Aᵀ flips rows and columns: (Aᵀ)ᵢⱼ = Aⱼᵢ. Matrix multiplication AB is defined only when A's column count equals B's row count. The (i,j) entry of AB is the dot product of row i of A with column j of B — not element-wise multiplication.

The 2×2 determinant det([[a,b],[c,d]]) = ad − bc measures scaled area (or volume in 3D) and determines invertibility. For [[1,2],[3,4]]: det = (1)(4) − (2)(3) = 4 − 6 = −2. A zero determinant means the matrix is singular (no inverse). The 2×2 inverse formula is A⁻¹ = (1/det) × [[d, −b], [−c, a]]. For 3×3 matrices, expansion by cofactors along any row or column computes the determinant recursively.

Matrix multiplication example: [[1,2],[3,4]] × [[5,6],[7,8]]. Row 1 · columns: (1×5+2×7, 1×6+2×8) = (19, 22). Row 2: (3×5+4×7, 3×6+4×8) = (43, 50). Result: [[19,22],[43,50]]. Note AB ≠ BA in general — order matters. Identity matrix I acts like 1: AI = IA = A. Inverse satisfies AA⁻¹ = I when det ≠ 0.

Matrices appear in solving linear systems (Ax = b → x = A⁻¹b when invertible), Markov chains, least squares regression, and 3D graphics pipelines. Pair with the scientific calculator for scalar arithmetic and the statistics calculator when regression matrices arise from data analysis. Determinants connect to eigenvalues in advanced linear algebra.

Enter matrix entries in row-major order, select the operation, and review step-by-step working for determinants and inverses. Common checks: det(I) = 1, det([[0,1],[1,0]]) = −1 (reflection), and singular matrices like [[1,2],[2,4]] (row 2 = 2 × row 1) have det = 0. Use this tool for linear algebra homework verification and quick 2×2 / 3×3 computation without setting up spreadsheet formulas.

Systems of equations perspective: a 2×2 system ax + by = e, cx + dy = f can be written as [[a,b],[c,d]][x,y]ᵀ = [e,f]ᵀ. Cramer's rule and inverse methods both require a nonzero determinant. When det = 0, the system has no unique solution — either no solution (parallel lines) or infinitely many (coincident lines). Matrix multiplication encodes composition of transformations: applying rotation then scaling equals the product of their matrix representations.

For 3×3 determinants, Sarrus' rule works on paper but cofactor expansion generalizes to any size. This calculator uses cofactor expansion with visible steps so you can trace each minor determinant back to 2×2 cases you can verify by hand — building intuition before moving to larger linear systems in engineering and data science coursework.

Examples

ExampleResult
det([[1,2],[3,4]])−2
[[1,2],[3,4]] × [[5,6],[7,8]][[19,22],[43,50]]
det([[2,0],[0,3]])6
Transpose of [[1,2,3],[4,5,6]][[1,4],[2,5],[3,6]]
2 × [[1,3],[2,4]][[2,6],[4,8]]
det([[1,0],[0,1]])1 (identity)
[[1,2],[3,4]] + [[5,6],[7,8]][[6,8],[10,12]]

Frequently asked questions

det = (1)(4) − (2)(3) = 4 − 6 = −2.

When the determinant is zero (singular matrix). Rows or columns are linearly dependent.

No. In general AB ≠ BA. Order of multiplication matters.

Related calculators