Matrix Calculator - Operations & Determinant Matrix Calculator

Perform matrix operations — add, subtract, multiply, determinant, transpose, and inverse.

Matrix Input

Matrix A

Matrix B

Your Results

Determinant 0
Operation det(A)

Calculation Steps

Matrix Calculator - Guide

What Is the Matrix Calculator?

The Matrix Calculator is a free online tool for performing 2×2 and 3×3 matrix operations with step-by-step solutions. It supports addition, subtraction, multiplication, determinant, transpose, and inverse — the six operations students and professionals use most. Simply choose a size, pick an operation, enter your values, and get an instant answer complete with calculation steps.

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are fundamental in linear algebra, computer graphics, physics, statistics, and machine learning.

Key Features

  • Six operations: Addition (A + B), Subtraction (A − B), Multiplication (A × B), Determinant, Transpose, and Inverse.
  • 2×2 and 3×3 support: Toggle between matrix sizes with a single dropdown.
  • Two-matrix input: Matrix B grid appears automatically for operations that require a second matrix and hides for single-matrix operations.
  • Step-by-step output: Detailed calculation steps are shown below the result so you can follow the working.
  • Instant results: Results, the result matrix grid, and supplementary values update in real time.
  • Mobile-friendly & accessible: Responsive grid layout with ARIA labels and keyboard navigation.

Formulas — How Matrix Operations Are Calculated

Addition / Subtraction

C[i][j] = A[i][j] ± B[i][j]. Both matrices must have the same dimensions.

Multiplication

C[i][j] = Σk A[i][k] × B[k][j]. Columns of A must equal rows of B.

Determinant (2×2)

det(A) = a11×a22 − a12×a21

Determinant (3×3 — Cofactor Expansion)

det(A) = a11(a22a33 − a23a32) − a12(a21a33 − a23a31) + a13(a21a32 − a22a31)

Transpose

AT[i][j] = A[j][i] — rows become columns.

Inverse (2×2)

A−1 = (1/det(A)) × [ [a22, −a12], [−a21, a11] ]

Inverse (3×3)

A−1 = (1/det(A)) × adj(A), where adj(A) is the transpose of the cofactor matrix. Requires det(A) ≠ 0.

How to Use This Calculator — Step by Step

  1. Select matrix size: Choose 2×2 or 3×3 from the “Size” dropdown.
  2. Choose an operation: Pick one of the six operations from the “Operation” dropdown (e.g., Determinant, A × B).
  3. Enter Matrix A values: Fill in each cell of the Matrix A grid with numeric values.
  4. Enter Matrix B values (if needed): For addition, subtraction, or multiplication, fill in Matrix B as well.
  5. Click “Calculate”: The result — a scalar (determinant) or result matrix — appears in the results card along with detailed steps.

Practical Examples — Matrix Calculations With Steps

Example 1 — 2×2 Determinant

  • A = [[3, 8], [4, 6]]
  • det(A) = (3 × 6) − (8 × 4) = 18 − 32 = −14

Example 2 — 2×2 Matrix Multiplication

  • A = [[1, 2], [3, 4]], B = [[5, 6], [7, 8]]
  • C[1][1] = 1×5 + 2×7 = 19  |  C[1][2] = 1×6 + 2×8 = 22
  • C[2][1] = 3×5 + 4×7 = 43  |  C[2][2] = 3×6 + 4×8 = 50
  • Result: [[19, 22], [43, 50]]

Example 3 — 3×3 Inverse

  • A = [[2, 1, 0], [0, 3, 1], [1, 0, 2]]
  • det(A) = 2(6−0) − 1(0−1) + 0 = 12 + 1 = 13
  • A−1 = (1/13) × adj(A) — each cofactor is computed then transposed and divided by 13.

Real-World Use Cases

  • Computer graphics: Rotation, scaling, and translation of 2D/3D objects use matrix multiplication.
  • Systems of linear equations: Solving Ax = b by computing A−1b or using row reduction.
  • Physics & engineering: Stress tensors, moment-of-inertia tensors, and circuit analysis rely on matrices.
  • Machine learning: Weight matrices in neural networks are updated via matrix operations during training.
  • Economics & statistics: Input-output models, covariance matrices, and regression use matrix algebra.
  • Cryptography: The Hill cipher encrypts messages by multiplying character vectors by a key matrix.

Understanding Your Results

  • Result matrix grid: For addition, subtraction, multiplication, transpose, and inverse, the output is displayed as a matrix grid.
  • Scalar value (Determinant): A single number representing the “scale factor” of the linear transformation defined by the matrix.
  • Calculation steps: The step-by-step section walks through every intermediate computation so you can verify or learn the process.
  • Singular matrix warning: If you request the inverse of a matrix with determinant = 0, the calculator will indicate that the inverse does not exist.

Tips & Best Practices

  • Double-check that you entered numbers in the correct row-column position — swapping a12 and a21 changes the result entirely.
  • Matrix multiplication is not commutative: A × B ≠ B × A in general.
  • Before computing an inverse, check the determinant first. If det(A) = 0, the matrix is singular and has no inverse.
  • Use the transpose operation to quickly switch rows and columns — for example, to convert a row vector into a column vector.
  • For homework verification, compare the calculator’s steps with your own working to pinpoint where an error occurred.

Common Mistakes to Avoid

  • Assuming multiplication is commutative: A×B and B×A generally produce different matrices.
  • Adding matrices of different sizes: Addition and subtraction require identical dimensions. This calculator enforces equal sizes.
  • Forgetting the sign pattern in cofactor expansion: Signs alternate (+, −, +, …) across the expansion row.
  • Trying to invert a singular matrix: If det(A) = 0, no inverse exists. Check the determinant first.
  • Mixing up rows and columns when entering data: Matrix entry is row-major (left to right, top to bottom).

Key Matrix Properties

  • det(A × B) = det(A) × det(B)
  • (A × B)T = BT × AT
  • (A−1)−1 = A
  • det(A−1) = 1 ÷ det(A)
  • A × A−1 = A−1 × A = I (identity matrix)
  • (AT)T = A

Frequently Asked Questions

Q: How do you find the determinant of a 3×3 matrix?

Use cofactor expansion along the first row: det(A) = a11(a22a33 − a23a32) − a12(a21a33 − a23a31) + a13(a21a32 − a22a31).

Q: When does a matrix have an inverse?

A square matrix has an inverse if and only if its determinant is non-zero. Such a matrix is called “non-singular” or “invertible.”

Q: Why is matrix multiplication not commutative?

Because the dot products that produce each element depend on the order of rows and columns. Swapping the operands changes which rows dot with which columns.

Q: Can I multiply a 2×2 matrix by a 3×3 matrix?

Not directly. The number of columns in the first matrix must equal the number of rows in the second. This calculator keeps both matrices the same size to ensure compatibility.

Find a Calculator

Browse All Calculators →