Full Guide

Matrix Calculator Guide

Enter 2x2 or 3x3 numeric square matrices by row to add, subtract, multiply, transpose, find determinants, or calculate inverses.

Open calculator

Full Guide

What This Calculator Does

This matrix calculator handles six standard operations on small numeric square matrices: A+B, A-B, A×B, transpose Aᵀ, determinant det(A), and inverse A⁻¹. It supports 2x2 and 3x3 sizes, accepts rows as text, and recalculates the result as valid input changes.

It is designed for introductory linear algebra, classroom exercises, homework checks, and hand-calculation review. It is not a symbolic algebra system: it does not handle variables, fraction objects, complex numbers, higher dimensions, RREF, eigenvalues, rank, norms, or matrix equations.

When to Use It

  • Check addition, subtraction, or multiplication of two 2x2 or 3x3 matrices.
  • Find a transpose or determinant of a square matrix.
  • Test whether a small square matrix is invertible and calculate its inverse.
  • Paste row-oriented numeric text and compare the result with hand work.

For Ax=b or larger systems, see the equation solver and dedicated linear-algebra tools. For symbolic numeric expressions, use the mathematical expression calculator.

Inputs Explained

Operation

The page offers six operations:

  • Addition: add corresponding entries; A and B must have the same size.
  • Subtraction: subtract corresponding entries; A and B must have the same size.
  • Multiplication: take row-by-column dot products; the page uses two same-size square matrices.
  • Determinant: return one scalar from matrix A.
  • Inverse: find A⁻¹ such that A×A⁻¹=I, using A only.
  • Transpose: swap rows and columns of A.

Matrix size

Choose 2x2 or 3x3. Changing size resets the text to a default example for that size, so copy any unsaved matrix before switching.

Matrix text format

Put one matrix row on each line and separate values with spaces or commas. For example:

1 2

3 4

is a valid 2x2 matrix. A 3x3 matrix must have three rows with three entries each. The parser accepts ordinary integers and decimals, including negatives, but not brackets, variables, units, fraction slashes, or scientific notation.

How the Calculation Works

Addition and subtraction

Entries are combined by position:

(A+B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ

(A-B)ᵢⱼ = Aᵢⱼ - Bᵢⱼ

Both matrices must have exactly the same dimensions.

Matrix multiplication

Each result entry is the sum of products from a row of A and a column of B:

(AB)ᵢⱼ = Σ AᵢₖBₖⱼ

Matrix multiplication is generally not commutative, so A×B is usually different from B×A. This page keeps the input square and fixed-size, so both matrices must be 2x2 or both 3x3.

Determinant

For [[a,b],[c,d]], the 2x2 determinant is:

det(A)=ad-bc

For 3x3 matrices, the implementation uses recursive expansion. The determinant is a scalar, not another matrix.

Inverse and singular matrices

The inverse uses a Gauss-Jordan style elimination process. An inverse exists only when the determinant is not near zero; the page treats |det(A)| < 1e-10 as singular and reports an error instead of returning an unreliable matrix.

Transpose

Transpose swaps rows and columns: (Aᵀ)ᵢⱼ=Aⱼᵢ. A square matrix remains the same size after transposition.

Example

Let:

A = [[1,2],[3,4]]

B = [[5,6],[7,8]]

Addition

A+B = [[6,8],[10,12]]

Multiplication

A×B = [[19,22],[43,50]]

For example, the top-left entry is 1×5+2×7=19.

Determinant, inverse, and transpose

det(A)=1×4-2×3=-2

A⁻¹=[[-2,1],[1.5,-0.5]]

Aᵀ=[[1,3],[2,4]]

The 3x3 example [[1,2,3],[0,1,4],[5,6,0]] has determinant 1, which is useful for checking the size switch and 3x3 parsing.

How to Understand the Result

Addition, subtraction, multiplication, transpose, and inverse return a matrix table. Determinant returns one scalar. The result title identifies the operation, such as A+B, det(A), or A⁻¹, so do not read a scalar result as a matrix.

The page uses JavaScript numeric arithmetic. Ordinary results show up to 6 decimal places, while very large or very small values switch to scientific notation. Exact fractions are not preserved, so a value such as 1/3 appears as a decimal approximation.

Common Mistakes

  • Entering only two rows in 3x3 mode or using the wrong number of entries per row.
  • Using different dimensions for A and B in addition, subtraction, or multiplication.
  • Assuming determinant, transpose, and inverse also need matrix B.
  • Forgetting multiplication order and treating A×B as B×A.
  • Treating a zero or near-zero determinant as a page failure instead of a singular-matrix condition.
  • Typing [1,2;3,4], 1/2, 1e3, or a variable expression.

FAQ

Does the page recalculate after editing?

Yes. Once the required matrix text is valid, the result refreshes as you edit; the Calculate button can also trigger a deliberate recalculation.

Do addition and multiplication both need two same-size matrices?

On this fixed-size square-matrix page, all three binary operations require A and B to be both 2x2 or both 3x3. General m×n by n×p multiplication is outside this page.

Why is determinant not a matrix result?

The determinant maps a square matrix to one scalar, so the page displays it separately as det(A). Inverse and transpose return matrices.

What should I do when inverse does not exist?

Check the determinant. If it is 0 or below the page threshold in absolute value, the matrix is singular and cannot be inverted; choose another matrix or another operation.

Can it calculate eigenvalues, rank, or RREF?

No. The page provides six basic operations; advanced linear-algebra tasks need a dedicated tool.

Notes

This tool is for basic operations and result checks on 2x2 and 3x3 numeric square matrices. It does not support higher or non-square input, free-form matrix text, variables, fractions, complex values, exact rational output, RREF, eigenvalues, rank, norms, matrix equations, or graphical derivations. For near-singular inverses or precision-sensitive work, cross-check with specialist software or hand calculations.

For two-variable linear relationships, see the equation solver. Do not treat this page's fixed 2x2/3x3 scope as a general matrix-system solver.

Frequently Asked Questions

Which sizes and operations does the current page support?

It supports 2x2 and 3x3 numeric square matrices and six operations: addition, subtraction, multiplication, transpose, determinant, and inverse.

Which operations need two matrices?

Addition, subtraction, and multiplication use A and B; transpose, determinant, and inverse use only A.

How should I enter matrix text?

Put one row on each line, separate values with spaces or commas, and make the row and column counts match the selected size.

Why can inverse fail?

When the determinant is near zero, the page treats the matrix as singular and does not return an inverse.

Does it support fractions, variables, or larger matrices?

No. The parser accepts ordinary integer and decimal text only, and the page is fixed to 2x2 and 3x3 numeric square matrices.