Xerobit

Determinant Calculator for Square Matrices

Enter the size and values of a square matrix to compute its determinant. This determinant calculator supports matrices from 1x1 up to 5x5 using cofactor expansion. All calculations run in your browser and nothing is uploaded to a server.

Separate columns with commas or spaces, rows with newlines. Use dots for decimals.

Result

  • Determinant
    -2

How to use the determinant calculator

  1. Select the matrix size from the dropdown (1x1 through 5x5).
  2. Type the entries into the text area, separating columns with commas or spaces and rows with newlines.
  3. The determinant appears automatically below as you type.
  4. If the result is zero, the matrix is singular and has no inverse.

How the determinant is calculated

The method used depends on the matrix size. For a 1x1 matrix containing a single value a, the determinant is simply a. For a 2x2 matrix, the formula is straightforward:

det(A) = a*d - b*c

For example, given the matrix with first row 1, 2 and second row 3, 4: 1*4 - 2*3 = 4 - 6 = -2.

For 3x3 matrices and larger, this determinant calculator uses cofactor expansion along the first row. Each element in the top row is multiplied by the determinant of the smaller sub-matrix that remains when you delete that element's row and column. The signs alternate: positive, negative, positive, and so on. A 4x4 expansion requires computing four 3x3 determinants, each of which requires three 2x2 determinants.

Common 2x2 and 3x3 examples

The table below shows several standard matrices and their determinants computed by hand.

Matrix sizeEntries (row by row)Determinant
2x21, 0 / 0, 11
2x23, 8 / 4, 6-14
3x31, 0, 0 / 0, 1, 0 / 0, 0, 11
3x32, 1, 3 / 0, -1, 2 / 1, 4, -223
3x31, 2, 3 / 4, 5, 6 / 7, 8, 90

The last 3x3 example produces zero because its third row is a linear combination of the first two. Whenever rows are linearly dependent, the determinant is zero.

Why the determinant matters

The determinant tells you whether a square matrix is invertible. If det(A) = 0, the matrix is singular: it collapses space into a lower dimension, meaning the system of equations it represents either has no solution or infinitely many. If the determinant is non-zero, the matrix has an inverse and the system has exactly one solution.

In geometry, the absolute value of the determinant represents the scaling factor of the linear transformation described by the matrix. For a 2x2 matrix, it gives the area scale factor of the parallelogram formed by the column vectors. For a 3x3 matrix, it gives the volume scale factor of the parallelepiped. This property makes the determinant essential in physics, computer graphics, and engineering whenever coordinate transformations are involved.

Key properties to remember

Several rules make working with determinants easier without needing to expand every time:

  • Identity matrix: The determinant of any identity matrix is 1.
  • Transpose: Transposing a matrix does not change its determinant.
  • Row swap: Swapping two rows multiplies the determinant by -1.
  • Scalar multiple: Multiplying one row by a constant k multiplies the determinant by k.
  • Product rule: det(AB) = det(A) * det(B) for square matrices of the same size.
  • Triangular matrix: If all entries above or below the main diagonal are zero, the determinant is simply the product of the diagonal entries.

These properties are why a diagonal 4x4 matrix with entries 2, 3, 5, 7 has a determinant of 2 * 3 * 5 * 7 = 210.

Input format and common mistakes

This tool accepts numbers separated by commas or spaces within each row, with rows separated by line breaks. Decimals must use a dot, not a comma (use 1.5, not 1,5). Negative numbers are written with a leading minus sign.

A frequent mistake is providing too few or too many entries for the selected matrix size. A 3x3 matrix requires exactly nine numbers. Another common error is mixing up rows and columns: the first line you type becomes the first row, not the first column. Finally, be aware that very large entry values in 4x4 or 5x5 matrices can produce results that exceed standard floating-point precision, though for typical textbook problems this is rarely an issue.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
2x2 identityMatrix size: 2; Matrix entries (row by row): 1, 0 / 0, 1Determinant: 1
3x3 singularMatrix size: 3; Matrix entries (row by row): 1, 2, 3 / 4, 5, 6 / 7, 8, 9Determinant: 0
3x3 invertibleMatrix size: 3; Matrix entries (row by row): 6, 1, 1 / 4, -2, 5 / 2, 8, 7Determinant: -306
4x4 diagonalMatrix size: 4; Matrix entries (row by row): 2, 0, 0, 0 / 0, 3, 0, 0 / 0, 0, 5, 0 / 0, 0, 0, 7Determinant: 210

FAQ

What is a determinant?

A determinant is a single scalar value computed from a square matrix. It encodes properties of the linear transformation the matrix represents, including whether the matrix is invertible and how it scales area or volume.

Can I find the determinant of a non-square matrix?

No. The determinant is only defined for square matrices where the number of rows equals the number of columns, such as 2x2, 3x3, or 4x4.

What does it mean if the determinant is zero?

A zero determinant means the matrix is singular and cannot be inverted. Geometrically, the transformation squashes space into a lower dimension, so the volume or area it maps to is zero.

How do I enter fractions or decimals?

Use decimal notation with a dot, such as 0.5 instead of 1/2. The parser reads standard numeric formats including negative numbers like -3.14.

Is there a limit to the matrix size?

This determinant calculator supports sizes from 1x1 up to 5x5. Cofactor expansion becomes computationally heavy for larger matrices, but 5x5 covers most coursework and practical needs.

Does this tool upload my data?

No. All computation happens locally in your browser. Your matrix entries are never sent to any server.