⊞ Matrix Calculator (2×2 and 3×3)

Matrix A

Matrix B

Result

Matrix Operations Guide

A matrix is a rectangular array of numbers arranged in rows and columns. Matrix operations are fundamental in linear algebra, computer graphics, engineering, and machine learning.

Basic Matrix Operations

  • Addition/Subtraction: Add or subtract corresponding elements. Matrices must be same size.
  • Multiplication: For A(m×n) × B(n×p), the inner dimensions must match. Result is m×p.
  • Transpose (Aᵀ): Flip rows and columns — rows become columns.
  • Determinant: A scalar value that describes certain properties of the matrix.
det([[a,b],[c,d]]) = ad − bc

Matrix Operation Rules

Matrices are rectangular arrays of numbers used in linear algebra. They are fundamental tools in science, engineering, computer graphics, and machine learning.

OperationRequirementResult Size
Addition (A + B)A and B same sizeSame as A and B
Subtraction (A − B)A and B same sizeSame as A and B
Multiplication (A × B)Columns of A = Rows of BRows of A × Cols of B
Transpose (Aᵀ)Any matrixRows/cols swapped
Determinant det(A)Square matrix onlyScalar value

2×2 Matrix Formulas

For A = [[a,b],[c,d]]:
det(A) = ad − bc
Inverse A⁻¹ = (1/det) × [[d,−b],[−c,a]] (if det ≠ 0)
Transpose Aᵀ = [[a,c],[b,d]]

Worked Example — 2×2 Multiplication

A = [[1,2],[3,4]], B = [[5,6],[7,8]]
A×B = [[1×5+2×7, 1×6+2×8],[3×5+4×7, 3×6+4×8]]
= [[5+14, 6+16],[15+28, 18+32]]
= [[19, 22],[43, 50]]

Why Matrices Matter

  • 3D graphics: Every rotation, scaling, and translation in video games and 3D software uses matrix multiplication
  • Machine learning: Neural networks perform matrix multiplications billions of times per second during training
  • Physics: Solving systems of linear equations, quantum mechanics (state matrices)
  • Economics: Input-output models of national economies use large matrices
  • Computer vision: Image transformations, convolution operations in CNNs

Frequently Asked Questions

When can you multiply two matrices?
Matrix multiplication A×B is only possible when the number of columns in A equals the number of rows in B. A(m×n) × B(n×p) = C(m×p).
What is a matrix determinant used for?
The determinant tells you if a matrix is invertible (non-zero = invertible), and is used in solving systems of linear equations, finding eigenvalues, and computing cross products.
What does matrix transpose mean?
Transposing a matrix flips it over its main diagonal — rows become columns and columns become rows. If A is 2×3, Aᵀ is 3×2.