Matrix Determinant Calculator

Enter the elements of the square matrix (from 2x2 to 6x6) to calculate its determinant step by step.

Quick Examples

Rate this tool

How to Use the Calculator

This online matrix determinant solver is a linear algebra tool designed to evaluate square matrices from 2x2 up to 6x6 dimensions. In addition to providing the numerical value, the math engine generates a detailed step-by-step solution to help you understand the analytical procedure.

How to enter your data:

  1. Select the matrix size: use the initial setup menu to define the dimension of the square matrix you want to work with (2x2, 3x3, 4x4, 5x5, or 6x6).
  2. Enter the elements: fill in each cell of the grid with your data. The system supports integers, decimals, and exact fractions. We recommend entering the values exactly as they appear in your problem to avoid rounding errors during the calculation.

Once you run the calculation, the tool will structure the results into two main sections:

1. Quick answer
In a first highlighted section, you will immediately find the final value of the determinant (denoted as |A|). This section is ideal if you only need to check the solution to your exercises.

2. Step-by-step solution
For the most commonly studied dimensions in mathematics (2x2, 3x3, and 4x4), the finder will display the entire algebraic method used to arrive at the answer. The algorithm adapts its strategy according to the matrix size:

  • 2x2 matrices: the system will show you the fundamental rule, calculating the mathematical difference of the cross multiplications of the diagonals (a11 · a22 - a12 · a21).
  • 3x3 matrices: the calculation will be carried out using the cofactor expansion method (also known as Laplace expansion). It takes the elements of the first row of the matrix as a reference, multiplying each by its corresponding 2x2 determinant and analytically alternating the signs.
  • 4x4 matrices: just like the previous level, the solver expands the determinant along the first row. However, to avoid cluttering the view with excessively long calculations, the system calculates and displays the expansion of the minors (3x3 submatrices) in separate, organized blocks.

Solved Exercises

The following are examples of problems solved by the calculator.

Exercise 1

Calculate the determinant of the following 3x3 matrix:

$$ \displaystyle A = \begin{bmatrix} 2 & -1 & 3 \\[0.5em] 0 & 4 & -2 \\[0.5em] 1 & 5 & 1 \end{bmatrix} $$

Result

The determinant of the given matrix is:

$$ \displaystyle |A| = 18 $$

Step-by-step solution

To calculate the determinant of a 3x3 matrix, we expand along the first row. We multiply each element by its respective 2x2 determinant, alternating the signs (positive, negative, positive).

$$ \displaystyle |A| = \begin{vmatrix} 2 & -1 & 3 \\[0.5em] 0 & 4 & -2 \\[0.5em] 1 & 5 & 1 \end{vmatrix} \\[0.8em] = (2) \begin{vmatrix} 4 & -2 \\[0.5em] 5 & 1 \end{vmatrix} - (-1) \begin{vmatrix} 0 & -2 \\[0.5em] 1 & 1 \end{vmatrix} + (3) \begin{vmatrix} 0 & 4 \\[0.5em] 1 & 5 \end{vmatrix} \\[0.8em] = (2) \left[ (4)(1) - (-2)(5) \right] - (-1) \left[ (0)(1) - (-2)(1) \right] + (3) \left[ (0)(5) - (4)(1) \right] \\[0.8em] = (2) \left[ 4 - (-10) \right] - (-1) \left[ 0 - (-2) \right] + (3) \left[ 0 - (4) \right] \\[0.8em] = (2) (14) - (-1) (2) + (3) (-4) \\[0.8em] = (28) - (-2) + (-12) \\[0.8em] = 28 + 2 - 12 \\[0.8em] = 18 $$
Exercise 2

Find the determinant of the following 2x2 matrix:

$$\displaystyle A = \begin{bmatrix} 3 & 4 \\[0.5em] -2 & 5 \end{bmatrix}$$

Result

The determinant of the given matrix is:

$$ \displaystyle |A| = 23 $$

Step-by-step solution

The determinant of a 2x2 matrix is calculated by taking the product of the elements on the main diagonal minus the product of the elements on the anti-diagonal.

