Matrix Calculator
Find the determinant, trace and inverse of a 2 × 2 or 3 × 3 matrix, with a check that the matrix times its inverse gives the identity.
Try your own numbers
Estimate only. Not engineering or safety advice. Check the result against the applicable standard and the equipment data, and have a competent engineer review it before it is relied on. Terms of use.
Open in the calculator with these values
About this calculator
This page calculates determinant, trace, inverse, row 1 column 1 and 9 more results from matrix size, row 1, column 1, row 1, column 2, row 1, column 3 and 6 more inputs. Change any value or its unit and the result updates. The steps below show the working for the default values, so you can check each line against your own method.
Limits of this calculator
Use this to invert the impedance or admittance matrix of a small network, to check a hand-calculated determinant, or to solve mesh equations written in matrix form. To solve A x = k for the unknowns directly, use the simultaneous equations solver. Always check the inverse against the original matrix.
Cross-check: 36 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review.
Verification status: Engineering reference
Engineering reference. Formula and method documented and tested against separately coded reference calculations. Not yet Verified: the evidence listed on this page is still needed.
What this calculator checks
- The arithmetic of the published formula for the values you entered, in the units shown.
What remains unverified
- That the inputs suit your application. Take ratings, resistances and constants from the manufacturer data sheet or project specification.
Verification register entry
| Calculation author | Rahul Sharma (author) |
|---|---|
| Technical review | No independent technical review has been carried out |
| Individual professional approval | Not recorded |
| Formula reference | not recorded |
| Standard and edition | Not applicable: Pure mathematics or statistics; no electrical standard governs the method |
| Standard review state | Not applicable |
| Scope-screening note | not recorded |
| Cross-check test cases | 36 reference vectors (tests/reference_vectors.json) |
| Review date | not recorded |
| Next review date | not recorded |
| Status | Engineering reference |
Needed before this calculator can be marked Verified: reviewer name, qualification and review date; exact formula reference; formula source (textbook or standard); next review date.
Formula
Worked example
| Input | Value |
|---|---|
| Matrix size | 2 × 2 |
| Row 1, column 1 | 4 |
| Row 1, column 2 | 7 |
| Row 2, column 1 | 2 |
| Row 2, column 2 | 6 |
- Matrix, row by row: 4 7 | 2 6
- det = ad − bc = 4 × 6 − 7 × 2 = 10
- Trace = 10
- Inverse, row by row: 0.6 -0.7 | -0.2 0.4
- Check: the largest difference between A × A⁻¹ and the identity is 2.220e-16
Assumptions
- The matrix is square, 2 × 2 or 3 × 3, with real entries; for a 2 × 2 matrix the third row and column are ignored
- The determinant must not be zero. If it is, the rows are dependent and the matrix has no inverse
- The inverse is found by elimination with row swapping, which keeps its accuracy when an entry is small, and is checked by multiplying it back against the original
- When the determinant is very small compared with the size of the entries the matrix is close to singular, so a small change in an entry changes the inverse a lot; a warning is shown
- The inverse entries for a third row and column are a dash for a 2 × 2 matrix
Use this to invert the impedance or admittance matrix of a small network, to check a hand-calculated determinant, or to solve mesh equations written in matrix form. To solve A x = k for the unknowns directly, use the simultaneous equations solver. Always check the inverse against the original matrix.
Inputs and results
| Input | Unit | Allowed or shown | Note |
|---|---|---|---|
| Matrix size | (choice) | 2 × 2; 3 × 3 | |
| Row 1, column 1 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | Enter the matrix row by row. For a 2 × 2 matrix leave the third row and third column blank. |
| Row 1, column 2 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Row 1, column 3 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank | |
| Row 2, column 1 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Row 2, column 2 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Row 2, column 3 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank | |
| Row 3, column 1 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank | |
| Row 3, column 2 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank | |
| Row 3, column 3 | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000; may be left blank |
| Result | Unit | Allowed or shown | Note |
|---|---|---|---|
| Determinant | (number) | Shown to 10 decimal places | |
| Trace (sum of the diagonal) | (number) | Shown to 10 decimal places | |
| Inverse, row 1 column 1 | (number) | Shown to 10 decimal places | |
| Inverse, row 1 column 2 | (number) | Shown to 10 decimal places | |
| Inverse, row 1 column 3 | (number) | Shown to 10 decimal places | |
| Inverse, row 2 column 1 | (number) | Shown to 10 decimal places | |
| Inverse, row 2 column 2 | (number) | Shown to 10 decimal places | |
| Inverse, row 2 column 3 | (number) | Shown to 10 decimal places | |
| Inverse, row 3 column 1 | (number) | Shown to 10 decimal places | |
| Inverse, row 3 column 2 | (number) | Shown to 10 decimal places | |
| Inverse, row 3 column 3 | (number) | Shown to 10 decimal places | |
| Largest error of A × A⁻¹ against the identity | (number) | Shown to 6 decimal places |
How it is calculated
Each input is converted to the base unit of its quantity, the formula above is applied in the order shown in the worked example, and each result is shown in the unit you choose. Results are held at full precision and rounded only for display, except where a step selects a standard size, as the worked example shows. A value outside its allowed range is refused with a message instead of giving a result.
How the result changes with row 1, column 1
| Row 1, column 1 | Determinant | Trace | Inverse, row 1 column 1 |
|---|---|---|---|
| 0.4 | -11.6 | 6.4 | -0.5172413793 |
| 1 | -8 | 7 | -0.75 |
| 2 | -2 | 8 | -3 |
| 4 | 10 | 10 | 0.6 |
| 8 | 34 | 14 | 0.1764705882 |
| 16 | 82 | 22 | 0.0731707317 |
| 40 | 226 | 46 | 0.0265486726 |
Other inputs are the same as in the worked example above.
Standards and further reading
Complex numbers, rectangular and polar form and angle conversion are standard mathematics, not the subject of a standard. Standards apply when the result feeds an electrical design, and they set the method there.
Frequently asked questions
What do I need to enter?
Enter matrix size, row 1, column 1, row 1, column 2, row 1, column 3, row 2, column 1, row 2, column 2, row 2, column 3, row 3, column 1, row 3, column 2, row 3 and column 3. Change the unit of a value with its selector and the result stays the same.
What does this calculator assume?
The matrix is square, 2 × 2 or 3 × 3, with real entries; for a 2 × 2 matrix the third row and column are ignored. The determinant must not be zero. If it is, the rows are dependent and the matrix has no inverse. The inverse is found by elimination with row swapping, which keeps its accuracy when an entry is small, and is checked by multiplying it back against the original. When the determinant is very small compared with the size of the entries the matrix is close to singular, so a small change in an entry changes the inverse a lot; a warning is shown. The inverse entries for a third row and column are a dash for a 2 × 2 matrix.
Which calculators should I use next?
Common next steps are Simultaneous Equations Solver, Vector Calculator (3D), Complex Numbers (Rectangular and Polar) and Resistors in Parallel. The related links at the bottom of this page open them.
How accurate are the results?
Every figure comes from the same tested engine as the Elecmetric calculators and is meant for estimating. 36 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review. Check design values against the standard and the equipment data you work to.
Formula guides and reference
Longer explanations with worked examples and tables, written for the same topic.
- Kirchhoff’s Current and Voltage Laws: the two circuit laws with worked examples
- Thévenin and Norton Formulas: Thévenin and Norton equivalent circuit formulas: open-circuit voltage, equivalent resistance
- Complex Number Formulas: Polar and Rectangular: Complex number formulas for engineers: rectangular and polar form, conversion with atan2, addition
More Engineering Mathematics calculatorsAll engineering calculatorsMatrix Calculator (2×2 and 3×3) in Elecmetric