Skip to main content
GARGLOO

Matrix Calculator

Exact fractions, every step shown.

Runs on your device

At a glance

Input:
Numbers you enter
Processing:
Runs locally in your browser
Privacy:
Nothing you type is sent to a server

Last updated: 2026-11-10

Common use cases

  • Multiplying two 2×2 matrices for homework and checking both orders — A × B and B × A
  • Finding the inverse of [[2, 1], [1, 2]] and checking it against the identity, exactly
  • Working out the determinant of a 3×3 matrix with the expansion shown
  • Checking whether a matrix is singular before trying to invert it

About this tool

Add, subtract and multiply matrices up to 3×3 — transpose, determinant, inverse and rank — all in exact fractions, with every step shown. The default example multiplies [[1, 2], [3, 4]] by [[5, 6], [7, 8]] to get [[19, 22], [43, 50]], and shows B × A = [[23, 34], [31, 46]] beside it, because the two orders differ. 1/3 stays 1/3: the inverse of [[2, 1], [1, 2]] is [[2/3, −1/3], [−1/3, 2/3]], and inverse × original is the identity exactly. A singular matrix (det = 0) has no inverse, and the page says so instead of printing Infinity. Everything runs locally in your browser — no signup, no upload.

How to use it

  1. Pick an operation — Multiply, Add, Subtract, Transpose, Determinant, Inverse or Rank — and set the sizes of A and B (up to 3×3).
  2. Type the entries: integers, fractions like 1/2, or decimals like 0.1, which becomes 1/10 exactly.
  3. Read the result as a matrix — for Multiply, both A × B and B × A are shown, because the orders differ.
  4. Follow the steps: each cell of a product shows its row-times-column sum; the determinant shows its expansion; the inverse shows its Gauss-Jordan elimination.
  5. If the matrix is singular, the inverse tab says so plainly — det = 0 means no inverse exists.

Worked examples

Input: A = [[1, 2], [3, 4]] · B = [[5, 6], [7, 8]] (multiply)

Output: A × B = [[19, 22], [43, 50]] · B × A = [[23, 34], [31, 46]]

Row × column: 1·5 + 2·7 = 19, 1·6 + 2·8 = 22, 3·5 + 4·7 = 43, 3·6 + 4·8 = 50 — and B × A differs, because multiplication is not commutative.

Input: A = [[2, 1], [1, 2]] (determinant and inverse)

Output: det = 3 · Inverse = [[2/3, −1/3], [−1/3, 2/3]]

det = 2·2 − 1·1 = 3, so the inverse exists: (1/3)·[[2, −1], [−1, 2]]. Check: inverse × A = [[1, 0], [0, 1]] exactly.

Input: A = [[6, 1, 1], [4, −2, 5], [2, 8, 7]] (determinant)

Output: det = −306

Expand along the first row: 6·(−54) − 1·18 + 1·36 = −324 − 18 + 36 = −306.

Practical tips

  • Multiply by the identity to check your entries — A × I is A, so a wrong entry shows up at once.
  • A zero determinant is the whole story for the inverse: check det first, and skip the elimination when it is 0.
  • Read the B × A result even when you only need A × B — the difference is the fastest reminder that order matters.

Common mistakes

  • Adding matrices of different sizes — A + B needs the same rows and columns on both sides.
  • Multiplying in the wrong order — A × B needs A's columns to match B's rows, and B × A is a different matrix.
  • Trusting a decimal inverse — 0.333333 is not 1/3, and a rounded inverse times the original is not the identity.

How this compares

Most matrix calculators print a decimal answer and stop — a 3×3 inverse comes back as 0.3333333333, and multiplying it back gives 1.0000000002 instead of 1, with no way to see why. This calculator works in exact fractions throughout, shows both multiplication orders, prints the determinant expansion and the Gauss-Jordan steps, and says plainly when a matrix is singular. The tradeoff: matrices stop at 3×3 at v1, and entries are limited to |value| ≤ 1000 with denominators ≤ 1000, so the exact arithmetic stays exact.

Good to know

  • Matrices up to 3×3 at v1 — 6×6 is a follow-up, not this version.
  • Entries are limited to |value| ≤ 1000 with denominators ≤ 1000, so the exact arithmetic stays exact.
  • A singular matrix (det = 0) has no inverse — the page says so instead of printing Infinity or a garbage matrix.
  • Determinant and inverse need square matrices; non-square inputs are refused with a named error.

Frequently asked questions

Why are the answers fractions, not decimals?

Because decimals round and fractions do not: 1/3 stays 1/3, so inverse × original is the identity exactly — [[1, 0], [0, 1]] — instead of 1.000000000002. A decimal inverse is an approximation; a fraction inverse is the answer.

What does “no inverse” mean?

The matrix is singular: its determinant is 0, so no matrix B satisfies A·B = I. [[1, 2], [2, 4]] has det 0 — its second row is twice the first — so the calculator says plainly that there is no inverse, instead of printing Infinity or a garbage matrix.

Why is A × B different from B × A?

Matrix multiplication is not commutative: the (i, j) entry of A × B is row i of A times column j of B, and swapping the factors swaps which rows meet which columns. The default example shows it: A × B = [[19, 22], [43, 50]] but B × A = [[23, 34], [31, 46]].

What can I type in a cell?

Integers (3, −2), fractions (1/2, −3/4) or decimals (0.1 becomes 1/10 exactly, 1.5 becomes 3/2). Entries are limited to |value| ≤ 1000 with denominators ≤ 1000, so the exact arithmetic stays exact — anything else is refused with a named error.

What is the rank of a matrix?

The number of independent rows (or columns — they agree). [[1, 2], [2, 4]] has rank 1 because the second row is 2 × the first, so it adds nothing. The calculator shows the reduced form, so you can see the pivot rows.

Is my data uploaded?

No. The calculation runs entirely in your browser — the matrices you enter never leave this tab, and nothing is stored.

All calculators
Matrix Calculator | GARGLOO