$$ \displaystyle |A| = \begin{vmatrix} 3 & 4 \\[0.5em] -2 & 5 \end{vmatrix} \\[0.8em] = (3)(5) - (4)(-2) \\[0.8em] = 15 - (-8) \\[0.8em] = 15 + 8 \\[0.8em] = 23 $$
Exercise 3

Evaluate the determinant of the following matrix:

$$ \displaystyle A = \begin{bmatrix} \frac{1}{2} & \frac{2}{3} \\[0.5em] -3 & 4 \end{bmatrix} $$

Result

The determinant of the given matrix is:

$$ \displaystyle |A| = 4 $$

Step-by-step solution

The determinant of a 2x2 matrix is calculated by taking the product of the elements on the main diagonal minus the product of the elements on the anti-diagonal.

$$ \displaystyle |A| = \begin{vmatrix} \frac{1}{2} & \frac{2}{3} \\[0.5em] -3 & 4 \end{vmatrix} \\[0.8em] = \left(\frac{1}{2}\right)(4) - \left(\frac{2}{3}\right)(-3) \\[0.8em] = 2 - (-2) \\[0.8em] = 2 + 2 \\[0.8em] = 4 $$
Exercise 4

Compute the determinant of the following 3x3 matrix:

$$ \displaystyle A = \begin{bmatrix} 1 & 2 & 3 \\[0.5em] 4 & 5 & 6 \\[0.5em] 7 & 8 & 9 \end{bmatrix} $$

Result

The determinant of the given matrix is:

$$ \displaystyle |A| = 0 $$

Step-by-step solution

To calculate the determinant of a 3x3 matrix, we expand along the first row. We multiply each element by its respective 2x2 determinant, alternating the signs (positive, negative, positive).

$$ \displaystyle |A| = \begin{vmatrix} 1 & 2 & 3 \\[0.5em] 4 & 5 & 6 \\[0.5em] 7 & 8 & 9 \end{vmatrix} \\[0.8em] = (1) \begin{vmatrix} 5 & 6 \\[0.5em] 8 & 9 \end{vmatrix} - (2) \begin{vmatrix} 4 & 6 \\[0.5em] 7 & 9 \end{vmatrix} + (3) \begin{vmatrix} 4 & 5 \\[0.5em] 7 & 8 \end{vmatrix} \\[0.8em] = (1) \left[ (5)(9) - (6)(8) \right] - (2) \left[ (4)(9) - (6)(7) \right] + (3) \left[ (4)(8) - (5)(7) \right] \\[0.8em] = (1) \left[ 45 - (48) \right] - (2) \left[ 36 - (42) \right] + (3) \left[ 32 - (35) \right] \\[0.8em] = (1) (-3) - (2) (-6) + (3) (-3) \\[0.8em] = (-3) - (-12) + (-9) \\[0.8em] = -3 + 12 - 9 \\[0.8em] = 0 $$
Exercise 5

Solve the determinant of the following 4x4 matrix:

$$ \displaystyle A = \begin{bmatrix} 1 & 0 & 2 & -1 \\[0.5em] 3 & 1 & 0 & 2 \\[0.5em] -2 & 0 & 1 & 1 \\[0.5em] 4 & -1 & 3 & 0 \end{bmatrix} $$

Result

The determinant of the given matrix is:

$$ \displaystyle |A| = 34 $$

Step-by-step solution

To calculate the determinant of a 4x4 matrix, we expand along the first row using its minors (M) and alternating the signs.

