HomeMath › Matrix Inverse Calculator

Matrix Inverse Calculator

Computes the inverse of a 2×2 or 3×3 matrix as adj(A) / det(A), returning the determinant, the cofactor and adjugate matrices and the inverse, with an explicit error for singular matrices.

When to use

You need A⁻¹ for a small matrix, e.g. to solve A·x = b, undo a linear transformation, or check that A·A⁻¹ = I.

Do not use when: You only need the determinant or rank (use matrix-determinant), want to solve a specific system (use linear-system), or the matrix is larger than 3×3.

Formula

A⁻¹ = adj(A) / det(A), adj(A) = Cᵀ with cofactors C_ij = (−1)^(i+j)·M_ij; for 2×2: [[a, b], [c, d]]⁻¹ = 1/(ad − bc) · [[d, −b], [−c, a]]

Inputs

ParameterTypeUnitRequiredDescription
matrixnumber_listyesAll entries row by row: 4 values for 2×2 or 9 for 3×3. [[1, 2], [3, 4]] is entered as 1, 2, 3, 4.
sizeintegernoMatrix dimension n (2 or 3). Optional: inferred from the number of entries when omitted. Range: ≥ 2, ≤ 3

Outputs

OutputTypeUnitDescription
determinantnumberdet(A); the inverse exists only when it is non-zero.
inversenumber_listEntries of A⁻¹ row by row.
inverse_textstringA⁻¹ written as nested rows, e.g. '[[-2, 1], [1.5, -0.5]]'.
adjugatenumber_listadj(A) = transpose of the cofactor matrix; A⁻¹ = adj(A) / det(A).
cofactorsnumber_listC_ij = (−1)^(i+j) · M_ij, where M_ij is the minor of entry (i, j).
sizeintegerDimension n of the matrix.

Example

[[1, 2], [3, 4]]: {"matrix":[1,2,3,4],"size":2}{"determinant":-2,"inverse":[-2,1,1.5,-0.5],"inverse_text":"[[-2, 1], [1.5, -0.5]]","adjugate":[4,-2,-3,1],"cofactors":[4,-3,-2,1],"size":2}

[[1, 2, 3], [0, 1, 4], [5, 6, 0]]: {"matrix":[1,2,3,0,1,4,5,6,0]}{"determinant":1,"inverse":[-24,18,5,20,-15,-4,-5,4,1],"adjugate":[-24,18,5,20,-15,-4,-5,4,1],"size":3}

GET https://tttkmbb.com/api/v1/calculate/matrix-inverse?matrix=1%2C2%2C3%2C4&size=2

Machine access

Sources

FAQ

Why does a singular matrix have no inverse?

The inverse divides the adjugate by the determinant; when det(A) = 0 the matrix collapses space onto a line or plane and the mapping cannot be undone. The calculator then returns an error naming the zero determinant.

How can I check the result?

Multiply A by the inverse: the product must be the identity matrix (ones on the diagonal, zeros elsewhere), up to rounding of the 6 reported decimals.

Related calculators