Free Cofactor Matrix Calculator

[
]

Enter matrix values to see the cofactor matrix

What Is the Cofactor Matrix?

For any square matrix AA, the cofactor matrix (often called the matrix of cofactors) is obtained by replacing every element aija_{ij} with its corresponding cofactor CijC_{ij}. This tool automates the entire process, letting you instantly compute the cofactor matrix for dimensions 2×22 \times 2, 3×33 \times 3, or larger — all you need are the original entries.

Two building blocks underpin every cofactor: the minor and the sign factor. The minor MijM_{ij} is the determinant of the submatrix that remains after removing the ii-th row and jj-th column of AA. Multiplying that minor by the sign factor (−1)i+j(-1)^{i+j} gives the cofactor:

Cij=(−1)i+j MijC_{ij} = (-1)^{i+j} \, M_{ij}

The sign factor creates a checkerboard pattern that starts with “+” in the top‑left cell and alternates along each row and column. Thanks to this pattern you can quickly determine the sign needed for any position without re‑computing (−1)i+j(-1)^{i+j} each time.

How to Find the Cofactor Matrix by Hand

Finding the cofactor matrix manually follows a repetitive but clear routine:

  1. Choose the row index ii and column index jj of the target element.
  2. Strike out the ii-th row and jj-th column of AA to obtain a smaller square submatrix.
  3. Calculate the determinant of this submatrix — this is the minor MijM_{ij}.
  4. Apply the sign factor (−1)i+j(-1)^{i+j} to convert the minor into the cofactor CijC_{ij}.
  5. Place CijC_{ij} into the cofactor matrix at position (i,j)(i,j).
  6. Repeat steps 1–5 for every pair (i,j)(i,j) from 11 to nn.

The resulting array is the full matrix of cofactors. Below we illustrate this for the two most common sizes.

Cofactor of a 2×2 Matrix

Consider a 2×22 \times 2 matrix:

A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}

Applying the steps yields the following cofactors:

  • C11=dC_{11} = d (since (−1)1+1=+1(-1)^{1+1}=+1 and the minor after deleting row 1, col 1 is dd)
  • C12=−cC_{12} = -c
  • C21=−bC_{21} = -b
  • C22=aC_{22} = a

Thus the complete cofactor of a 2×2 matrix is:

cofactor(A)=[d−c−ba]\text{cofactor}(A) = \begin{bmatrix} d & -c \\ -b & a \end{bmatrix}

This compact result is one of the quickest ways to obtain the cofactor matrix for a 2×22 \times 2 system.

Cofactor of a 3×3 Matrix

For a 3×33 \times 3 matrix the same principle applies, but the minors are now 2×22 \times 2 determinants. For example, to find the cofactor of entry a11a_{11}:

  • Delete row 1 and column 1 → the remaining submatrix is [efhi]\begin{bmatrix} e & f \\ h & i \end{bmatrix} (using standard labelling).
  • Its determinant is ei−fhei - fh.
  • Multiply by sign factor (+1)(+1) → C11=ei−fhC_{11} = ei - fh.

Each of the nine positions requires a similar calculation. A cofactor of a 3×3 matrix therefore involves nine individual 2×22 \times 2 determinants, which is precisely where an automated calculator saves enormous effort.

How to Use This Cofactor Matrix Calculator

The tool is designed for speed and convenience:

  1. Select the size of your matrix (2×22 \times 2, 3×33 \times 3, etc.).
  2. Enter every coefficient into the corresponding cell.
  3. The calculator instantly displays the full matrix of cofactors at the bottom.

There is no need to manually track signs or compute multiple determinants — the underlying cofactor formula is implemented for you.

Relationship to the Adjugate Matrix

The adjugate (or adjoint) matrix is simply the transpose of the cofactor matrix. If you need the adjugate, you can obtain it by taking the cofactor matrix and swapping rows for columns. This makes the adjugate matrix calculator a natural companion to the cofactor tool.

Using the Cofactor Matrix to Invert a Matrix

The cofactor matrix plays a central role in matrix inversion. The inverse of a nonsingular square matrix AA is given by:

A−1=1det⁡(A) (cofactor(A)) ⁣TA^{-1} = \frac{1}{\det(A)} \, \bigl(\text{cofactor}(A)\bigr)^{\!T}

where (cofactor(A))T\bigl(\text{cofactor}(A)\bigr)^{T} is the adjugate matrix. In practice the steps are:

  1. Compute the cofactor matrix of AA.
  2. Transpose it to get the adjugate.
  3. Calculate the determinant of AA.
  4. Multiply the adjugate by 1/det⁡(A)1/\det(A).

This “cofactor method” is a classic technique that works for any invertible square matrix, and the cofactor matrix calculator makes step 1 effortless.

FAQ

1. How do I find the cofactor matrix of a 2x2 matrix?

For a 2x2 matrix [[a,b],[c,d]], the cofactor matrix is [[d, -c],[-b, a]]. Simply swap the diagonal entries, then put a minus sign on the off-diagonal elements.

2. What is the difference between a minor and a cofactor?

A minor is the determinant of the submatrix left after deleting one row and one column. A cofactor is that minor multiplied by the sign factor (-1)^(i+j).

3. Can I use this calculator to get the adjugate matrix?

Yes. After computing the cofactor matrix, take its transpose — that transpose is exactly the adjugate (adjoint) matrix.

4. Is the cofactor method for finding an inverse always reliable?

It works for any square matrix with a nonzero determinant. Once you have the cofactor matrix, the inverse is (1/det(A)) × transpose(cofactor).

How to Use

  1. Select the matrix size (2×2 or 3×3) from the dropdown.
  2. Enter the values of your matrix into the input grid. Use decimal numbers or integers.
  3. The cofactor matrix and determinant appear instantly as you type.