HomeMath › 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

ParameterTypeUnitRequiredDescription
matrixnumber_listyesAll 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.
sizeintegernoMatrix dimension n (2, 3 or 4). Optional: inferred from the number of entries when omitted. Range: ≥ 2, ≤ 4

Outputs

OutputTypeUnitDescription
determinantnumberdet(A) by cofactor expansion along the first row.
is_singularbooleantrue when the determinant is 0 (the matrix has no inverse).
expansionstringThe 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.
tracenumberSum of the diagonal entries.
rankintegerNumber of linearly independent rows (Gaussian elimination).
sizeintegerDimension 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

Sources

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