Matrix Calculator

Add, multiply, invert and transpose matrices; find determinant, rank and powers with exact fractions.

One row per line, entries separated by spaces or commas. Fractions such as 1/2 are fine. Up to 8 × 8.

Show entries as

Number entry: use a point for decimals (1.5). Commas grouped in threes are thousands separators (1,250), and a single comma such as 1,5 is read as a decimal comma. Nothing you enter leaves your device.

Showing the example values. Change the inputs and press Calculate for your own result.

A × B

2 × 2 matrix

Result

Col 1Col 2
1922
4350

Working

  1. Entry (i, j) = sum over t of A(i, t) × B(t, j).

Matrix multiplication is not commutative: B × A is generally different (and may not exist).

About the matrix calculator

The matrix calculator performs the standard operations of linear algebra on matrices up to 8 × 8: addition, subtraction, multiplication, scalar multiplication, determinant, inverse, transpose, powers, rank and trace. All arithmetic uses exact fractions, so results such as inverses have no rounding error.

You can show entries as fractions or as decimals.

Who should use the matrix calculator

  • Students of linear algebra, engineering and computer graphics.
  • Anyone checking hand calculations.
  • Developers who need an exact result for a small matrix.

How to use the matrix calculator: what each input means

Operation
Choose A + B, A − B, A × B, k × A, determinant, inverse, transpose, power or rank and trace.
Matrix A and B
One row per line, with entries separated by spaces or commas. Fractions like 1/2 are allowed.
Scalar k or exponent n
Used for scaling and powers. Negative powers use the inverse.
Display
Exact fractions or decimals.

How the matrix calculator works: method and formula

Addition and subtraction work entry by entry and need matrices of the same size. Multiplication needs the number of columns of A to equal the number of rows of B; each entry is the sum of products along a row of A and a column of B. Determinants and inverses are found with Gaussian elimination using exact rational arithmetic.

Product
(AB)ᵢⱼ = Σₖ Aᵢₖ × Bₖⱼ
2 × 2 determinant
det [[a, b], [c, d]] = ad − bc
Inverse
A × A⁻¹ = I, exists only when det(A) ≠ 0

How to read your matrix calculator result

A determinant of zero means the matrix is singular and has no inverse. The rank is the number of independent rows. Matrix multiplication is not commutative: AB and BA usually differ.

Matrix Calculator worked example

A = [1 2; 3 4] and B = [5 6; 7 8].

  1. A × B = [19, 22; 43, 50].
  2. det(A) = 1 × 4 − 2 × 3 = -2.
  3. A⁻¹ = [-2, 1; 3/2, -1/2].

A × B = [19, 22; 43, 50] and det(A) = -2.

Practical uses of the matrix calculator

  • Checking linear algebra homework.
  • Solving small systems of equations by inverse matrices.
  • Verifying transformation matrices.

Assumptions and limitations of this calculator

  • Limited to 8 rows and 8 columns.
  • Does not compute eigenvalues, decompositions or step-by-step elimination.
  • Entries must be real numbers or fractions.
FAQs

Matrix Calculator FAQs

When the number of columns in the first equals the number of rows in the second.

Need Something Built Around Your Numbers?

Code & Motions designs and builds custom calculators, dashboards and web tools for businesses. Tell us what you have in mind.