Matrix Calculator

A matrix is a rectangular array of numbers arranged in rows and columns. Common matrix operations include addition (element-by-element sum), multiplication (dot products of rows and columns), transposition (swapping rows and columns), the determinant (a scalar value indicating invertibility), and the inverse (the matrix that produces the identity when multiplied). For a 2x2 matrix [[a, b], [c, d]], the determinant is ad - bc and the inverse is (1/det) * [[d, -b], [-c, a]]. Select a matrix size, choose an operation, enter your values, and calculate.

Quick Answer

The determinant of the matrix [[3, 8], [4, 6]] is 3*6 - 8*4 = -14. Since the determinant is nonzero, the matrix is invertible.

Matrix A

Matrix B

Common Examples

Input Result
[[1, 2], [3, 4]] + [[5, 6], [7, 8]] [[6, 8], [10, 12]]
det([[3, 8], [4, 6]]) -14
[[1, 2], [3, 4]] * [[5, 6], [7, 8]] [[19, 22], [43, 50]]
inverse([[4, 7], [2, 6]]) [[0.6, -0.7], [-0.2, 0.4]]
det([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) 0 (singular matrix)

How It Works

Matrix Addition and Subtraction

Two matrices of the same dimensions can be added or subtracted element by element:

(A + B)_ij = A_ij + B_ij

For example, [[1, 2], [3, 4]] + [[5, 6], [7, 8]] = [[6, 8], [10, 12]].

Matrix Multiplication

Matrix multiplication combines rows of the first matrix with columns of the second. For A (m x n) and B (n x p), the product C = AB is an m x p matrix where:

C_ij = sum of A_ik * B_kj for k = 1 to n

Matrix multiplication is not commutative: AB does not necessarily equal BA.

Transpose

The transpose of a matrix swaps its rows and columns. If A is m x n, then A^T is n x m, with (A^T)_ij = A_ji.

Determinant

The determinant is a scalar value computed from a square matrix. It indicates whether the matrix is invertible (det != 0) or singular (det = 0).

2x2: det([[a, b], [c, d]]) = ad - bc

3x3: Computed by cofactor expansion along the first row: det(A) = a(ei - fh) - b(di - fg) + c(dh - eg), where the matrix is [[a, b, c], [d, e, f], [g, h, i]].

Inverse

The inverse A^(-1) of a matrix A satisfies A * A^(-1) = I (the identity matrix). A matrix has an inverse only if its determinant is nonzero.

2x2: A^(-1) = (1/det) * [[d, -b], [-c, a]]

3x3: A^(-1) = (1/det) * adj(A), where adj(A) is the transposed cofactor matrix.

Worked Example

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

C_11 = 15 + 27 = 5 + 14 = 19. C_12 = 16 + 28 = 6 + 16 = 22. C_21 = 35 + 47 = 15 + 28 = 43. C_22 = 36 + 48 = 18 + 32 = 50.

Result: [[19, 22], [43, 50]].

Determinant of A: det = 14 - 23 = 4 - 6 = -2. Since det != 0, A is invertible. Inverse: (1/-2) * [[4, -2], [-3, 1]] = [[-2, 1], [1.5, -0.5]].

Related Calculators

Frequently Asked Questions

What is the determinant used for?
The determinant tells you whether a matrix is invertible (nonzero determinant) or singular (zero determinant). It also appears in formulas for area/volume transformations, solving systems of linear equations (Cramer's rule), and eigenvalue calculations.
Why is matrix multiplication not commutative?
Matrix multiplication depends on the order of row-column dot products. Swapping the matrices changes which rows pair with which columns, producing a different result. In some special cases (like multiplying by the identity matrix), AB = BA, but this is not true in general.
What is a singular matrix?
A singular matrix has a determinant of zero and does not have an inverse. This means the rows (or columns) are linearly dependent. The system of equations represented by a singular matrix has either no solution or infinitely many solutions.
Does this calculator support matrices larger than 3x3?
This calculator supports 2x2 and 3x3 matrices. These cover the most common textbook and practical use cases. For larger matrices, dedicated linear algebra software is more appropriate.
What is the identity matrix?
The identity matrix I has 1s on the main diagonal and 0s everywhere else. For 2x2, I = [[1, 0], [0, 1]]. Multiplying any matrix by the identity matrix returns the original matrix: AI = IA = A. The identity matrix is the matrix equivalent of the number 1 in scalar multiplication.