This calculator works out the cofactor matrix of any 2x2 or 3x3 matrix, one of the core building blocks of linear algebra behind matrix inversion, determinant expansion and Cramer's rule. Select whether you are working with a 2x2 or 3x3 matrix, then type your values into the on-screen grid; default matrices are already filled in so you can see how it works before entering your own numbers. As soon as you change a value, the calculator recalculates and returns the complete cofactor matrix C, laid out in the same shape as your original matrix. Below that sits a step-by-step breakdown for every position, showing the minor determinant M[i][j], the checkerboard sign factor (-1)^(i+j), and how the two combine to give each cofactor. A results panel also reports the determinant of your matrix and whether it is invertible, since the adjugate, the transpose of the cofactor matrix, is what you divide by the determinant to find the inverse. A sign-pattern chart shows the plus and minus layout for both sizes so you can check your working by eye. Use this tool to check homework, verify hand calculations, or see how cofactor expansion feeds into determinants and inverses. Results use exact integer arithmetic where your inputs are whole numbers; for matrices larger than 3x3 or heavy decimal work, dedicated numerical software is a better fit.
The checkerboard sign pattern (-1)^(i+j) applied to each minor:
2x2 pattern
3x3 pattern
The cofactor matrix (also called the matrix of cofactors) is a square matrix formed by computing the cofactor of every element of the original matrix. The cofactor C[i][j] at position (i, j) combines two pieces of information: the minor M[i][j] (a smaller determinant) and a sign determined by the position.
The formula is: C[i][j] = (-1)^(i+j) × M[i][j]
The minor M[i][j] is the determinant of the submatrix formed by deleting row i and column j from the original matrix. The sign factor (-1)^(i+j) creates the familiar checkerboard pattern of plus and minus signs.
For a 3x3 matrix A with elements a[i][j] (using 0-based indexing):
For the default matrix A:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | 1 | 2 | 3 |
| Row 2 | 4 | 5 | 6 |
| Row 3 | 7 | 8 | 9 |
Computing each cofactor:
The cofactor matrix is:
| Col 1 | Col 2 | Col 3 | |
|---|---|---|---|
| Row 1 | -3 | 6 | -3 |
| Row 2 | 6 | -12 | 6 |
| Row 3 | -3 | 6 | -3 |
Note: the determinant of this matrix is 0 (the rows are linearly dependent), which is why the cofactor matrix above has a consistent pattern. This matrix has det(A) = 0.
The cofactor matrix is used in several important linear algebra operations:
Method: Standard cofactor formula from linear algebra: C[i][j] = (-1)^(i+j) × M[i][j], where M[i][j] is the (i,j) minor determinant. See: Anton, H. & Rorres, C., Elementary Linear Algebra, Wiley; Lay, D.C., Linear Algebra and Its Applications, Pearson.
This calculator computes cofactor matrices for 2x2 and 3x3 matrices. Results use exact integer arithmetic where inputs are integers. For larger matrices or floating-point applications, dedicated numerical software is recommended.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.