Cofactor Matrix Calculator: Minors, Signs, and the Checkerboard Rule
About the Author

Every cofactor is a small determinant wearing a sign, and a cofactor matrix calculator exists because computing nine of them for a 3×3 matrix without dropping a single sign is harder than any one of the nine. The arithmetic is trivial — 2×2 determinants, nothing more. The bookkeeping is where marks die: which row gets deleted, which sign applies at position (2, 3), whether that minus was already used.
The tool above handles a 2×2 or 3×3 matrix and shows the whole construction: minors, the checkerboard sign pattern, the finished matrix of cofactors, and a determinant expansion along whichever row or column you choose. Click any entry and it strikes out that entry’s row and column so you can see exactly which four numbers form the minor. This article covers what the tool assumes you’ll eventually need to do alone: telling minors and cofactors apart, understanding where the sign pattern comes from, building a full 3×3 cofactor matrix, and choosing the expansion line that saves you a third of the work.
Minor or Cofactor? The Sign Is the Entire Difference
The two words get swapped constantly, and the swap is exactly where wrong answers start. The minor Mij of an entry is the determinant of what’s left after you delete row i and column j — always an unsigned recipe, in the sense that no extra factor is attached. The cofactor is that same minor multiplied by (−1)i+j: Cij = (−1)i+j·Mij. Same deletion, same small determinant, one extra decision.
| Minor Mij | Cofactor Cij | |
|---|---|---|
| Recipe | Delete row i and column j, take the determinant | The minor times (−1)i+j |
| Can it flip sign? | No — it is what the small determinant is | Yes — flipped wherever i + j is odd |
| Example, entry (1, 2) of A below | M₁₂ = 1 | C₁₂ = −1 |
Half the positions in a 2×2, and four of the nine in a 3×3, have odd i + j — so minors and cofactors disagree at nearly half the entries. Any “matrix of cofactors” that exactly matches the matrix of minors is almost certainly a matrix of minors with the signs forgotten. You’ll also see the finished object called the comatrix in older French-influenced texts; same thing, same checkerboard.
The Checkerboard Isn’t Arbitrary
Most students memorize the sign pattern. Few are told why it’s there, which is a shame, because the reason is one sentence long: moving entry (i, j) to the top-left corner of the matrix takes (i − 1) row swaps plus (j − 1) column swaps, and every swap flips the sign of a determinant. Total flips: i + j − 2, which has the same parity as i + j. Hence (−1)i+j — not a convention someone chose, but a count of swaps.
2×2
+ −
− +
3×3
+ − +
− + −
+ − +
4×4
+ − + −
− + − +
+ − + −
− + − +
Three facts fall out of the parity rule for free. Every corner of an odd-sized matrix is +. The center of a 3×3 is + (i + j = 4, even). And the pattern always starts with + at the top-left — starting it with − is the classic memorization slip, and it negates the entire cofactor matrix, which then poisons the determinant, the adjugate, and the inverse downstream.
A 3×3 Example, Worked the Way the Cofactor Matrix Calculator Shows It
Take the calculator’s default matrix:
A = [[2, 0, 1], [3, 4, −1], [1, 2, 0]]
Three entries show every situation you’ll meet. For C₁₁, delete row 1 and column 1, leaving [[4, −1], [2, 0]]. The minor is (4)(0) − (−1)(2) = 2, the sign at (1, 1) is + since 1 + 1 = 2 is even, so C₁₁ = 2. For C₁₂, delete row 1 and column 2, leaving [[3, −1], [1, 0]]. The minor is (3)(0) − (−1)(1) = 1 — but now i + j = 3 is odd, so C₁₂ = −1. That subtraction inside the minor is worth a second look, by the way: subtracting the product (−1)(1) means adding 1, a double negative that catches more people than the checkerboard does.
One more, from the interior: C₂₃. Delete row 2 and column 3, leaving [[2, 0], [1, 2]], whose determinant is (2)(2) − (0)(1) = 4. The position (2, 3) has i + j = 5, odd, so C₂₃ = −4. Six more entries of the same kind give the complete pair:
Minors: M = [[2, 1, 2], [−2, −1, 4], [−4, −5, 8]]
Cofactors: C = [[2, −1, 2], [2, −1, −4], [−4, 5, 8]]
Read the two matrices against the checkerboard: entries (1, 1), (1, 3), (2, 2), (3, 1), (3, 3) match, the other four flipped. This is precisely the working the calculator’s inspector panel prints when you click an entry — the point of doing it by hand once is knowing what each printed line means.
Count the Zeros Before You Expand
The main job cofactors do is computing determinants. Laplace expansion says the determinant equals the sum of entry-times-cofactor along any single row or column — your choice. And since a zero entry kills its whole term, the smart move is decided before any arithmetic starts: count the zeros in each line and expand along the line with the most. Every zero is one entire minor you never compute.
| Expansion line | Zeros | Minors to compute | Result |
|---|---|---|---|
| Row 1 | 1 | 2 | (2)(2) + (0)(−1) + (1)(2) = 6 |
| Row 2 | 0 | 3 | (3)(2) + (4)(−1) + (−1)(−4) = 6 |
| Column 2 | 1 | 2 | (0)(−1) + (4)(−1) + (2)(5) = 6 |
Same determinant three ways — that’s the theorem doing its job — but row 2 cost 50% more minors than row 1. The stakes grow fast with size. Expanding a 4×4 means four cofactors, each one a full 3×3 determinant of 12 multiplications; a row with two zeros cuts the work in half before you’ve touched a pencil. This is also why exam matrices come salted with zeros: the question is quietly testing whether you look before you expand. The calculator’s dropdown lists the zero count next to every line for exactly that reason.
From Cofactor Matrix to Adjugate to Inverse
Past determinants, the cofactor matrix is a waypoint on the road to two bigger results. Transpose C and you get the adjugate, adj(A) = Cᵀ — for the worked example above, adj(A) = [[2, 2, −4], [−1, −1, 5], [2, −4, 8]]. Divide that by det(A) = 6 and you have the inverse: A⁻¹ = Cᵀ/det(A), the classical adjoint formula. The same cofactors also power Cramer’s rule for solving linear systems determinant by determinant. The full story of the adjugate — its identities, the singular case, why the transpose is there at all — lives on our adjugate matrix calculator page; the thing to hold onto here is the order of operations. Cofactors first. Transpose second. Divide last.
Why the 2×2 Case Feels Backwards
Cofactors of a 2×2 matrix confuse people because they’re easy. Delete one row and one column of a 2×2 and a single number survives — each minor is just the diagonally opposite entry, no determinant to evaluate. Apply the checkerboard and:
C of [[a, b], [c, d]] = [[d, −c], [−b, a]]
Note carefully what that is not: it is not [[d, −b], [−c, a]], the famous 2×2 inverse shortcut. That shortcut is the adjugate — the cofactor matrix after transposing. With A = [[5, 2], [3, 4]], the cofactor matrix is [[4, −3], [−2, 5]] while the adjugate is [[4, −2], [−3, 5]]. Off by a transpose, and only the second one satisfies A·adj(A) = det(A)·I = 14·I. If a homework answer asks for the matrix of cofactors and you reach for the swap-and-negate pattern from memory, you’ll hand in the transposed matrix — arguably the most common wrong answer this topic produces.
Two Thirty-Second Checks Before You Move On
Check one: expand twice. Compute the determinant along one row, then along one column. The two sums use mostly different cofactors, so a sign slip in either set makes them disagree. In the worked example, row 1 gave 6 and column 2 gave 6 — six of the nine cofactors verified in one line of arithmetic.
Check two: mix rows. Dot a row of A with the cofactors of a different row and you must get exactly 0 — this is the alien cofactor expansion, and it works because the sum you’re forming is secretly the determinant of a matrix with a repeated row. Try it above: row 1 of A against the cofactors of row 2 gives (2)(2) + (0)(−1) + (1)(−4) = 0. If a “check” like this comes out nonzero, one of the cofactors in that row is wrong, and you know which three to recheck — far better than recomputing all nine. Between the two tests, every entry of the cofactor matrix gets touched at least once, which is as close to certainty as hand computation offers.



