Cofactor Matrix Calculator - Find All Cofactors Fast

Cofactor Matrix Calculator

Click any entry of A to watch its minor and sign turn into a cofactor.

Matrix size

Matrix A (3×3)

Decimals and negatives are fine. Empty cells count as 0.

Matrix of minors M

2
1
2
-2
-1
4
-4
-5
8

Each entry: delete its row and column, take the determinant of what remains.

Sign pattern (−1)ⁱ⁺ʲ

+
+
+
+
+

The checkerboard: + where i + j is even, − where it’s odd. Top-left is always +.

Cofactor matrix C

2
-1
2
2
-1
-4
-4
5
8

C is the matrix of minors with the checkerboard of signs applied — the answer.

Cofactor inspector

Click an entry of A below. Its row and column get struck out; what survives is the minor.

Delete row 1 and column 1 → remaining [[4, -1], [2, 0]]

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

Sign: (−1)² = +

C = +M = 2

Cofactor expansion of det(A)

det(A) = (2)(2) + (0)(-1) + (1)(2) = 6

Every row and every column gives the same determinant — switch lines above and watch the value stay put. Fastest choice here: Row 1 with 1 zero, so only 2 minors actually need computing.

det(A)

6

Cofactors computed

9

Is A invertible?

Yes

Bonus: adj(A) = Cᵀ

2
2
-4
-1
-1
5
2
-4
8

Transpose the cofactor matrix and you have the adjugate. Divide it by det(A) — when that isn't 0 — and you have the inverse.

How to Use This Calculator

  1. Pick the matrix size with the 2×2 / 3×3 buttons, then type your entries into the Matrix A grid — everything recalculates as you type.
  2. Read the three result cards: the matrix of minors, the checkerboard sign pattern, and the cofactor matrix C highlighted in green.
  3. In the “Cofactor inspector”, click any entry of A to strike out its row and column and see that entry’s minor, sign, and cofactor computed line by line.
  4. Use the “Expand along” dropdown to expand det(A) along any row or column — the zero counts next to each option tell you which line is least work by hand.
  5. Press “Load example” to cycle through presets, including a singular matrix and a zero-heavy one where picking the right row really pays off.
average • 0 ratings
Your rating
Tap a star to rate

Your rating helps improve Cofactor Matrix Calculator - Find All Cofactors Fast. We store only an anonymized vote (no personal data).

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

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

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:
Cofactor matrix calculator diagram showing a 3x3 matrix with a row and column crossed out to form each signed minor

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 MijCofactor Cij
RecipeDelete row i and column j, take the determinantThe minor times (−1)i+j
Can it flip sign?No — it is what the small determinant isYes — flipped wherever i + j is odd
Example, entry (1, 2) of A belowM₁₂ = 1C₁₂ = −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 lineZerosMinors to computeResult
Row 112(2)(2) + (0)(−1) + (1)(2) = 6
Row 203(3)(2) + (4)(−1) + (−1)(−4) = 6
Column 212(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.

Frequently Asked Questions

How do you find the cofactor of a matrix entry?

Delete the entry's row and column, take the determinant of what remains, then multiply by (-1)^(i+j) where i and j are the row and column numbers. For entry (1,2) of [[2,0,1],[3,4,-1],[1,2,0]], deleting row 1 and column 2 leaves [[3,-1],[1,0]] with determinant 1, and since 1+2=3 is odd the cofactor is -1. The sign step is the part most people forget.

What is the difference between a minor and a cofactor?

A minor is the plain determinant left after deleting one row and one column; a cofactor is that same minor multiplied by (-1)^(i+j). They agree wherever i+j is even and differ by a sign wherever it is odd — four of the nine positions in a 3x3 matrix. If your matrix of cofactors exactly equals your matrix of minors, you almost certainly skipped the checkerboard of signs.

What is the cofactor matrix of a 2x2 matrix?

For [[a,b],[c,d]] the cofactor matrix is [[d,-c],[-b,a]], because each minor is the diagonally opposite entry and the checkerboard negates the off-diagonal positions. Careful: this is not the inverse shortcut [[d,-b],[-c,a]] — that pattern is the adjugate, which is the cofactor matrix after transposing. For [[5,2],[3,4]] the cofactor matrix is [[4,-3],[-2,5]].

Is the cofactor matrix the same as the adjugate matrix?

No — the adjugate is the transpose of the cofactor matrix, so the two agree on the diagonal but swap every off-diagonal pair. For [[2,0,1],[3,4,-1],[1,2,0]] the cofactor matrix is [[2,-1,2],[2,-1,-4],[-4,5,8]] while the adjugate is [[2,2,-4],[-1,-1,5],[2,-4,8]]. Mixing them up is the most common wrong answer on this topic, because only the adjugate divided by the determinant gives the inverse.

Why do cofactor signs follow a checkerboard pattern?

Because moving entry (i,j) to the top-left corner takes (i-1) row swaps plus (j-1) column swaps, and each swap flips the determinant's sign, giving (-1)^(i+j) overall. The pattern always starts with + in the top-left corner, every corner of an odd-sized matrix is +, and the center of a 3x3 is +. Starting the checkerboard with a minus sign negates the entire cofactor matrix.

Which row or column should I use for cofactor expansion?

Use the row or column with the most zeros — every zero entry kills its whole term, so that is one minor you never compute. Expanding a 3x3 along a row with one zero needs 2 small determinants instead of 3, and in a 4x4 each skipped cofactor saves an entire 3x3 determinant of 12 multiplications. Every row and column gives the same determinant, so the choice only changes the effort, never the answer.

How can I check my cofactor matrix is correct?

Expand the determinant along two different lines — say row 1 and column 2 — and confirm both sums agree, which tests most of the cofactors at once. Then dot one row of the original matrix with the cofactors of a different row: the result must be exactly 0. For [[2,0,1],[3,4,-1],[1,2,0]], row 1 against the cofactors of row 2 gives (2)(2)+(0)(-1)+(1)(-4)=0. A nonzero result pinpoints which row of cofactors to recheck.