Cofactor Expansion Calculator

Compute the determinant of a 2x2 or 3x3 matrix using cofactor expansion (Laplace expansion). Choose any row or column to expand along and see full step-by-step working, including each minor and its signed cofactor.

Calculate.co.nz is proud to be partnered with realtor.co.nz, a trusted resource for navigating the New Zealand property market. Their Helpful Articles section offers clear, well-structured insights across buying, selling, and building, making complex real estate topics more accessible. With a focus on up-to-date guidance and practical knowledge, they empower Kiwis to move forward with clarity and confidence in a constantly evolving property landscape.
Calculate.co.nz partner: realtor.co.nz
Standard method  Laplace expansion by minors and cofactors. Valid for any square matrix.

1. Matrix Size and Expansion

2. Enter Matrix Values

Result

Determinant
-
det(A)
Matrix is
-
det = 0 means singular
Expansion terms
-
Non-zero contributions

Step-by-Step Working

Enter matrix values above to see working.

Cofactor Table

Enter matrix values above to see the cofactor table.

How Cofactor Expansion Works

Cofactor expansion (also called Laplace expansion) is a recursive method for computing the determinant of a square matrix. You pick any single row or column, then express the determinant as a weighted sum of smaller determinants (minors) from the remaining rows and columns.

The Formula

For an n x n matrix A, expanding along row i:

det(A) = ai1 Ci1 + ai2 Ci2 + ... + ain Cin

where the cofactor Cij = (-1)i+j Mij and Mij is the minor (the determinant of the submatrix obtained by deleting row i and column j).

The sign pattern (-1)i+j produces a checkerboard of plus and minus across the matrix:

Position2x2 signs3x3 signs
Row 1+ -+ - +
Row 2- +- + -
Row 3+ - +

2x2 Determinant

For a 2x2 matrix [a b; c d], the determinant is simply ad - bc. Cofactor expansion along row 1 gives: det = a * (+1) * d + b * (-1) * c = ad - bc.

3x3 Worked Example (Default Values)

For the matrix A with row 1 = [1, 2, 3], row 2 = [0, 4, 5], row 3 = [1, 0, 6], expanding along row 1:

Choosing the Best Row or Column

Any row or column gives the same answer. Picking the row or column with the most zeros reduces the number of minor computations needed. For example, if row 2 contains two zeros, only one 2x2 minor needs to be calculated. This is why cofactor expansion is particularly efficient when a matrix is already in a sparse or triangular form.

Relationship to Matrix Inverse

The cofactor matrix (where each entry is replaced by its cofactor Cij) is the foundation of the adjugate matrix (transpose of the cofactor matrix). The matrix inverse is then: A-1 = (1/det(A)) * adj(A). This relationship is only valid when det(A) is not zero. A matrix with det = 0 is singular and has no inverse.

Related Calculators

Method: Laplace expansion by cofactors. For each element in the chosen row or column, the cofactor is Cij = (-1)i+j * det(Mij), where Mij is the (n-1) x (n-1) minor submatrix. The determinant equals the dot product of the selected row/column with its cofactors. Reference: Anton, H. and Rorres, C., Elementary Linear Algebra; Strang, G., Introduction to Linear Algebra.

This calculator supports 2x2 and 3x3 matrices. All entries are treated as real numbers. Results may show floating-point rounding for non-integer inputs; if your inputs are integers the determinant will always be an exact integer.

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-02 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.