Matrix Calculator tool

Matrix Calculator

A matrix is a rectangular grid of numbers.

What is a matrix calculator?

A matrix calculator stores matrices typed with commas between entries and semicolons between rows. Choose add, subtract, multiply, transpose, determinant, or 2×2 inverse. It returns numeric grids or a scalar determinant for small linear algebra tasks.

How to use the Matrix Calculator

  1. Type matrix A like 1, 2; 3, 4.
  2. Enter matrix B when the operation needs two.
  3. Select add, subtract, multiply, transpose, det, or inverse.
  4. Match dimensions for each operation.
  5. Read the output grid or scalar determinant.

About this calculator

A matrix is a rectangular grid of numbers. You use them in linear algebra, computer graphics, statistics, and engineering systems. This calculator handles the operations most students need without installing software.

Type matrix A as comma-separated values with semicolons between rows. Example: 1, 2; 3, 4 is a 2×2 matrix. For add, subtract, or multiply, enter matrix B in the same format. Transpose, determinant, and inverse use matrix A only.

Addition and subtraction need matching dimensions. Multiplication needs the column count of A to equal the row count of B. The 2×2 inverse exists only when the determinant is not zero.

For equation systems try the [[linear-equation]] calculator. For larger numeric work pair this with the [[scientific-notation]] calculator when entries are very large or small.

Formula for common matrix operations

det [[a,b],[c,d]] = ad − bc
Inverse 2×2: (1/det) × [[d,−b],[−c,a]]
  • Rows are separated by semicolons in the input box
  • Multiply needs inner dimensions to match
  • Inverse exists only when det ≠ 0

Matrix example: determinant and sum

Matrix A = 1, 2; 3, 4 has determinant 1×4 − 2×3 = −2. Choose det 2×2 to read −2.

Add A + B with B = 5, 6; 7, 8 entry-wise: (1+5, 2+6; 3+7, 4+8) = 6, 8; 10, 12. Enter those matrices on add to match the grid.

Inverse of A exists because det ≠ 0. Scale swapped diagonal by 1/(−2) to invert A numerically in the tool.

Worked examples

Multiply two 2×2 matrices

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

Top-left = 1×5 + 2×7 = 19. Full product = [[19, 22], [43, 50]]. Each entry is a row of A dotted with a column of B.

Inverse of a 2×2

A = [[4, 7], [2, 6]]. det = 4×6 − 7×2 = 10.

Inverse = (1/10) × [[6, −7], [−2, 4]] = [[0.6, −0.7], [−0.2, 0.4]]. Swap the diagonal, negate the off-diagonal, divide by the determinant.

Common uses

  • Add or subtract matrices for linear algebra homework
  • Multiply transformation matrices in 2D graphics problems
  • Find 2×2 or 3×3 determinants for Cramer
  • ,

Frequently asked questions

How do I enter a matrix in this calculator?

Separate values in a row with commas and separate rows with semicolons. 1, 0, 2; 3, 4, 5 is a 2×3 matrix with first row 1, 0, 2 and second row 3, 4, 5.

When can I multiply two matrices?

A (m×n) can multiply B (n×p) only when the inner dimensions match — columns of A equal rows of B. The result is m×p.

What is the determinant of a 2×2 matrix?

For [[a, b], [c, d]], det = ad − bc. Example: [[1, 2], [3, 4]] gives 1×4 − 2×3 = −2. Zero determinant means no inverse exists.

Why does inverse fail for some 2×2 matrices?

A matrix has no inverse when its determinant is zero — the rows are linearly dependent. Example: [[1, 2], [2, 4]] has det 0 because row 2 is twice row 1.

Deep dive

Why matrix multiplication is not commutative

AB and BA are usually different.

What the determinant tells you

Area, volume, and invertibility in one number.

Related calculators

Maintained by J Jaya Prakash · Last updated: October 2026