Calcufast

Matrix Calculator

Add, subtract and multiply 2×2 or 3×3 matrices. Also calculate the determinant, transpose and inverse.

Inputs
Enter values to calculate
Matrix A
Matrix B

Values between −1,000,000 and 1,000,000. A × B combines rows of A with columns of B; it is not element-wise multiplication.

Advertisement
Results

Choose an operation and fill in the matrix cells.

How to work with matrices

Choose 2×2 or 3×3 and fill every cell, including zeros. Addition and subtraction use corresponding positions. For multiplication, each output cell combines a row of A with a column of B: Cᵢⱼ = Σ AᵢₖBₖⱼ.

Single-matrix operations only use A. Transposition swaps rows and columns. The determinant returns a number; for 2×2 it is ad − bc. An inverse, when it exists, satisfies A × A⁻¹ = I.

Step-by-step example

The initial matrices are A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]. For A × B:

CellCalculationResult
Row 1, column 11 × 5 + 2 × 719
Row 1, column 21 × 6 + 2 × 822
Row 2, column 13 × 5 + 4 × 743
Row 2, column 23 × 6 + 4 × 850

Therefore, A × B = [[19, 22], [43, 50]]. The determinant of A is 1 × 4 − 2 × 3 = −2. Its inverse is [[-2, 1], [1.5, -0.5]].

Precision and singular matrices

The inverse uses Gauss–Jordan elimination with pivot selection. A matrix with zero determinant has no inverse. The tool also rejects very small pivots because rounding could produce an unreliable inverse. Operations do not mutate the original inputs. Results use up to ten significant digits.

Source

OpenStax: matrices and matrix operations explains addition, multiplication and dimensions. To solve an individual linear or quadratic equation, use the equation calculator.

Frequently asked questions

A square matrix has an inverse if its determinant is nonzero. This tool also rejects numerically unstable matrices.

Not necessarily. In general, matrix multiplication is not commutative.