Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Linear Algebra

How to Find the Determinant of a Matrix

By MathSolver Pro Editorial Team · Published

The determinant is a single number calculated from a square matrix. It tells you whether the matrix is invertible, how the matrix scales areas and volumes, and whether it flips orientation. This guide shows every standard method for computing it, with worked examples.

What the determinant measures

Every square matrix has a determinant, written det⁡(A)\det(A) or ∣A∣|A|. Matrices that are not square do not have one. The determinant answers a key question at once: a square matrix has an inverse exactly when its determinant is not zero. A zero determinant means the matrix collapses space into a lower dimension, so information is lost and cannot be recovered.

Geometrically, the absolute value of the determinant is the factor by which the matrix scales areas in two dimensions, or volumes in three. Its sign tells you whether the transformation keeps or reverses orientation, much as a mirror reverses left and right.

The 2 by 2 formula

For a 2×22 \times 2 matrix, multiply the main diagonal and subtract the product of the other diagonal:

det⁡(abcd)=ad−bc\det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc

Example 1: a 2 by 2 determinant

  1. For (3846)\begin{pmatrix} 3 & 8 \\ 4 & 6 \end{pmatrix}, the main diagonal product is 3⋅6=183 \cdot 6 = 18.
  2. The other diagonal product is 8⋅4=328 \cdot 4 = 32.
  3. The determinant is 18−32=−1418 - 32 = -14. It is nonzero, so the matrix is invertible, and the negative sign means it reverses orientation.

The area interpretation is easy to see here. The columns (3,1)(3, 1) and (1,2)(1, 2) of the matrix (3112)\begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix} span a parallelogram, and its area is ∣3⋅2−1⋅1∣=5|3 \cdot 2 - 1 \cdot 1| = 5, which is the determinant.

Cofactor expansion for 3 by 3 matrices

For larger matrices, cofactor expansion reduces the problem to smaller determinants. Pick a row, say the first. For each entry, delete its row and column to get a smaller matrix, called the minor, and multiply the entry by the minor's determinant. Then combine the results using the checkerboard of signs +,−,++, -, +:

det⁡(A)=a11M11−a12M12+a13M13\det(A) = a_{11}M_{11} - a_{12}M_{12} + a_{13}M_{13}

Example 2: expanding along the first row

  1. Let A=(2−3120−1145)A = \begin{pmatrix} 2 & -3 & 1 \\ 2 & 0 & -1 \\ 1 & 4 & 5 \end{pmatrix}.
  2. First entry 2: its minor is ∣0−145∣=0+4=4\begin{vmatrix} 0 & -1 \\ 4 & 5 \end{vmatrix} = 0 + 4 = 4, giving 2⋅4=82 \cdot 4 = 8.
  3. Second entry −3-3: its minor is ∣2−115∣=10+1=11\begin{vmatrix} 2 & -1 \\ 1 & 5 \end{vmatrix} = 10 + 1 = 11. With the minus sign, −(−3)(11)=33-(-3)(11) = 33.
  4. Third entry 1: its minor is ∣2014∣=8\begin{vmatrix} 2 & 0 \\ 1 & 4 \end{vmatrix} = 8, giving 1⋅8=81 \cdot 8 = 8.
  5. det⁡(A)=8+33+8=49\det(A) = 8 + 33 + 8 = 49.

You may expand along any row or column, and the answer is the same. Choose the one with the most zeros, because each zero entry removes a whole term.

Sarrus' rule, a shortcut for 3 by 3 only

For 3×33 \times 3 matrices there is a memorable shortcut. Add the three products running down to the right, wrapping around the edge, and subtract the three products running down to the left. For the matrix in Example 2, the downward products are 2⋅0⋅5=02 \cdot 0 \cdot 5 = 0, (−3)(−1)(1)=3(-3)(-1)(1) = 3 and 1⋅2⋅4=81 \cdot 2 \cdot 4 = 8, totalling 11. The upward products are 1⋅0⋅1=01 \cdot 0 \cdot 1 = 0, 2⋅(−1)⋅4=−82 \cdot (-1) \cdot 4 = -8 and (−3)⋅2⋅5=−30(-3) \cdot 2 \cdot 5 = -30, totalling −38-38. The determinant is 11−(−38)=4911 - (-38) = 49, matching the cofactor method.

Be careful: Sarrus' rule works only for 3×33 \times 3 matrices. Applying the same diagonal pattern to a 4×44 \times 4 matrix gives the wrong answer, a common and costly mistake on exams.

Row reduction for larger matrices

Cofactor expansion becomes slow quickly: a 10×1010 \times 10 matrix would need millions of products. Row reduction is far more efficient. The determinant of a triangular matrix is simply the product of its diagonal entries, so you reduce the matrix to triangular form while tracking how each row operation changes the determinant:

  • Adding a multiple of one row to another leaves the determinant unchanged.
  • Swapping two rows multiplies the determinant by −1-1.
  • Multiplying a row by a number kk multiplies the determinant by kk.

Example 3: determinant by row reduction

  1. Let B=(123253108)B = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 3 \\ 1 & 0 & 8 \end{pmatrix}.
  2. Replace row 2 with row 2 minus 2 times row 1, giving (0,1,−3)(0, 1, -3), and row 3 with row 3 minus row 1, giving (0,−2,5)(0, -2, 5).
  3. Replace row 3 with row 3 plus 2 times row 2, giving (0,0,−1)(0, 0, -1).
  4. Only row additions were used, so the determinant is unchanged: 1⋅1⋅(−1)=−11 \cdot 1 \cdot (-1) = -1.

