← Home

🧮 Matrix Calculator

Add, subtract, multiply and compute the determinant of matrices. Choose between 2×2 and 3×3 sizes, enter your elements and get instant results.

What is this tool?

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are fundamental in linear algebra and appear in virtually every quantitative field: computer graphics (transformations and projections), machine learning (weight matrices in neural networks), physics (quantum mechanics and rotations), economics (input-output models), engineering (stress and strain) and statistics (covariance and correlation). The four most common matrix operations are addition, subtraction, multiplication and determinant. Addition and subtraction are element-wise and require both matrices to have the same dimensions. Multiplication combines two matrices into a new one and requires the number of columns in the first to equal the number of rows in the second. The determinant is a single number computed from a square matrix that tells you whether the matrix is invertible and describes how it scales areas or volumes. This matrix calculator handles 2×2 and 3×3 matrices. You can add, subtract, multiply and compute determinants. Every calculation runs in your browser, so you can experiment freely without any data leaving your device.

How it works

For addition and subtraction, each element of the result matrix is the sum or difference of the corresponding elements: C[i][j] = A[i][j] ± B[i][j]. Both matrices must have the same dimensions. For multiplication, the element at row i, column j of the product is the dot product of row i of the first matrix and column j of the second: C[i][j] = Σ A[i][k] × B[k][j]. For 2×2 matrices this means four multiplications and additions per element; for 3×3 it means nine. The number of columns in A must equal the number of rows in B. The determinant of a 2×2 matrix is det = ad − bc (where the matrix is [[a,b],[c,d]]). For a 3×3 matrix, the calculator uses the cofactor expansion (Laplace expansion) along the first row: det = a(ei−fh) − b(di−fg) + c(dh−eg). A determinant of zero means the matrix is singular (not invertible).
Ad

How to use

  1. Select the matrix size (2×2 or 3×3).
  2. Choose the operation (add, subtract, multiply or determinant).
  3. Enter the elements of the first matrix.
  4. Enter the elements of the second matrix (not needed for determinant).
  5. Click Calculate to see the result matrix or determinant value.

Frequently Asked Questions

Can I multiply a 2×2 by a 3×3 matrix?

No. For multiplication to be defined, the number of columns in the first matrix must equal the number of rows in the second. Both matrices must be the same size for this calculator. If you need mixed dimensions, compute the product step by step or use a more advanced tool.

What does a determinant of zero mean?

A determinant of zero means the matrix is singular, which means it has no inverse. Geometrically, the transformation represented by the matrix collapses all of space onto a lower-dimensional subspace (a line or a point). In a system of linear equations, a zero determinant means there is no unique solution.

Why is matrix multiplication not commutative?

Unlike regular numbers, A×B generally does not equal B×A for matrices. The order matters because each element of the product depends on the rows of the first and the columns of the second. Swapping the order changes which rows pair with which columns, producing a different result.

How do I find the inverse of a matrix?

A matrix has an inverse only if its determinant is non-zero. This calculator focuses on the four core operations. For the inverse, divide the adjugate matrix by the determinant. For a 2×2 matrix [[a,b],[c,d]], the inverse is (1/det)×[[d,−b],[−c,a]].

Tips & Advice

When working with matrices, always check that the dimensions are compatible before starting a calculation. For multiplication, write the dimensions next to each other: (m×n) and (n×p) gives (m×p). If the inner dimensions do not match, the product is undefined. The determinant is only defined for square matrices (same number of rows and columns). A large determinant means the matrix represents a transformation that greatly scales areas or volumes; a determinant near zero suggests near-singularity, which can cause numerical instability in computations. In machine learning and data science, matrix multiplication is the backbone of forward propagation: each layer of a neural network is essentially a matrix-vector product followed by an activation function. Understanding how matrix dimensions flow through a computation graph is essential for debugging shape errors in frameworks like PyTorch and TensorFlow.

Related Tools

Ad