Matrix Calculator

2×2 determinant, inverse and multiplication, 3×3 determinant, and solving 2×2 linear systems.
2×2 Matrix
3×3 Determinant
Solve 2×2 System

2×2 Determinant, Inverse & Multiply

det(A) = ad−bc  •  A−1 = 1/det(A) × [d,−b; −c,a]
A=[4,7;2,6]
A=[1,2;3,4], B=[5,6;7,8]
Enter values and press Calculate.

3×3 Determinant

det = a(ei−fh) − b(di−fg) + c(dh−eg)
[1,2,3; 4,5,6; 7,8,10]
Enter values and press Calculate.

Solve ax+by=e, cx+dy=f (Cramer's Rule)

x = (ed−bf)/(ad−bc)  •  y = (af−ec)/(ad−bc)
2x+3y=8, 5x+4y=13
Enter values and press Calculate.

The Two Lines & Their Intersection (live)

Determinants, Inverses, and Solving Systems

A matrix's determinant is a single number that reveals key properties: if it's zero, the matrix has no inverse and the corresponding system of equations has no unique solution. For a 2×2 matrix [a,b;c,d], det=ad−bc. The inverse of a matrix, when it exists, is the matrix that "undoes" it (A×A−1=identity), used to solve systems of linear equations directly: if Ax=v, then x=A−1v.

Cramer's Rule is a direct formula for solving a 2-variable (or larger) system of linear equations without explicitly computing a matrix inverse — each variable is found as a ratio of two determinants, making it fast for small systems.

QuantityFormula (2×2)
Determinantdet(A) = ad−bc
InverseA−1 = (1/det)×[d,−b;−c,a]
Matrix multiplication (A×B)Row×column dot products
System solution (Cramer's rule)x=(ed−bf)/det, y=(af−ec)/det

Real-World Applications & Fully-Explained Examples

Worked examples — explained in full

1. Determinant of A=[4,7;2,6]. det=4×6−7×2=24−14=10.
2. Inverse of A=[4,7;2,6] (det=10 from example 1). A−1=(1/10)×[6,−7;−2,4]=[0.6,−0.7;−0.2,0.4].
3. Multiplying A=[1,2;3,4] × B=[5,6;7,8]. Top-left: 1×5+2×7=19. Top-right: 1×6+2×8=22. Bottom-left: 3×5+4×7=43. Bottom-right: 3×6+4×8=50. Result: [19,22;43,50].
4. 3×3 determinant of [1,2,3;4,5,6;7,8,10]. det=1(5×10−6×8)−2(4×10−6×7)+3(4×8−5×7)=1(50−48)−2(40−42)+3(32−35)=1(2)−2(−2)+3(−3)=2+4−9=−3.
5. Solving 2x+3y=8, 5x+4y=13 with Cramer's rule. det=2×4−3×5=8−15=−7. x=(8×4−3×13)/(−7)=(32−39)/(−7)=(−7)/(−7)=1. y=(2×13−8×5)/(−7)=(26−40)/(−7)=(−14)/(−7)=2.
6. Verifying example 5's solution. Plugging x=1, y=2 back in: 2(1)+3(2)=2+6=8 ✓ and 5(1)+4(2)=5+8=13 ✓ — both equations check out exactly, confirming (x,y)=(1,2) is the correct intersection point of the two lines.

Where Matrices Turn Up in Circuit Analysis

Matrices are not an abstract detour in electrical engineering — they are how any circuit with more than a couple of unknowns is actually solved.

Nodal and mesh analysis

Writing Kirchhoff’s current law at every node of a circuit produces a system of simultaneous equations, which in matrix form is [Y][V] = [I]: an admittance matrix multiplying a vector of unknown node voltages, equal to a vector of source currents. Mesh analysis gives the dual form, [Z][I] = [V].

This is exactly what SPICE does internally. Every simulation timestep assembles the admittance matrix for the circuit at that instant and solves it, which is why simulation time grows quickly with node count — the work of solving an n×n system scales roughly with n3 for direct methods.

What a singular matrix is telling you

If the determinant is zero the matrix cannot be inverted and the system has no unique solution. In circuit terms this is a real, diagnosable fault rather than a maths curiosity. The usual causes are a node with no DC path to ground, a loop of ideal voltage sources, or two independent current sources in series — all of which describe circuits that are genuinely ill-defined.

This is why SPICE reports "singular matrix" errors and why adding a large resistor to ground fixes them: it gives the floating node a defined potential, making the system solvable again.

Two-port parameters

Networks are also described by 2×2 matrices — Z, Y, h and ABCD parameters — each relating input voltage and current to output voltage and current. Their value is that cascaded networks combine by multiplying their ABCD matrices, so a chain of filter sections or transmission-line segments can be analysed by matrix multiplication rather than by solving the whole thing at once. S-parameters serve the same role at radio frequencies, where direct voltage and current measurement is impractical.

Frequently Asked Questions

How do I find the determinant of a 2x2 matrix?

For matrix [a,b;c,d], det = a×d - b×c. For example, [4,7;2,6] has det = 4×6-7×2 = 10.

How do I find the inverse of a 2x2 matrix?

A⁻¹ = (1/det(A))×[d,-b;-c,a] — swap the diagonal elements, negate the off-diagonal elements, and divide everything by the determinant. This only works if det(A)≠0.

What does it mean if a matrix's determinant is zero?

The matrix has no inverse (it is "singular"), and the corresponding system of linear equations either has no solution or infinitely many solutions rather than one unique solution.

How do I multiply two matrices?

Each element of the result is the dot product of the corresponding row of the first matrix and column of the second matrix. Matrix multiplication is not commutative — A×B usually does not equal B×A.

What is Cramer's Rule?

A direct method for solving a system of linear equations using determinants: each variable equals a ratio of two determinants, without needing to explicitly compute a matrix inverse — efficient for small systems (2 or 3 variables).

How do I find the determinant of a 3x3 matrix?

Use cofactor expansion along the first row: det = a(ei-fh) - b(di-fg) + c(dh-eg), where the letters correspond to the matrix [a,b,c;d,e,f;g,h,i].

Why are matrices used in circuit analysis?

Mesh and nodal analysis produce a system of simultaneous linear equations (one per mesh/node), which can be written and solved compactly in matrix form — this is exactly how the Mesh Analysis calculator on this site solves multi-loop circuits.

What happens if Cramer's Rule's determinant is zero?

The system either has no unique solution (the two equations represent parallel lines that never intersect) or infinitely many solutions (the two equations represent the same line) — the calculator will flag this case rather than dividing by zero.

Can this calculator solve 3x3 systems of equations?

This calculator directly solves 2x2 systems using Cramer's Rule and computes 3x3 determinants; a full 3x3 system solve would extend Cramer's Rule using three 3x3 determinants (one for each variable) following the same principle.

How is matrix inversion used in control systems?

State-space control system models represent system dynamics as matrix equations, and computing matrix inverses (or solving related linear systems) is a core step in analyzing stability, designing controllers, and simulating system response.

Where are matrices used in circuit analysis?

Nodal analysis produces [Y][V] = [I] and mesh analysis produces [Z][I] = [V]. Any circuit with several unknowns is solved as a matrix system, which is exactly what SPICE does at each timestep.

What does a singular matrix mean in a circuit?

That the circuit is ill-defined and has no unique solution. Common causes are a node with no DC path to ground, a loop of ideal voltage sources, or current sources in series.

How do I fix a singular matrix error in SPICE?

Usually by giving every node a DC path to ground, often with a very large resistor. That defines the floating node's potential and makes the system solvable without meaningfully altering the circuit.

What are two-port parameters?

Sets of four values — Z, Y, h or ABCD — arranged as a 2×2 matrix relating a network's input voltage and current to its output voltage and current.

Why are ABCD parameters useful?

Because cascaded networks combine by multiplying their ABCD matrices. A chain of filter sections or transmission-line segments can therefore be analysed by matrix multiplication instead of solving the entire network simultaneously.

Why does circuit simulation slow down with large circuits?

Because solving an n×n matrix scales roughly with the cube of n for direct methods. Doubling the node count can increase solve time by around eight times, which is why large simulations use sparse-matrix techniques.

Related Calculators

Mesh Analysis Calculator • KVL and KCL Calculator • Complex Number Calculator • All Calculators

Vinay Singh, author of this page

Written and reviewed by

Lead Electronic Engineer (R&D) · Power Electronics Specialist · M.E. Power Electronics

Founder of Power4All. Works in power-electronics R&D and writes the converter guides, calculators and simulators on this site.

Last updated

Power Electronics Bench Gear