Matrix Calculator

Multiply, invert, transpose, reduce. Up to 6 × 6, with the row operations written out.

Instant answers Works offline once loaded Nothing you type is sent anywhere Up to 6 × 6 Live results Row operations logged

Matrix A

×

Matrix B

×

Operation

A × B

What happened

Properties of A

Size
Determinant
Rank
Trace
Instructions

How to use this calculator

Step by step

  1. Set the size of each matrix with the two boxes above its grid — anything up to 6 × 6. Resizing keeps the numbers you already typed.
  2. Type the entries straight into the grid. Use Identity, Zeros or Random to fill a grid quickly.
  3. Pick an operation. Ones that need an extra number — the scalar for k × A, the exponent for Aⁿ — reveal a box for it.
  4. The result appears immediately. Send to A pushes it back into the first grid, which is how you chain operations such as A⁻¹ then A⁻¹ × B.
  5. Read What happened for the row operations. For rref and A⁻¹, that log is the full solution written out.

Good to know

  • Matrix multiplication is not commutative: A × B and B × A are usually different matrices, and often only one of them is even legal.
  • To multiply, the columns of A must match the rows of B. The result takes the outer dimensions: (m × n)(n × p) → (m × p).
  • A determinant of zero is the single most useful diagnostic on this page — it means the matrix is singular, has no inverse, and collapses space into a lower dimension.
  • The rank counts independent rows. Rank less than the number of rows means at least one row is a combination of the others.
  • To solve a system Ax = b, put A in the first grid, b as a single-column B, then use A⁻¹, send it to A, and multiply. Or use the equation solver, which does it in one step.
  • Answers within 1e-10 of a whole number are shown as whole numbers — that gap is floating-point noise from the elimination, not a real difference.

The maths behind it

  • Multiplication (AB)ᵢⱼ = Σₖ aᵢₖ · bₖⱼ Row i of A dotted with column j of B.
  • Determinant (2 × 2) det = ad − bc Larger ones are computed as the product of the pivots after elimination.
  • Inverse (2 × 2) A⁻¹ = 1⁄det · [ d −b ; −c a ] Larger ones come from reducing [A | I] to [I | A⁻¹].
  • Transpose (Aᵀ)ᵢⱼ = aⱼᵢ (AB)ᵀ = BᵀAᵀ — the order reverses.
  • Trace tr(A) = Σ aᵢᵢ The sum of the diagonal, and also the sum of the eigenvalues.
Why does it refuse to multiply my matrices?

Because the inner dimensions do not match. A 2 × 3 can multiply a 3 × 4, but not a 2 × 4 — the number of columns on the left has to equal the number of rows on the right. The error message names both numbers so you can see which one to change.

What does “singular” mean?

The determinant is zero, so the matrix has no inverse. Geometrically it flattens space: a 3 × 3 singular matrix maps all of 3D onto a plane, a line or a point, and there is no way to undo that.

How is the determinant computed for large matrices?

Not by cofactor expansion, which costs n! operations and is hopeless past about 8 × 8. It comes from Gaussian elimination with partial pivoting: the determinant is the product of the pivots, negated once per row swap. That is both faster and numerically far steadier.

Does it handle fractions?

Enter them as decimals — 1/3 becomes 0.333333. Results are shown to six decimals, and anything within 1e-10 of a whole number is rounded so an identity matrix looks like one.