🧮

Matrix Calculator

Perform matrix multiplication, determinant, and inverse operations for square matrices from 2x2 up to 5x5.

Operation support: A × B, det(A), A⁻¹. Inverse exists only when determinant is non-zero.
Matrix A
Matrix B

Result

About Matrix Calculator

Matrices are fundamental in linear algebra, graphics, optimization, and machine learning. This tool lets you run common square-matrix operations instantly in your browser without installing software.

Supported Operations

  • Matrix multiplication: multiply matrix A by matrix B.
  • Determinant: compute det(A) using cofactor expansion.
  • Inverse: compute A⁻¹ using Gauss-Jordan elimination.

How to Use

  1. Select the matrix size (2×2 up to 5×5).
  2. Enter values into the matrix cells.
  3. For multiplication, fill in both Matrix A and Matrix B.
  4. Click the desired operation: Multiply, Determinant, or Inverse.
  5. The result appears below with the computed matrix or scalar value.

How It Works

Multiplication uses standard row-by-column dot products. Determinant uses recursive cofactor expansion. The inverse is computed by augmenting [A|I] and applying Gauss-Jordan row reduction to produce [I|A⁻¹].

Example

For a 2×2 matrix [[1,2],[3,4]]: determinant = (1×4) − (2×3) = −2. Inverse = (1/−2) × [[4,−2],[−3,1]] = [[-2,1],[1.5,−0.5]].

Frequently Asked Questions

A singular matrix has a determinant of zero and has no inverse. This happens when rows or columns are linearly dependent (e.g. two identical rows or one row is a multiple of another).
For this tool, both matrices are square and the same size. In general, A×B requires the number of columns in A to equal the number of rows in B.
Yes. You can enter any real numbers including negatives (e.g. -3.5) into any cell.
Generally no. Matrix multiplication is not commutative — A×B usually gives a different result from B×A. The tool computes A×B in the order you enter the matrices.