How this instrument works
Every entry in a matrix carries its own signed minor, and stacking those signed minors in place — without transposing anything — is the cofactor matrix. For A = [[a, b], [c, d]], deleting row i and column j leaves a single surviving number, the minor Mᵢⱼ; multiply it by (−1)^(i+j) and you have the cofactor Cᵢⱼ. Lay all four out where they started and the result is [[C₁₁, C₁₂], [C₂₁, C₂₂]] = [[d, −c], [−b, a]] — the raw cofactor matrix, not yet transposed into the adjugate.
The alternating signs are not decoration; they come straight from the checkerboard pattern (−1)^(i+j), which is +1 on the main diagonal and −1 just off it for any square matrix. A 2×2 case is the simplest possible illustration, because each minor collapses to one entry instead of a smaller determinant — delete row 1 and column 1 from [[a, b], [c, d]] and only d is left, so M₁₁ = d and, since 1+1 is even, C₁₁ = +d. Delete row 1 and column 2 instead and c remains, but 1+2 is odd, so C₁₂ flips to −c.
One consequence surprises people who only ever treat this matrix as a stepping stone toward an inverse: the cofactors also rebuild the determinant itself. Multiply each entry of any row of A by its own cofactor and add — a·C₁₁ + b·C₁₂ for row 1 — and the sum is det(A), a rule called Laplace expansion. The cofactor matrix exists even when det(A) is zero and A has no inverse at all; the numbers stay perfectly well defined, they simply sum, row by row, to zero instead of to something usable as a divisor.
- Fill in the matrix's top row: a for (row 1, col 1), b for (row 1, col 2).
- Fill in the bottom row: c for (row 2, col 1), d for (row 2, col 2).
- Read Cofactor C₁₁ (= d) and Cofactor C₁₂ (= −c) across the top of the result grid.
- Read Cofactor C₂₁ (= −b) and Cofactor C₂₂ (= a) across the bottom of the result grid.
- Transpose these four cofactors yourself only if the adjugate matrix is what you actually need, not this one.
Worked example — cofactors of [[1, 2], [3, 4]]
Picture the matrix A = [[1, 2], [3, 4]], where the top row holds a = 1 next to b = 2, while the bottom row holds c = 3 next to d = 4. Delete row 1 and column 1 and only the 4 survives, so M₁₁ = 4; since 1+1 is even, C₁₁ = +4. Delete row 1 and column 2 and the 3 survives, with 1+2 odd, so C₁₂ = −3. Delete row 2 and column 1 and the 2 survives, 2+1 odd, so C₂₁ = −2. Delete row 2 and column 2 and the 1 survives, 2+2 even, so C₂₂ = +1. Stacked back in their original positions, the cofactors form [[4, −3], [−2, 1]].
Check it against Laplace expansion along row 1: a·C₁₁ + b·C₁₂ = 1×4 + 2×(−3) = 4 − 6 = −2, exactly ad − bc = 1×4 − 2×3 = −2, the determinant of the original matrix. Notice what happens if this table gets transposed rather than read as it stands: the −3 sitting at C₁₂ and the −2 sitting at C₂₁ trade corners, becoming [[4, −2], [−3, 1]] — the adjugate matrix, a different object from the cofactor matrix computed here.
Questions
What is a cofactor in a matrix?
A cofactor Cᵢⱼ is the minor Mᵢⱼ — the value left after deleting row i and column j — multiplied by (−1)^(i+j). For a 2×2 matrix each minor is just the single entry that survives the deletion, so C₁₁ = +d, C₁₂ = −c, C₂₁ = −b, and C₂₂ = +a; larger matrices need a full sub-determinant for each minor instead of one lone number.
What's the difference between the cofactor matrix and the adjugate matrix?
The cofactor matrix is the raw grid of Cᵢⱼ values in their original positions; the adjugate (sometimes called the adjoint) is that same grid transposed. For a 2×2 matrix the diagonal entries never move, but the two off-diagonal cofactors swap corners — C₁₂ and C₂₁ trade places — so [[d, −c], [−b, a]] becomes [[d, −b], [−c, a]] once you transpose it into an adjugate.
How do you find the minor of a matrix entry?
Delete the row and column that entry sits in, then take the determinant of whatever remains. In a 2×2 matrix that deletion always leaves a single number, so the determinant of a 1×1 remainder is just that number itself; in a 3×3 or larger matrix, the minor is the determinant of the smaller square block left behind.
Why does the sign alternate between cofactors?
Because each cofactor carries a factor of (−1)^(i+j), producing a checkerboard of + and − signs starting with + in the top-left corner. Position (1,1) and (2,2) get +1 since their index sums are even; positions (1,2) and (2,1) get −1 since 1+2 and 2+1 are odd. Larger matrices continue the same way, alternating sign with every step across a row or down a column.
What mistake do people usually make computing a cofactor matrix by hand?
Two mistakes recur: dropping the sign entirely and reporting raw minors instead of signed cofactors, and transposing the result when the question actually asked for the cofactor matrix rather than the adjugate. A fast check is Laplace expansion — a·C₁₁ + b·C₁₂ should reproduce det(A) exactly; if it doesn't, a sign or a position slipped somewhere.
How does the cofactor matrix connect to computing a determinant?
Multiply each entry along any row (or column) of A by its matching cofactor and add the results — that sum is det(A), a rule known as Laplace or cofactor expansion. For [[1, 2], [3, 4]], row 1 gives 1×4 + 2×(−3) = −2, matching ad − bc exactly, so the cofactor matrix is not just a stepping stone toward the adjugate — it is also a valid way to compute the determinant itself.