Sign up
▦

Matrix Calculator

Determinant, transpose, addition, multiplication, and inverse (2×2 to 4×4).

Matrix Inputs

Enter the 2×2 matrices below.

Matrix A
Result — determinant
Calculate determinant, transpose, addition, and multiplication.

About this topic

Determinant (det A) A scalar that measures the 'scale factor' of a matrix.

The determinant tells you how a matrix scales area (2D) or volume (3D). A zero determinant means the matrix collapses space and is not invertible.

Key formulas & rules

  • •2×2: det = ad − bc
  • •3×3: Sarrus rule or cofactor expansion
  • •det(A) = 0 → matrix is singular (no inverse)
  • •det(A) ≠ 0 → matrix is invertible
  • •det(AB) = det(A)·det(B)
  • •det(Aᵀ) = det(A)

Examples

Input Output Note
[[1,2],[3,4]] −2 1×4 − 2×3
[[2,0],[0,2]] 4 Scales area by 4
[[1,2],[2,4]] 0 Rows dependent
I₃ (identity) 1 det(I) = 1

Real-world uses

Solving linear systems Checking invertibility Area/volume scaling
Transpose (Aᵀ) Swap rows with columns — flip across the diagonal.

The transpose mirrors a matrix across its main diagonal. Element at (i, j) moves to (j, i).

Key formulas & rules

  • •(Aᵀ)ᵀ = A
  • •(A + B)ᵀ = Aᵀ + Bᵀ
  • •(AB)ᵀ = BᵀAᵀ (order flips!)
  • •det(Aᵀ) = det(A)
  • •Symmetric matrix: A = Aᵀ
  • •Diagonal matrix: Aᵀ = A

Examples

Input Output Note
[[1,2],[3,4]]ᵀ [[1,3],[2,4]] Diagonal stays
[[1,2,3]]ᵀ [[1],[2],[3]] Row → column
Iᵀ I Identity unchanged
A = Aᵀ Symmetric Mirror equal

Real-world uses

Linear regression (XᵀX) Neural networks (backprop) Quantum operators
Addition & Subtraction Add or subtract matching entries of same-size matrices.

Matrix addition is element-wise. Both matrices must have the same dimensions.