Properties that save work

det⁡(AB)=det⁡(A)det⁡(B),det⁡(AT)=det⁡(A),det⁡(A−1)=1det⁡(A)\det(AB) = \det(A)\det(B), \qquad \det(A^T) = \det(A), \qquad \det(A^{-1}) = \frac{1}{\det(A)}
  • A matrix with a row or column of zeros has determinant 0.
  • A matrix with two equal rows, or one row a multiple of another, has determinant 0.
  • For an n×nn \times n matrix, det⁡(kA)=kndet⁡(A)\det(kA) = k^n\det(A), not kdet⁡(A)k\det(A).
  • The determinant of the identity matrix is 1.

These rules let you find many determinants without calculating anything. If you notice that one row is twice another, the determinant is zero and the matrix has no inverse, which you can confirm with the inverse of a matrix guide.

Cramer's rule: solving systems with determinants

Determinants can solve small linear systems directly. For 2x+y=52x + y = 5 and x−3y=−1x - 3y = -1, the coefficient determinant is D=2(−3)−1(1)=−7D = 2(-3) - 1(1) = -7. Replace the first column with the constants to get Dx=5(−3)−1(−1)=−14D_x = 5(-3) - 1(-1) = -14, and the second column to get Dy=2(−1)−5(1)=−7D_y = 2(-1) - 5(1) = -7. Then x=DxD=2x = \frac{D_x}{D} = 2 and y=DyD=1y = \frac{D_y}{D} = 1.

Cramer's rule is elegant and handy for 2×22 \times 2 and 3×33 \times 3 systems, but it is inefficient for larger ones, where elimination is faster. If D=0D = 0, the system has either no solution or infinitely many. The determinant calculator shows cofactor expansion and row reduction steps for matrices of any size, and the matrix calculator handles the surrounding arithmetic.

A 4 by 4 example: let the zeros do the work

Larger determinants become manageable when you exploit zeros. Consider the matrix with rows (1,0,2,0)(1, 0, 2, 0), (3,1,0,0)(3, 1, 0, 0), (0,0,2,1)(0, 0, 2, 1) and (0,0,0,4)(0, 0, 0, 4). The last row has three zeros, so expanding along it leaves just one term: the entry 4, in a position with a plus sign, times the determinant of the 3×33 \times 3 matrix left after deleting the last row and column.

That smaller matrix has rows (1,0,2)(1, 0, 2), (3,1,0)(3, 1, 0) and (0,0,2)(0, 0, 2). Its last row also has two zeros, so expand again: the entry 2 times ∣1031∣=1\begin{vmatrix} 1 & 0 \\ 3 & 1 \end{vmatrix} = 1 gives 2. The full determinant is therefore 4⋅2=84 \cdot 2 = 8. Without the zeros, the same calculation would have required twenty-four products of four numbers each.

Common mistakes to avoid

  • Forgetting the alternating signs in cofactor expansion, especially the minus sign on the second position of the first row.
  • Using Sarrus' diagonal rule on a 4×44 \times 4 or larger matrix.
  • Scaling a row during row reduction without adjusting the determinant.
  • Swapping rows and forgetting to change the sign.
  • Assuming det⁡(A+B)=det⁡(A)+det⁡(B)\det(A + B) = \det(A) + \det(B), which is false in general; only products split nicely.

A useful habit is to compute a 3×33 \times 3 determinant two ways, for example by cofactor expansion along a row and then along a column with a zero. If the answers agree you can be confident, and if they differ the mismatch points you to a sign error.

Determinants in three dimensions

In three dimensions, the absolute value of a 3×33 \times 3 determinant is the volume of the parallelepiped, a slanted box, whose edges are the three column vectors. The matrix in Example 2 therefore turns a unit cube into a solid of volume 49. The same idea gives a quick test for whether three vectors lie in a single plane: they do exactly when the determinant is zero, because a flat box has no volume. The cross product is closely related, since it is usually computed as a symbolic 3×33 \times 3 determinant.

Frequently asked questions

What happens to a matrix whose determinant equals zero?

The matrix is singular: it has no inverse, its rows are linearly dependent, and it squashes space into a lower dimension. A linear system with that coefficient matrix has either no solution or infinitely many.

What does a negative determinant tell me?

Yes. A negative determinant means the transformation reverses orientation, like a reflection. The absolute value still gives the area or volume scale factor.

Do non-square matrices have determinants?

No. The determinant is defined only for square matrices, because only they map a space to a space of the same dimension, where comparing areas or volumes makes sense.

Which row should I expand along?

Any row or column gives the same result, so choose the one with the most zeros. Remember to apply the checkerboard of plus and minus signs to each position.

Is there a fast way to check a determinant I calculated by hand?

Expand along a different row or column and compare, or row reduce to triangular form and multiply the diagonal. Two independent methods agreeing is strong evidence the answer is right.

MathSolver Pro Editorial Team

Math content and review

Our editorial team writes every guide to explain the reasoning behind each method, not just the answer. Each worked example is checked against the site's own solver engines and automated tests before it is published, and articles are revised whenever a method or an exam format changes.