MODULE 12

Matrix Calculator: Multiply, Invert & Find Determinants

Enter a matrix as rows separated by ;, entries by , — e.g. 1,2;3,4.

What is Matrix?

A matrix is a rectangular grid of numbers representing linear transformations, systems of equations, or structured data. This calculator handles the core operations: addition, multiplication, determinant, and inverse.

How Does This Calculator Work?

Enter your matrix values row by row, choose an operation (add, multiply, transpose, determinant, inverse), and the calculator shows every entry-by-entry computation, not just the resulting matrix.

Common Formulas & Rules

  • Matrix addition: add corresponding entries; requires matrices of the same dimensions.
  • Matrix multiplication: the entry in row i, column j of A×B is the dot product of row i of A and column j of B.
  • Determinant: a single number summarizing a square matrix, non-zero exactly when the matrix is invertible.
  • Inverse (A⁻¹): the matrix such that A × A⁻¹ = the identity matrix, used to "undo" a transformation.
  • Transpose (Aᵀ): flips a matrix over its diagonal, swapping rows and columns.

Worked Example

Multiplying a 2×2 matrix [[1,2],[3,4]] by [[5,6],[7,8]] gives [[1×5+2×7, 1×6+2×8], [3×5+4×7, 3×6+4×8]] = [[19,22],[43,50]] — each output entry is the dot product of a row from the first matrix and a column from the second.

Study guide: Matrices

Written for students learning this topic for the first time. Last updated October 2026.

Overview

A matrix is a rectangular array of numbers. In discrete mathematics matrices record relations and graphs (0–1 and adjacency matrices), represent transformations, and encode systems of linear equations.

The key operations are addition, multiplication, transpose, determinant and inverse. Multiplication is the one that behaves differently from ordinary arithmetic, and it is where most mistakes occur.

Key ideas explained

Dimensions and addition

An m × n matrix has m rows and n columns. Addition and subtraction need identical dimensions and work entry by entry; scalar multiplication scales every entry.

Matrix multiplication

An m × n matrix times an n × p matrix is m × p, with (AB)ᵢⱼ = Σₖ aᵢₖ·bₖⱼ. The inner dimensions must match. Multiplication is associative but generally not commutative.

Special matrices and the transpose

The identity I satisfies AI = IA = A. A matrix is symmetric when A = Aᵀ. The transpose reverses products: (AB)ᵀ = BᵀAᵀ.

Determinant, inverse and walks in graphs

For a 2 × 2 matrix the determinant is ad − bc, and the inverse exists exactly when it is non-zero. Entry (i, j) of Aᵏ, for an adjacency matrix A, counts the walks of length k from vertex i to vertex j.

Worked examples

Multiplication order, determinant and inverse

Problem. A = [[1, 2], [3, 4]] and B = [[0, 1], [1, 0]]. Find AB, BA, det A and A⁻¹.

  1. AB = [[1·0 + 2·1, 1·1 + 2·0], [3·0 + 4·1, 3·1 + 4·0]] = [[2, 1], [4, 3]].
  2. BA = [[3, 4], [1, 2]], which differs from AB.
  3. det A = 1·4 − 2·3 = −2.
  4. A⁻¹ = (1/−2)·[[4, −2], [−3, 1]] = [[−2, 1], [1.5, −0.5]].

Answer. AB ≠ BA, det A = −2, and A⁻¹ = [[−2, 1], [1.5, −0.5]].

Counting walks with a power of the adjacency matrix

Problem. Path graph A–B–C has adjacency matrix M = [[0,1,0],[1,0,1],[0,1,0]]. Interpret M².

  1. M² = [[1,0,1],[0,2,0],[1,0,1]].
  2. Entry (A, C) = 1: the only length-2 walk from A to C is A–B–C.
  3. Entry (B, B) = 2: B–A–B and B–C–B.

Answer. M² counts length-2 walks between every pair of vertices.

Enter these same values in the calculator above and compare each step with the working shown here.

Common mistakes to avoid

  • Assuming AB = BA.
  • Multiplying matrices whose inner dimensions do not match.
  • Multiplying entry by entry instead of row by column.
  • Trying to invert a matrix with determinant 0.
  • Writing (AB)⁻¹ = A⁻¹B⁻¹. The correct order is B⁻¹A⁻¹.

Where this shows up in computer science

  • Boolean matrix powers compute transitive closure and reachability.
  • Computer graphics uses matrices for rotation and scaling, and machine learning stores weights as matrices.
  • Markov chains describe state changes with transition matrices.

Test yourself

Try each question before opening the answer.

Can a 2 × 3 matrix be multiplied by another 2 × 3 matrix?

No. The inner dimensions (3 and 2) do not match.

What does det A = 0 tell you?

A is singular: it has no inverse, and its rows are linearly dependent.

What is the transpose of [[1, 2], [3, 4]]?

[[1, 3], [2, 4]].

Frequently asked questions

Can you multiply any two matrices together?

No. Matrix multiplication A × B requires the number of columns in A to equal the number of rows in B. The result has A's row count and B's column count.

What does it mean if a matrix's determinant is zero?

A zero determinant means the matrix is singular — it has no inverse, and the linear system it represents either has no solution or infinitely many.

What's the difference between a matrix and its transpose?

The transpose flips a matrix over its main diagonal, turning rows into columns and columns into rows. A matrix that equals its own transpose is called symmetric.