Home › Math › Matrix Determinant Calculator
Matrix Determinant Calculator
Computes the determinant of a 2×2, 3×3 or 4×4 matrix by Laplace (cofactor) expansion along the first row, and reports whether the matrix is singular, its trace and its rank.
When to use
You need the determinant of a small square matrix, want to check whether it is invertible, or need its rank or trace.
Do not use when: You need the inverse matrix itself (use matrix-inverse), want to solve equations (use linear-system), or the matrix is larger than 4×4.
Formula
2×2: det = a·d − b·c; n×n: det = Σ_j (−1)^(1+j) · a_1j · M_1j, where M_1j is the determinant of the matrix without row 1 and column j (Laplace expansion)
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
matrix | number_list | yes | All entries row by row: 4 values for 2×2, 9 for 3×3, 16 for 4×4. [[1, 2], [3, 4]] is entered as 1, 2, 3, 4. | |
size | integer | no | Matrix dimension n (2, 3 or 4). Optional: inferred from the number of entries when omitted. Range: ≥ 2, ≤ 4 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
determinant | number | det(A) by cofactor expansion along the first row. | |
is_singular | boolean | true when the determinant is 0 (the matrix has no inverse). | |
expansion | string | The first-row expansion with the numbers filled in, e.g. '1·4 − 2·3 = -2'; for 3×3 and 4×4 each term shows the entry times its minor. | |
trace | number | Sum of the diagonal entries. | |
rank | integer | Number of linearly independent rows (Gaussian elimination). | |
size | integer | Dimension n of the matrix. |
Example
[[1, 2], [3, 4]]: {"matrix":[1,2,3,4],"size":2} → {"determinant":-2,"is_singular":false,"expansion":"1·4 − 2·3 = -2","trace":5,"rank":2,"size":2}
[[6, 1, 1], [4, -2, 5], [2, 8, 7]]: {"matrix":[6,1,1,4,-2,5,2,8,7]} → {"determinant":-306,"is_singular":false,"expansion":"6·(-54) − 1·(18) + 1·(36) = -306","trace":11,"rank":3,"size":3}
GET https://tttkmbb.com/api/v1/calculate/matrix-determinant?matrix=1%2C2%2C3%2C4&size=2
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/matrix-determinant(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/matrix-determinant · Markdown: https://tttkmbb.com/math/matrix-determinant.md · JSON definition: https://tttkmbb.com/math/matrix-determinant.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="matrix-determinant" - OpenAPI operationId:
calculate_matrix_determinant - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Determinant (reference)
- Wikipedia – Laplace expansion (reference)
- Wolfram MathWorld – Determinant (reference)
FAQ
What does a zero determinant mean?
The rows (and columns) are linearly dependent: the matrix has no inverse, and the linear system it represents has no unique solution. The rank output shows how many independent rows remain.
Is the result exact?
For integer entries the cofactor expansion uses only integer multiplications and additions, so the determinant is exact as long as intermediate products stay below 2^53.
Related calculators
- Matrix Inverse Calculator — Inverse and adjugate of the same matrix.
- System of Linear Equations Solver — Cramer's rule uses these determinants to solve equations.
- Vector Calculator — The 3D cross product is a 3×3 determinant.