Matrix Calculator
Add, subtract, multiply, transpose, and find the determinant of 2×2 and 3×3 matrices.
Try an example
[4, 7] [2, 6]
About this calculator
What Is a Matrix?
A matrix is a rectangular grid of numbers, symbols or expressions arranged in rows and columns. Its size is written m × n, meaning m rows and n columns, and each entry is called an element, identified by its row and column: a₂,₃ is the element in row 2, column 3. Matrices are a core tool in linear algebra and show up in physics, computer graphics, statistics, probability, engineering and machine learning, wherever you need to handle many related numbers at once. This matrix calculator performs the main operations on 2×2 and 3×3 matrices.
Matrix Addition and Subtraction
You can only add or subtract matrices of the same size. The operation is done element by element: (A + B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ. Adding two 2×2 matrices therefore means adding the four pairs of entries in matching positions. Order does not matter for addition (A + B = B + A), but it does for subtraction.
Worked Example
Multiplying A = [[4,7],[2,6]] by the identity matrix returns A unchanged: [[4,7],[2,6]]. The determinant of A is 4×6 − 7×2 = 10.
Matrix Multiplication
To multiply A × B, the number of columns in A must equal the number of rows in B. Each entry of the product is the dot product of a row of A and a column of B: (AB)ᵢⱼ = Σ Aᵢₖ × Bₖⱼ. Unlike ordinary numbers, matrix multiplication is generally not commutative — AB and BA usually differ — but it is associative. Multiplying by a scalar simply scales every entry.
Determinant, Inverse and Transpose
- Transpose (Aᵀ): flip the matrix over its diagonal so rows become columns.
- Determinant: a single number computed from a square matrix. For a 2×2 matrix [[a, b], [c, d]], det = ad − bc. A zero determinant means the matrix is singular — it has no inverse.
- Inverse (A⁻¹): the matrix for which A × A⁻¹ = I, the identity matrix. For a 2×2, A⁻¹ = (1 ÷ det) × [[d, −b], [−c, a]]. It exists only when the determinant is not zero, and it is how you solve systems of linear equations.
Where Matrices Are Used
- Computer graphics and games: rotations, scaling and reflections of shapes are all matrix operations.
- Systems of equations: writing Ax = b gives a compact way to solve many equations at once.
- Statistics and machine learning: a spreadsheet of data is mathematically a matrix.
- Engineering and physics: circuits, structures and quantum mechanics all rely on them.
For simpler arithmetic, start with the Basic Calculator, and for equations with one unknown try the Quadratic Formula Calculator.
Worked example
Multiplying A = [[4,7],[2,6]] by the identity matrix B = [[1,0],[0,1]] returns A unchanged — [[4,7],[2,6]]. The determinant of A is 4×6 − 7×2 = 10.
Frequently asked questions
What sizes of matrices does this support?
2×2 and 3×3 — the two sizes covered in most introductory linear algebra. Addition, subtraction, and multiplication require both matrices to be the same size.
Why does A × B not always equal B × A?
Matrix multiplication isn't commutative like regular number multiplication — the order matters, and swapping A and B generally produces a completely different result (when it's even defined, for non-square cases).
What does the determinant tell you?
It's a single number that captures key properties of a matrix — a determinant of zero means the matrix is 'singular' (not invertible, and the system of equations it represents doesn't have a unique solution). It's also used to compute area/volume scaling factors in geometry.
What is a transpose used for?
Flipping a matrix over its diagonal (rows become columns) shows up constantly in linear algebra — from computing dot products to reorienting data in machine learning and statistics.

