# 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.

- Calculator id: `matrix-inverse` · Category: Math (`math`) · Tool name: `calculate_matrix_inverse`
- Canonical page: https://tttkmbb.com/math/matrix-inverse · This document: https://tttkmbb.com/math/matrix-inverse.md · JSON definition: https://tttkmbb.com/math/matrix-inverse.json

## Purpose

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.

**Use when:** 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.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `matrix` | number_list |  | required | 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 |  | optional | Matrix dimension n (2 or 3). Optional: inferred from the number of entries when omitted. (min 2, max 3) |

## Output

| Field | 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. |

## 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]]`

## Data Sources

- Wikipedia – Invertible matrix — https://en.wikipedia.org/wiki/Invertible_matrix (reference, retrieved 2026-09-24)
- Wikipedia – Adjugate matrix — https://en.wikipedia.org/wiki/Adjugate_matrix (reference, retrieved 2026-09-24)
- Wolfram MathWorld – Matrix Inverse — https://mathworld.wolfram.com/MatrixInverse.html (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/matrix-inverse?matrix=…`
- `POST https://tttkmbb.com/api/v1/calculate/matrix-inverse` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/matrix-inverse · OpenAPI operationId `calculate_matrix_inverse` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "matrix-inverse", "inputs": {…}}`

## Example

- [[1, 2], [3, 4]]: inputs `{"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]]: inputs `{"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
```

## Limitations

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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Matrix Determinant Calculator](https://tttkmbb.com/math/matrix-determinant.md) — Determinant, rank and singularity test for the same matrix.
- [System of Linear Equations Solver](https://tttkmbb.com/math/linear-system.md) — Solve A·x = b directly with Cramer's rule.
