Matrix Calculator

Calculate the determinant, transpose, and inverse of any 2×2 or 3×3 matrix. Shows step-by-step working for each operation.

m/s²

Enter your values above to see the results.

Tips & Notes

  • Matrix multiplication: A×B ≠ B×A in general. Order matters — always check dimensions.
  • Dimensions check: (m×n) × (n×p) = (m×p). Inner dimensions must match.
  • det=0 means the matrix is singular — no inverse exists and the system has no unique solution.
  • Identity matrix I: A×I = I×A = A. Like multiplying by 1 in regular arithmetic.
  • Transpose: swap rows and columns. (Aᵀ)ᵀ = A. (AB)ᵀ = BᵀAᵀ (order reverses).

Common Mistakes

  • Multiplying matrices with incompatible dimensions. A(3×2) × B(3×2) is impossible — inner dims must match.
  • Assuming A×B = B×A. Matrix multiplication is generally NOT commutative.
  • Adding matrices of different dimensions — only same-size matrices can be added.
  • Forgetting to divide by the determinant when computing inverse: (1/det) multiplies the adjugate.
  • Row × column order in multiplication: element (i,j) = dot product of row i of A with column j of B.

Matrix Calculator Overview

A matrix is a rectangular array of numbers organized into rows and columns. Matrices are the language of linear transformations — every rotation, reflection, scaling, and projection in geometry is a matrix operation. In data science, a dataset of m observations with n features is an m×n matrix. Neural networks perform layer computations entirely through matrix multiplication. Google's original PageRank algorithm was a matrix eigenvalue problem. Any system of linear equations can be written as a single matrix equation Ax = b.

Matrix addition and subtraction — add corresponding elements (matrices must have identical dimensions):

EX: [[1,2],[3,4]] + [[5,6],[7,8]] = [[1+5, 2+6],[3+7, 4+8]] = [[6,8],[10,12]]
Matrix multiplication — row of first matrix dotted with column of second matrix:
EX: [[2,1],[3,4]] × [[5,6],[7,8]] → (2×5+1×7)=17, (2×6+1×8)=20, (3×5+4×7)=43, (3×6+4×8)=50 → [[17,20],[43,50]]
Matrix multiplication requires inner dimensions to match: (m×n) × (n×p) = (m×p). Unlike scalar multiplication, AB ≠ BA in general — order always matters. Determinant of a 2×2 matrix — a scalar value encoding area scaling and invertibility:
det[[a,b],[c,d]] = ad − bc
EX: det[[3,2],[1,4]] = 3×4 − 2×1 = 12 − 2 = 10 (nonzero → matrix is invertible)
Matrix inverse — only exists when det ≠ 0:
[[a,b],[c,d]]⁻¹ = (1/det) × [[d,−b],[−c,a]]
EX: [[3,2],[1,4]]⁻¹ = (1/10) × [[4,−2],[−1,3]] = [[0.4,−0.2],[−0.1,0.3]] | verify: original × inverse = identity [[1,0],[0,1]] ✓
Solving systems of equations with matrices: write Ax=b, then x = A⁻¹b. For the system 3x+2y=8 and x+4y=6: form the matrix equation, invert A, multiply by b. Transpose — swap rows and columns: element (i,j) moves to (j,i). The transpose of an m×n matrix is n×m. A symmetric matrix satisfies Aᵀ = A (common in statistics: covariance matrices are always symmetric). Real-world applications: 3D computer graphics use 4×4 transformation matrices to rotate, scale, and translate every object in a scene. Each frame rendered by a game engine performs millions of matrix multiplications. Principal Component Analysis in data science finds the eigenvectors of a covariance matrix to reduce dimensionality while preserving variance. The power of matrix notation lies in encoding entire systems of relationships into a single object. A 4×4 transformation matrix in 3D graphics simultaneously encodes rotation, scaling, and translation — allowing a rendering engine to move an object with a single multiplication rather than three separate operations.

Frequently Asked Questions

Matrix addition and subtraction operate elementwise on matrices of identical dimensions. [[1,2],[3,4]] + [[5,6],[7,8]] = [[6,8],[10,12]]. Scalar multiplication multiplies every element by the scalar: 3×[[1,2],[3,4]] = [[3,6],[9,12]]. These operations are commutative for addition (A+B=B+A) and associative. Subtraction: A−B means add A and the negation of B, where −B flips the sign of every element. Attempting to add matrices of different sizes is undefined.

Matrix multiplication computes dot products of rows and columns. For A (m×n) and B (n×p), result C is m×p where C[i][j] = A[i][0]×B[0][j] + A[i][1]×B[1][j] + ... + A[i][n-1]×B[n-1][j]. Example: [[1,2],[3,4]] × [[5,6],[7,8]]. C[0][0]=1×5+2×7=5+14=19. C[0][1]=1×6+2×8=6+16=22. C[1][0]=3×5+4×7=15+28=43. C[1][1]=3×6+4×8=18+32=50. Result: [[19,22],[43,50]]. The inner dimensions must match: m×n can only multiply n×p. Trying to multiply a 2×3 matrix by a 2×3 matrix is undefined — the inner dimensions (3 and 2) do not match.

Matrix multiplication is NOT commutative: AB ≠ BA in general, even when both products are defined. If A=[[1,2],[0,1]] and B=[[1,0],[1,1]], then AB=[[3,2],[1,1]] but BA=[[1,2],[1,3]] — completely different. Furthermore, AB=0 does not imply A=0 or B=0. However, matrix multiplication IS associative: A(BC)=(AB)C always. When manipulating matrix equations, maintain the order of multiplication carefully — you cannot freely rearrange factors as you would with numbers.

Determinant of 2×2 [[a,b],[c,d]] = ad−bc. For [[3,2],[1,4]]: det = 12−2 = 10. The determinant measures the scaling factor of the linear transformation represented by the matrix and determines invertibility: det=0 means the matrix is singular and has no inverse. For 3×3 matrices, expand along any row using cofactors. Key property: det(AB) = det(A)×det(B). det(A⁻¹) = 1/det(A). det(Aᵀ) = det(A) where Aᵀ is the transpose.

For a 2×2 invertible matrix A=[[a,b],[c,d]] with det(A)≠0: A⁻¹ = (1/det(A)) × [[d,−b],[−c,a]]. The rows and columns of the adjugate swap the main diagonal and negate the off-diagonal. Example: A=[[3,2],[1,4]], det=3×4−2×1=10. Adjugate=[[4,−2],[−1,3]]. A⁻¹=(1/10)×[[4,−2],[−1,3]]=[[0.4,−0.2],[−0.1,0.3]]. Verify by computing A×A⁻¹: [[3×0.4+2×(−0.1), 3×(−0.2)+2×0.3],[1×0.4+4×(−0.1), 1×(−0.2)+4×0.3]]=[[1.0,0.0],[0.0,1.0]]=Identity ✓. For 3×3 matrices, use cofactor expansion and divide every element of the adjugate matrix by det(A).

Matrix rank is the number of linearly independent rows (equal to the number of linearly independent columns). For an n×n matrix, rank=n means full rank and invertible. Rank<n means singular and non-invertible. Rank determines solution structure for Ax=b: unique solution when rank(A)=rank([A|b])=n; infinitely many solutions when rank(A)=rank([A|b])<n; no solution when rank(A)<rank([A|b]). Find rank by row-reducing to echelon form and counting non-zero rows. Applications: dimensionality reduction, principal component analysis, and linear independence testing.