$$ \displaystyle |A| = \begin{vmatrix} 1 & 0 & 2 & -1 \\[0.5em] 3 & 1 & 0 & 2 \\[0.5em] -2 & 0 & 1 & 1 \\[0.5em] 4 & -1 & 3 & 0 \end{vmatrix} \\[0.8em] = (1) M_{11} - (0) M_{12} + (2) M_{13} - (-1) M_{14} \\[0.8em] = (1) M_{11} + (2) M_{13} - (-1) M_{14} \\[0.8em] = (1) (-1) + (2) (11) - (-1) (13) \\[0.8em] = (-1) + (22) - (-13) \\[0.8em] = -1 + 22 + 13 \\[0.8em] = 34 $$
See calculation for minor M11
$$ \displaystyle M_{11} = \begin{vmatrix} 1 & 0 & 2 \\[0.5em] 0 & 1 & 1 \\[0.5em] -1 & 3 & 0 \end{vmatrix} \\[0.8em] = (1) \begin{vmatrix} 1 & 1 \\[0.5em] 3 & 0 \end{vmatrix} - (0) \begin{vmatrix} 0 & 1 \\[0.5em] -1 & 0 \end{vmatrix} + (2) \begin{vmatrix} 0 & 1 \\[0.5em] -1 & 3 \end{vmatrix} \\[0.8em] = (1) \begin{vmatrix} 1 & 1 \\[0.5em] 3 & 0 \end{vmatrix} + (2) \begin{vmatrix} 0 & 1 \\[0.5em] -1 & 3 \end{vmatrix} \\[0.8em] = (1) \left[ (1)(0) - (1)(3) \right] + (2) \left[ (0)(3) - (1)(-1) \right] \\[0.8em] = (1) \left[ 0 - (3) \right] + (2) \left[ 0 - (-1) \right] \\[0.8em] = (1) (-3) + (2) (1) \\[0.8em] = (-3) + (2) \\[0.8em] = -3 + 2 \\[0.8em] = -1 $$
See calculation for minor M13
$$ \displaystyle M_{13} = \begin{vmatrix} 3 & 1 & 2 \\[0.5em] -2 & 0 & 1 \\[0.5em] 4 & -1 & 0 \end{vmatrix} \\[0.8em] = (3) \begin{vmatrix} 0 & 1 \\[0.5em] -1 & 0 \end{vmatrix} - (1) \begin{vmatrix} -2 & 1 \\[0.5em] 4 & 0 \end{vmatrix} + (2) \begin{vmatrix} -2 & 0 \\[0.5em] 4 & -1 \end{vmatrix} \\[0.8em] = (3) \left[ (0)(0) - (1)(-1) \right] - (1) \left[ (-2)(0) - (1)(4) \right] + (2) \left[ (-2)(-1) - (0)(4) \right] \\[0.8em] = (3) \left[ 0 - (-1) \right] - (1) \left[ 0 - (4) \right] + (2) \left[ 2 - (0) \right] \\[0.8em] = (3) (1) - (1) (-4) + (2) (2) \\[0.8em] = (3) - (-4) + (4) \\[0.8em] = 3 + 4 + 4 \\[0.8em] = 11 $$
See calculation for minor M14
$$ \displaystyle M_{14} = \begin{vmatrix} 3 & 1 & 0 \\[0.5em] -2 & 0 & 1 \\[0.5em] 4 & -1 & 3 \end{vmatrix} \\[0.8em] = (3) \begin{vmatrix} 0 & 1 \\[0.5em] -1 & 3 \end{vmatrix} - (1) \begin{vmatrix} -2 & 1 \\[0.5em] 4 & 3 \end{vmatrix} + (0) \begin{vmatrix} -2 & 0 \\[0.5em] 4 & -1 \end{vmatrix} \\[0.8em] = (3) \begin{vmatrix} 0 & 1 \\[0.5em] -1 & 3 \end{vmatrix} - (1) \begin{vmatrix} -2 & 1 \\[0.5em] 4 & 3 \end{vmatrix} \\[0.8em] = (3) \left[ (0)(3) - (1)(-1) \right] - (1) \left[ (-2)(3) - (1)(4) \right] \\[0.8em] = (3) \left[ 0 - (-1) \right] - (1) \left[ -6 - (4) \right] \\[0.8em] = (3) (1) - (1) (-10) \\[0.8em] = (3) - (-10) \\[0.8em] = 3 + 10 \\[0.8em] = 13 $$

Related Tools

Daniel Machado

Professor of Mathematics, graduated from the Faculty of Exact, Chemical and Natural Sciences of the National University of Misiones (UNAM). Developer and creator of RigelUp, dedicated to building tools for mathematical learning.