Skip to content

Lesson: The determinant

You have spent three lessons moving the basis vectors around and watching the whole plane move with them. Stretch, rotate, shear, flip. Here is a natural question that turns out to have a remarkably clean answer: when a transformation moves space, by how much does it change the size of things?

That single number, how much a transformation scales area, is called the determinant. It compresses an entire matrix down to one value that answers two questions at once: how much bigger or smaller does this transformation make regions, and does it flip space over in the process. It is the most useful scalar you can extract from a matrix, and by the end you will be able to read it straight off the columns.

Start with the cleanest statement. For a 2x2 matrix M, the determinant of M is the factor by which M scales area. Take any region of the plane with area A. After you apply M, the region has area equal to the determinant times A. A transformation with determinant 3 makes everything three times larger in area. One with determinant 0.5 cuts every area in half.

What is surprising is that this one factor is the same for every region. You do not get one scaling for squares and a different one for circles. Because a linear transformation stretches space uniformly, every area, whatever its shape, scales by the same number. So you only need to measure it once.

The easiest region to measure it with is the unit square, the one-by-one square spanned by i-hat and j-hat. Its area is exactly 1. After the transformation it becomes the parallelogram spanned by the two columns of the matrix (the landing spots of i-hat and j-hat, from the transformations lesson). Since the square started with area 1, the area of that parallelogram is the determinant.

det(M) = area of the parallelogram the unit square becomes

So to find the determinant geometrically: plot the two columns, draw the parallelogram they span, measure its area. That number is how much the transformation scales every area in the plane.

The determinant as the area of the parallelogram Two side-by-side panels. The left panel shows the unit square at the origin filled in light purple, labeled area equals 1. The right panel shows the parallelogram the unit square becomes under L = [[2, 1], [0, 2]], spanned by the two matrix columns [2, 0] and [1, 2]. The parallelogram is labeled area equals 4 in its center, which is the determinant of L. The teal L of i-hat and amber L of j-hat run along its bottom and left edges. unit square (area 1) area = 1 parallelogram (area = det L = 4) area = 4 L = [[2, 1], [0, 2]] → det L = 4
The unit square has area 1; under L it becomes a parallelogram whose area is the determinant. Here L stretches and shears, and the parallelogram comes out to area 4. The determinant is the number that says how much L scales every area.

A few determinant values tell you the character of a transformation at a glance.

  • A determinant of 1: area is preserved. Rotations and shears do this; they move space around without changing how much of it there is. The identity has determinant 1 too.
  • A determinant of 2 (or any value above 1): areas grow. A determinant of 2 doubles every area.
  • A determinant between 0 and 1: areas shrink, but nothing collapses.
  • A determinant of 0: the transformation squashes the whole plane onto a line, or even onto a single point. All area is lost. This happens exactly when the two columns are linearly dependent, the case from the spans lesson where the second vector added no new direction. A zero determinant is the signature of a collapse.
  • A negative determinant: the transformation flips orientation, turning space over like a reflection in a mirror. The magnitude still gives the area scaling; the negative sign is a separate flag that says “the plane got flipped.” A right-handed arrangement of the basis became left-handed.

That last point is why the determinant is signed. It carries two pieces of information in one number: the size of the scaling (its magnitude) and whether orientation was preserved or flipped (its sign).

For a 2x2 matrix, the determinant has a short formula, the main diagonal product minus the off-diagonal product:

M = [ a b ] det(M) = ad - bc
[ c d ]

This is the signed area of the parallelogram spanned by the two columns. The quick way to see where it comes from: enclose the parallelogram in a bounding rectangle, then subtract the rectangles and triangles in the corners that are not part of the parallelogram. When you tally the trimmed pieces, the leftover area works out to the main diagonal product minus the off-diagonal product. You do not need to memorize the derivation, only the result: multiply the main diagonal, subtract the off-diagonal product.

Why det of [[a, b], [c, d]] equals ad minus bc A two-dimensional coordinate grid. The bounding box from (0, 0) to (a+b, c+d), with a equals 3, b equals 1, c equals 1, d equals 2, is lightly shaded. Inside it, the parallelogram spanned by the columns [a, c] equals [3, 1] and [b, d] equals [1, 2] is drawn in accent purple, with corners at the origin, (3, 1), (4, 3), and (1, 2). A legend computes ad minus bc as 3 times 2 minus 1 times 1, which equals 5, the area of the parallelogram. The bounding box area is shown as (a+b)(c+d) equals 12, and the difference of 7 is the area outside the parallelogram. (a+b) × (c+d) = 4 × 3 = 12 [a, c] = [3, 1] [b, d] = [1, 2] area = 5 why ad - bc? box = (a+b)(c+d) outside = ac + bd + 2bc parallelogram = ad - bc = 5
The parallelogram fits inside an (a+b) by (c+d) bounding rectangle. After cutting away the corner pieces, you're left with ad minus bc. That difference is the determinant. The formula is the area's geometric receipt.

A pure stretch. Take M the matrix with first column 3, 0 and second column 0, 2, which sends i-hat to 3, 0 and j-hat to 0, 2. The formula gives:

det = (3)(2) - (0)(0) = 6

Geometrically, the unit square becomes a 3-by-2 rectangle, area 6. Both routes agree: this transformation makes every area six times larger.

A rotation. Take the quarter-turn rotation R with first column 0, 1 and second column negative-1, 0. The formula gives:

det = (0)(0) - (-1)(1) = 1

A rotation spins space without resizing it, so its determinant is exactly 1, area preserved. The picture confirms it: the unit square rotates into a unit square, still area 1.

