Kirchhoff's Laws Circuit Solver – Multi-Loop DC Circuits, Step by Step
Many DC circuits can't be reduced to one equivalent resistance. Two batteries on either side of a middle resistor, an unbalanced Wheatstone bridge or a resistor ladder with sources at both ends all have resistors that are neither purely in series nor purely in parallel. For these you need Kirchhoff's laws. This solver lets you draw the circuit on a small grid, then writes out every KCL and KVL equation the way a textbook would, solves them, and draws the answer back onto the schematic: real current directions, node voltages and how much power each resistor dissipates.
Kirchhoff's current law (KCL)
Charge does not pile up at a junction, so the currents leaving any node add up to zero. In the solver every resistor and battery carries an unknown branch current, such as I_R1, measured along a reference arrow you can flip. At a node where R1 enters and R2 and R3 leave, KCL reads I_R2 + I_R3 − I_R1 = 0. Current sources are known, so their values move to the right-hand side. One node in each separate circuit is skipped because its equation would repeat the others: a circuit with N nodes gives N − 1 independent KCL equations.
Kirchhoff's voltage law (KVL)
Walk around any closed loop and the potential changes add to zero, because you are back where you started. The solver uses the window-pane meshes of your drawing, the same loops a textbook would choose, and walks each one clockwise. The result is written in the form Σ EMF = Σ R·I: a battery crossed from − to + adds +E, and a resistor crossed along its reference arrow adds +R·I to the right-hand side. A circuit with B branches and N nodes has exactly B − N + 1 independent meshes. Together with the KCL equations that gives one equation per unknown.
Mesh M1: E1 = R1·I_R1 + R3·I_R3 → 12 = 4·I_R1 + 6·I_R3
Mesh M2: −E2 = R2·I_R2 − R3·I_R3 → −6 = 2·I_R2 − 6·I_R3
Node B: I_R2 + I_R3 − I_R1 = 0How the solver sets up the problem
- Build the graph. Points joined by wires merge into one electrical node, and every other component becomes a branch between two nodes. A battery with internal resistance is a single branch, because the EMF and
rcarry the same current. - Write the equations. KCL at all nodes but the reference, KVL around each mesh. The equations panel shows each one symbolically and with numbers substituted, and hovering an equation highlights its node or loop on the schematic.
- Solve A·x = b. The system is solved by Gaussian elimination after every row and column is scaled, so a megaohm resistor next to a millivolt source still gives an accurate answer.
- Derive the rest. Node voltages come from walking out from ground and adding each branch's voltage. Power follows from voltage times current.
Reading negative currents and battery charging
The reference arrow is only an assumption. If I_R2 comes out as −0.2727 A, the real current is 0.2727 A in the opposite direction. The schematic always draws the real direction, while the equations keep the assumed one. Power uses the passive sign convention, so a battery whose current enters at its + terminal is being charged rather than delivering energy. The classic two-battery preset shows exactly this: the 12 V cell delivers 16.36 W, the 6 V cell absorbs 1.64 W, and the resistors dissipate the rest. The power balance under the results confirms that delivered and absorbed power match.
Circuits with no unique solution
Ideal components can describe impossible circuits. A wire straight across a battery, or two batteries in a loop with no resistance, would need infinite current. A current source with an open end, or two different current sources in series, forces a current that has nowhere to go. In these cases the equations are contradictory or singular, so the solver names the parts involved and highlights them instead of printing a meaningless number. Adding a small internal resistance to a battery is often the fix.
Sharing and exporting
The circuit is saved in your browser as you work. The share button encodes it into the page link, so a teacher can send a problem and a student opens exactly the same drawing. Results download as CSV, and the solved schematic downloads as SVG or PNG for worksheets and lab reports.