Key formulas & rules

  • •(A + B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ
  • •Commutative: A + B = B + A
  • •Associative: (A+B)+C = A+(B+C)
  • •Requires A and B to have same size
  • •Zero matrix O is the additive identity
  • •A − A = O

Examples

Input Output Note
[[1,2],[3,4]] + [[5,6],[7,8]] [[6,8],[10,12]] Element-wise
[[1,2],[3,4]] − [[1,2],[3,4]] [[0,0],[0,0]] Zero matrix
A + O A Identity element
Size mismatch Error Different dims

Real-world uses

Adding force vectors Combining image data Solving systems
Matrix Multiplication (AB) Row-by-column dot products — order matters!

Matrix multiplication is not element-wise. Entry (i, j) of AB is the dot product of row i of A and column j of B.

Key formulas & rules

  • •(AB)ᵢⱼ = Σₖ Aᵢₖ · Bₖⱼ
  • •Not commutative: AB ≠ BA generally
  • •Associative: (AB)C = A(BC)
  • •Distributive: A(B+C) = AB + AC
  • •Requires cols(A) = rows(B)
  • •Identity: AI = IA = A

Examples

Input Output Note
[[1,2],[3,4]]·[[5,6],[7,8]] [[19,22],[43,50]] Row × column
AI₂ A Identity works
AB vs BA Different Not commutative
2×3 · 3×2 2×2 Inner dims match

Real-world uses

Graphics transformations Rotation + scaling Neural network layers
Inverse (A⁻¹) The matrix that 'undoes' A when multiplied.

The inverse satisfies A·A⁻¹ = A⁻¹·A = I. Only square matrices with det ≠ 0 have inverses.

Key formulas & rules

  • •A·A⁻¹ = A⁻¹·A = I
  • •Exists only if det(A) ≠ 0
  • •2×2 formula: A⁻¹ = (1/det)·[[d,−b],[−c,a]]
  • •3×3+: Gauss-Jordan or adjugate method
  • •(AB)⁻¹ = B⁻¹·A⁻¹ (order flips!)
  • •(Aᵀ)⁻¹ = (A⁻¹)ᵀ

Examples

Input Output Note
[[1,2],[3,4]]⁻¹ [[−2,1],[1.5,−0.5]] 1/det × adjugate
I⁻¹ I Self-inverse
[[1,1],[1,1]]⁻¹ No inverse det = 0
AB inverse B⁻¹A⁻¹ Order flips

Real-world uses

Solving Ax = b Decrypting transformations Regression coefficients
Trace (tr A) Sum of the diagonal entries — key for eigenvalues.

The trace is a simple scalar that reveals a lot about the matrix. It equals the sum of eigenvalues.

Key formulas & rules

  • •tr(A) = Σ Aᵢᵢ (sum of diagonal)
  • •tr(A + B) = tr(A) + tr(B)
  • •tr(cA) = c·tr(A)
  • •tr(AB) = tr(BA) (cyclic property)
  • •tr(A) = sum of eigenvalues
  • •tr(Iₙ) = n

Examples

Input Output Note
[[1,2],[3,4]] 5 1 + 4
I₃ 3 n for Iₙ
[[1,0],[0,−1]] 0 eigenvalues ±1
tr(AB) tr(BA) Cyclic

Real-world uses

Eigenvalue estimation Quantum mechanics Machine learning diagnostics
Identity Matrix (I) The matrix analogue of '1' — leaves other matrices unchanged.

The identity matrix has 1s on the diagonal and 0s elsewhere. Multiplying by I is like multiplying a number by 1.

Key formulas & rules

  • •Iᵢⱼ = 1 if i = j, else 0
  • •A·I = I·A = A
  • •det(I) = 1
  • •tr(Iₙ) = n
  • •Iᵀ = I
  • •I⁻¹ = I (self-inverse)

Examples

Input Output Note
I₂ [[1,0],[0,1]] 2×2 identity
I₃ 3×3 with 1s 3×3 identity
A·I A No effect
I⁻¹ I Self-inverse

Real-world uses

Basis for matrix algebra Rotation axis preservation Neural net initializations

Modes & formulas

1

Determinant

• Compute the determinant of a square matrix. • For 2×2, use the formula ad − bc. For 3×3 and 4×4, use cofactor expansion. • A zero determinant means the matrix is singular (no inverse).
det([[a,b],[c,d]]) = ad − bc

The determinant measures how the matrix scales area (in 2D) or volume (in 3D). A negative determinant indicates a reflection.

2

Transpose

• Swap rows and columns of a matrix. • Element at (i, j) moves to (j, i). • The transpose is used in solving least-squares problems.
(Aᵀ)ᵢⱼ = Aⱼᵢ

The transpose satisfies (Aᵀ)ᵀ = A, (A + B)ᵀ = Aᵀ + Bᵀ, and (AB)ᵀ = BᵀAᵀ (note the reversal of order).

3

Addition & Subtraction

• Add or subtract two matrices element-wise. • Both matrices must have the same dimensions. • The calculator performs the operation on matching cells.
(A ± B)ᵢⱼ = Aᵢⱼ ± Bᵢⱼ

Matrix addition is commutative and associative. It's equivalent to adding the corresponding linear transformations.

4

Multiplication

• Multiply matrices by taking the dot product of rows of A and columns of B. • Matrix multiplication is not commutative — order matters. • The number of columns of A must equal the number of rows of B.
(AB)ᵢⱼ = Σₖ Aᵢₖ · Bₖⱼ

Matrix multiplication represents the composition of linear transformations. (AB)x means apply B, then apply A.

5

Inverse

• Compute the inverse of a square matrix using Gauss-Jordan elimination. • A matrix is invertible only if det(A) ≠ 0. • A·A⁻¹ = A⁻¹·A = I.
A⁻¹ = (1/det) · adj(A)

The inverse solves systems of the form Ax = b by x = A⁻¹b. The tool rejects singular matrices (det = 0) with a clear error.

6

Trace

• Sum the diagonal entries of a square matrix. • The trace equals the sum of eigenvalues. • Trace is invariant under cyclic permutation: tr(AB) = tr(BA).
tr(A) = Σᵢ Aᵢᵢ

The trace gives quick information about a matrix's spectrum without computing eigenvalues.

7

Identity

• Generate the identity matrix for the chosen size. • The identity matrix has 1s on the main diagonal and 0s everywhere else. • It is the multiplicative identity for matrices.
Iᵢⱼ = 1 if i = j, else 0

Multiplying any matrix by the identity matrix leaves it unchanged: AI = IA = A.

How to use it

Select the matrix size (2×2, 3×3, or 4×4), choose an operation, and edit the matrix cells. The result updates instantly.

Frequently asked questions

What is a singular matrix?
A matrix with determinant 0. It has no inverse and represents a transformation that collapses space.
Is matrix multiplication commutative?
No. In general, AB ≠ BA. The order of multiplication matters for matrices.
What is a matrix?
A rectangular array of numbers arranged in rows and columns, used to represent linear transformations or systems of equations.
What is the determinant?
A scalar value that indicates how the matrix scales area (2D) or volume (3D). A determinant of zero means the matrix is singular.
What is the transpose of a matrix?
A new matrix formed by swapping the rows and columns of the original matrix. The element at (i, j) moves to (j, i).
How do you add matrices?
Add the corresponding entries. Both matrices must have the exact same dimensions.

Related calculators

Read the full Matrix Calculator guide — examples & 18 FAQs