A collapse. Take M with first column 2, 1 and second column 4, 2. Notice that the second column is 2 times the first: the columns are linearly dependent, lying on the same line. The formula gives:

det = (2)(2) - (4)(1) = 4 - 4 = 0

The transformation crushes the entire plane onto the line through 2, 1. This is the dependence case from the spans lesson, now wearing a number: dependent columns mean zero determinant mean collapsed space.

A reflection. Take M with first column 1, 0 and second column 0, negative-1, which leaves i-hat alone but sends j-hat to 0, negative-1, flipping the plane across the x-axis. The formula gives:

det = (1)(-1) - (0)(0) = -1

The magnitude is 1, so areas are unchanged, but the sign is negative, flagging that orientation was flipped. A mirror does not change how much space there is; it turns it over.

A shear. Take the shear S from the earlier lessons, leaving i-hat at 1, 0 and tipping j-hat over to 1, 1. The formula gives:

det = (1)(1) - (1)(0) = 1

This one tends to surprise people: a shear visibly distorts the square into a leaning parallelogram, yet its determinant is exactly 1, so area is perfectly preserved. The base stays one unit wide and the slanted shape stays one unit tall, so sliding the top sideways changes the shape without changing the area. Distortion and area change are different things, and the determinant tracks only the second.

Five worked examples of the determinant: stretch, rotation, collapse, reflection, shear Five small side-by-side panels, each showing what the unit square becomes under a different 2x2 matrix, with the determinant labeled below. Panel 1: a 3 by 2 axis-aligned rectangle, determinant 6 because area is 3 times 2. Panel 2: a unit square rotated 30 degrees, determinant 1 because rotations preserve area. Panel 3: the unit square collapsed to a line along y equals x because both columns are collinear, determinant 0 in red. Panel 4: the unit square reflected below the x axis, determinant negative 1 because the orientation flips. Panel 5: a sheared parallelogram, determinant 1 because the same base and height give the same area. L = [[3, 0], [0, 2]] det = 6 rotation 30° det = 1 collapsed (degenerate) det = 0 reflected across x det = -1 sheared L = [[1, 1], [0, 1]] det = 1
Five matrices, five fates for the unit square. The determinant reports the signed area of the image: positive when orientation is preserved, negative when it flips, zero when the image collapses to a line or a point. Rotation and shear both leave area at 1 because they neither stretch nor flip.

In 3D the determinant of a 3x3 matrix means exactly the analogous thing, with volume in place of area. It is the factor by which the transformation scales the volume of any region, read off as the volume of the parallelepiped the unit cube becomes. A determinant of 0 means the cube was flattened into a plane, a line, or a point, all volume lost. A negative determinant means the transformation turned space inside out, the 3D version of a mirror flip. Same story, one dimension up.

Doing two transformations in a row multiplies their determinants:

det(AB) = det(A) · det(B)

The reason needs no algebra. If B doubles areas and A triples them, then applying B and then A scales areas by 2 and then by 3, which is 6 overall. Scaling factors compose by multiplying. The determinant of a composition is the product of the determinants, because that is just what “scale, then scale again” does.

The determinant answers a question that decides whether a transformation can be undone: did it lose information? If the determinant is nonzero, the transformation merely rearranged space without collapsing it, and you can run it backward to recover what you started with. It is invertible. If the determinant is zero, the transformation squashed space onto something smaller, and the lost dimension cannot be recovered, because many different inputs got crushed to the same output. It is not invertible.

That invertible-or-not question runs underneath a lot of machine learning. A layer or a matrix with determinant zero has thrown information away, collapsing distinct inputs together, which is sometimes a bug and sometimes the point. And whenever a method needs to track how a transformation rescales the volume of a cloud of data, for instance when converting between probability distributions, the absolute value of the determinant is the rescaling factor it reaches for. One number, pulled from the whole matrix, tells you whether the transformation kept space intact and by how much it changed its size.

Forgetting the determinant is signed. A negative determinant is not an error. The magnitude is the area scaling; the negative sign means orientation flipped. A determinant of negative 1 is a reflection, not a shrink.

Thinking a determinant of zero means “small.” Zero is special, not small. It means total collapse: the transformation crushed the plane onto a line or point and is not invertible. There is no “almost zero is almost collapsed” middle ground in what zero itself signifies.

Mixing up the diagonals. The formula is the main diagonal minus the off-diagonal: multiply the two entries on the main diagonal, then subtract the product of the two off-diagonal entries, in that order, exactly as the formula display shows.

Reading the determinant as the whole story of a matrix. It tells you area or volume scaling and orientation, which is a lot, but it does not tell you the direction of the stretch or which way space got rotated. Two very different transformations can share a determinant. It is one powerful summary number, not a full description.

  • The determinant is the factor by which a transformation scales area (in 2D) or volume (in 3D), and it equals the area of the parallelogram the unit square becomes. Plot the columns, measure the parallelogram, read the scaling.
  • For a 2x2 matrix, the determinant is the main diagonal product minus the off-diagonal product, signed: the magnitude is the size scaling, and a negative sign means orientation flipped. A determinant of zero means the columns are dependent and space collapsed.
  • A zero determinant means not invertible. The transformation lost a dimension and cannot be run backward. A nonzero determinant means the transformation can be undone, which is exactly the question the next lesson takes up.

The determinant turns a whole matrix into one honest number: how much bigger, and which way up. When it hits zero, space has collapsed and a dimension is gone for good. The next lesson asks the follow-up that zero forces: when can a transformation be reversed, and what does it mean when it cannot?