Home › Math › 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
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
matrix | number_list | yes | All 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. | |
size | integer | no | Matrix dimension n (2 or 3). Optional: inferred from the number of entries when omitted. Range: ≥ 2, ≤ 3 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
determinant | number | det(A); the inverse exists only when it is non-zero. | |
inverse | number_list | Entries of A⁻¹ row by row. | |
inverse_text | string | A⁻¹ written as nested rows, e.g. '[[-2, 1], [1.5, -0.5]]'. | |
adjugate | number_list | adj(A) = transpose of the cofactor matrix; A⁻¹ = adj(A) / det(A). | |
cofactors | number_list | C_ij = (−1)^(i+j) · M_ij, where M_ij is the minor of entry (i, j). | |
size | integer | Dimension 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
- API:
GET https://tttkmbb.com/api/v1/calculate/matrix-inverse(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/matrix-inverse · Markdown: https://tttkmbb.com/math/matrix-inverse.md · JSON definition: https://tttkmbb.com/math/matrix-inverse.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="matrix-inverse" - OpenAPI operationId:
calculate_matrix_inverse - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Invertible matrix (reference)
- Wikipedia – Adjugate matrix (reference)
- Wolfram MathWorld – Matrix Inverse (reference)
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
- Matrix Determinant Calculator — Determinant, rank and singularity test for the same matrix.
- System of Linear Equations Solver — Solve A·x = b directly with Cramer's rule.