Category

Cofactor Matrix Calculator — Find the Matrix of Cofactors, Minors and Adjugate

Find the cofactor matrix of any 2×2, 3×3, or 4×4 square matrix. See the checkerboard sign pattern, every first minor, and a step-by-step breakdown of each cofactor Cij = (−1)^(i+j)·Mij, plus the adjugate, the determinant by cofactor expansion, and the inverse via the cofactor method. Supports metric, US imperial, and 20 world currencies including USD and Russian Ruble.

0 calculations

Calculation Parameters

Decimals and negative numbers are allowed.

Enter Parameters

Fill in the form on the left and click "Calculate"

Cofactor Matrix Calculator

Welcome to the cofactor matrix calculator! Don't hesitate to make use of it whenever you need to find the matrix of cofactors of a given square matrix. If you want to learn how we define the cofactor matrix, or you're looking for step-by-step instructions on how to find the cofactor matrix, look no further! Scroll down to find an article where we tell you how to quickly and easily compute the cofactor 2×2 matrix and reveal the secret of finding the inverse matrix using the cofactor method.

This calculator handles any square matrix from 2×2 up to 4×4. It shows you every first minor, every sign factor, and every cofactor — one step at a time — plus the adjugate matrix, the determinant computed by cofactor expansion, and optionally the full inverse.

How do we define the cofactor matrix?

The cofactor matrix of a given square matrix consists of first minors multiplied by sign factors:

  • The first minor is the determinant of the matrix cut down from the original matrix by deleting one row and one column.
  • The sign factor is −1 if the index of the row we removed plus the index of the column we removed is equal to an odd number; otherwise, the sign factor is 1.

More formally, let A be a square matrix of size n × n. Consider i, j = 1, ..., n.

  • The (i, j)-minor Mij is the determinant of the (n−1) × (n−1) submatrix of A formed by removing the i-th row and the j-th column.
  • The sign factor is (−1)i+j.

Multiplying the minor by the sign factor, we obtain the (i, j)-cofactor:

Cij = (−1)i+j · Mij

Putting all the individual cofactors into a matrix results in the cofactor matrix, written cof(A). Don't worry if you feel a bit overwhelmed by all this theory — in the next section we turn it into step-by-step instructions.

Sign factor pattern

Formally, the sign factor is defined as (−1)i+j, where i and j are the row and column index (respectively) of the element we are currently considering. In fact, the signs we obtain in this way form a nice alternating pattern, which makes the sign factor easy to remember:

⎡ +  −  +  − ⎤
⎢ −  +  −  + ⎥
⎢ +  −  +  − ⎥
⎣ −  +  −  + ⎦

As you can see, the pattern begins with a + in the top left corner of the matrix and then alternates −/+ throughout the first row. The second row begins with a and then alternates +/−, and so on. It works like a checkerboard.

How to find the cofactor matrix

Suppose A is an n × n matrix with real entries. To find the cofactor matrix of A, follow these steps:

  1. Cross out the i-th row and the j-th column of A. You obtain a (n−1) × (n−1) submatrix of A.
  2. Compute the determinant of this submatrix. You have found the (i, j)-minor of A.
  3. Determine the sign factor (−1)i+j.
  4. Multiply the (i, j)-minor of A by the sign factor. The result is exactly the (i, j)-cofactor of A!
  5. Repeat steps 1–4 for all i, j = 1, ..., n.

👉 If you ever need to calculate the adjugate (aka adjoint) matrix, remember that it is just the transpose of the cofactor matrix of A: adj(A) = cof(A)T. This calculator shows it to you automatically.

Cofactor matrix 2×2

As an example, let's discuss how to find the cofactor matrix of a 2×2 matrix:

A = ⎡ a  b ⎤
    ⎣ c  d ⎦

Here each submatrix is a single number, so each minor is trivial to compute:

  • Delete row 1 and column 1 → what's left is d, so M11 = d. The sign factor is (−1)1+1 = +1, so C11 = d.
  • Delete row 1 and column 2 → what's left is c, so M12 = c. The sign factor is (−1)1+2 = −1, so C12 = −c.
  • Delete row 2 and column 1 → what's left is b, so M21 = b. The sign factor is (−1)2+1 = −1, so C21 = −b.
  • Delete row 2 and column 2 → what's left is a, so M22 = a. The sign factor is (−1)2+2 = +1, so C22 = a.

Collecting the four cofactors gives a neat formula worth memorizing:

cof(A) = ⎡  d  −c ⎤
         ⎣ −b   a ⎦

In other words: swap a and d, then flip the signs of b and c (and mind that b and c also swap places when you transpose to get the adjugate).

How to use this cofactor matrix calculator

  1. Pick the matrix size — 2×2, 3×3, or 4×4. Only square matrices have cofactor matrices.
  2. Choose a unit context (optional). Cofactors are pure numbers, but if your matrix entries came from measurements you can label them as metric or US customary, or as money in any of 20 world currencies including the US dollar and the Russian ruble. The label is carried through to your results and printout.
  3. Enter the matrix entries. Decimals and negative numbers are both fine.
  4. Tick "Compute the inverse" if you also want A−1 via the cofactor method.
  5. Read the results: the sign factor pattern, the matrix of minors, the cofactor matrix, the adjugate, a step-by-step breakdown of every single cofactor, and the determinant recovered by cofactor expansion along the first row.

Finding the inverse matrix using the cofactor method

The cofactor matrix is the engine behind one of the classic ways to invert a matrix. The recipe is:

A−1 = adj(A) / det(A) = cof(A)T / det(A)

So the full procedure is:

  1. Compute the cofactor matrix cof(A) as described above.
  2. Transpose it to get the adjugate adj(A).
  3. Compute the determinant. Handily, you already have everything you need: expand along the first row using the cofactors you just found, det(A) = a11C11 + a12C12 + ... + a1nC1n.
  4. Divide every entry of the adjugate by det(A).

⚠️ This only works when det(A) ≠ 0. If the determinant is zero the matrix is singular and has no inverse — the cofactor matrix and the adjugate still exist, but you cannot divide by zero.

FAQs

What is the cofactor matrix of a 2×2 matrix?

For A = [a b; c d], the cofactor matrix is [d −c; −b a]. Each minor is a single leftover entry, and the checkerboard sign pattern [+ −; − +] flips the signs of the off-diagonal cofactors.

What is the difference between a minor and a cofactor?

A minor Mij is just the determinant of the submatrix you get after deleting row i and column j. A cofactor Cij is that same minor multiplied by the sign factor (−1)i+j. So cofactors and minors are equal whenever i + j is even, and opposite in sign whenever i + j is odd.

Is the cofactor matrix the same as the adjugate?

No, but they're one transpose apart. The adjugate (or adjoint) is the transpose of the cofactor matrix: adj(A) = cof(A)T. For symmetric matrices the two happen to coincide.

Can a non-square matrix have a cofactor matrix?

No. Minors are determinants, and determinants only exist for square matrices. That's why this calculator only accepts 2×2, 3×3, and 4×4 inputs.

How many cofactors does an n×n matrix have?

Exactly — one for every entry. A 3×3 matrix has 9 cofactors (each a 2×2 determinant), and a 4×4 matrix has 16 cofactors (each a 3×3 determinant). That's why doing this by hand gets tedious fast.

What if the determinant is zero?

The cofactor matrix and adjugate still exist and are perfectly well defined — only the inverse doesn't. A zero determinant means the matrix is singular: its rows (and columns) are linearly dependent, and it cannot be inverted.

Calculation History

Loading...