High SchoolExtendedPhysicsElectromagnetismEnergy

Kirchhoff's Circuit Laws Explained

Why current splits at a junction and why voltages around a loop always add to zero — with a fully worked two-loop network, sign conventions that actually survive contact with a problem, and the nodal method the simulation uses to solve any circuit you build.

Ohm's law tells you what a single resistor does. It says nothing about what happens when three resistors and two batteries are wired into a loop that feeds back on itself. For that you need two statements that Gustav Kirchhoff published in 1845, while he was still a student: the junction rule and the loop rule.

Neither is a new law of nature. The junction rule is conservation of charge, written for a wire. The loop rule is conservation of energy, written for a charge that goes all the way around and comes back to where it started. Everything else in DC circuit analysis — series resistance, parallel resistance, potential dividers, internal resistance — falls out of those two.

What the simulation shows
Pick one of four circuits, set the EMFs and resistances, and the readout solves the network and then checks itself in front of you: it walks each loop term by term and shows the running sum landing on zero, and it shows the current into each junction matching the current out. If the physics were wrong, those rows would not balance.

Before either law makes sense you need three words, and the first one is the one people get wrong.

  • A node (or junction) is a point where the circuit divides. Crucially, everything joined by plain wire is the same node — an ideal wire has no resistance, so it has no potential difference across it. A long stretch of wire with nothing in it is not two nodes, it is one.
  • A branch is a path from one node to another with components in it. Every component in a branch carries the same current, because there is nowhere else for the charge to go.
  • A loop is any closed path you can trace through the circuit and return to your starting point.
Smart Tip!
In the simulation, nodes are the labelled white dots and each one shows its own potential. Notice that the parallel circuit has only two nodes, even though it looks busy — the entire top rail is one node and the entire bottom rail is another. That single observation explains why parallel components all have the same voltage across them.

Charge does not pile up in a wire. Whatever flows into a junction in one second must flow out of it in the same second, so:

∑into nodeI  =  ∑out of nodeI\sum_{\text{into node}} I \;=\; \sum_{\text{out of node}} I

It is often more convenient to count everything as leaving the node, letting currents that actually flow inwards come out negative. Then the law is simply:

∑kIk=0\sum_{k} I_k = 0
This is the form the simulation's solver uses. One such equation is written for every node except one, which is chosen as the zero-volt reference.
Attention!
The junction rule is about current, not charge carriers, and not energy. Electrons are not consumed by a lamp. The same number per second leave the lamp as entered it — what the lamp takes is energy, and that is the other law's business.

Electric potential is a property of a point in the circuit. If you walk from a point all the way around a loop and arrive back at that same point, you must be back at the same potential — there is only one value there. So the rises and drops you accumulated on the way round have to cancel exactly:

∑closed loopΔV=0\sum_{\text{closed loop}} \Delta V = 0

Physically: a cell of EMF EE does qEqE joules of work pushing charge qq through itself, and every resistance the charge then passes through takes some of that energy back out as heat. Round a full loop, the energy given equals the energy taken. KVL is conservation of energy per unit charge.

Where the readout comes from
The KVL loop rows in the simulation are literally this walk, written out: one signed number for each EMF you pass through and one for each resistance you pass through, followed by the total. Change any slider and watch every term move while the total stays pinned at 0.00 V.

Almost every mistake in Kirchhoff problems is a sign, not a formula. Two habits make it reliable.

First: guess the current directions and commit. You do not need to guess correctly. Mark an arrow on every branch, do the algebra, and if a current comes out negative that simply means the real flow is the other way. A negative answer is information, not an error.

Second: pick a direction to walk each loop and apply the same two rules at every component you meet.

  • Crossing a cell from its − plate to its + plate is a rise of +E+E. Crossing the other way is −E-E.
  • Crossing a resistance along your assumed current direction is a drop of −IR-IR. Crossing it against the current direction is +IR+IR.
Internal resistance is not special. A real cell is an ideal EMF in series with a resistance r, so crossing it gives you both a +E term and a −Ir term, one after the other. The simulation prints them as two separate numbers for exactly this reason.

This is the circuit the simulation opens on, with its default values. Two cells and three resistors are wired between the same pair of nodes, AA at the top and BB at the bottom.

BranchContentsTotal REMF
Left (B → A)Cell E₁ with internal r₁, then R₁0.5 + 4 = 4.5 Ω12 V
Middle (A → B)R₂ alone6 Ω0 V
Right (B → A)Cell E₂ with internal r₂, then R₃0.5 + 3 = 3.5 Ω6 V

Take BB as the zero of potential and let VAV_A be the unknown. Each branch current follows from Ohm's law applied across the whole branch — the potential you start at, minus the potential you end at, plus whatever the cell adds, all over the resistance:

I1=12−VA4.5,I2=VA6,I3=6−VA3.5I_1 = \frac{12 - V_A}{4.5}, \qquad I_2 = \frac{V_A}{6}, \qquad I_3 = \frac{6 - V_A}{3.5}

Now apply the junction rule at AA. Two branches feed it and one drains it:

I1+I3=I2I_1 + I_3 = I_2
12−VA4.5+6−VA3.5=VA6\frac{12 - V_A}{4.5} + \frac{6 - V_A}{3.5} = \frac{V_A}{6}

That is one equation in one unknown. Collecting terms gives 0.6746 VA=4.38100.6746\,V_A = 4.3810, so:

VA=6.494 V  ⇒  I1=1.224 A,I2=1.082 A,I3=−0.141 AV_A = 6.494\ \text{V} \;\Rightarrow\; I_1 = 1.224\ \text{A},\quad I_2 = 1.082\ \text{A},\quad I_3 = -0.141\ \text{A}
Read that third current again
I3I_3 came out negative. The 6 V cell is not driving current into the circuit at all — the 12 V cell has pushed node AA up to 6.49 V, which is above E₂, so current is being forced backwards through the second cell. It is being charged. This is exactly what happens when you connect a charger to a battery, and it is why you should never dismiss a negative current as a mistake.

Check it with the loop rule. Walking loop ① up the left branch and back down the middle:

+12⏟E1  − 0.61⏟I1r1  − 4.89⏟I1R1  − 6.49⏟I2R2  =  0\underbrace{+12}_{E_1} \;\underbrace{-\,0.61}_{I_1 r_1} \;\underbrace{-\,4.89}_{I_1 R_1} \;\underbrace{-\,6.49}_{I_2 R_2} \;=\; 0

The rules you were taught first are what the two laws reduce to in simple topologies. Switch the simulation between the Series and Parallel presets and watch the readout.

Series. A chain of resistors has no junctions between them, so KCL leaves no choice: the current is identical in every branch. KVL round the single loop then gives E=I(r+R1+R2+R3)E = I(r + R_1 + R_2 + R_3), which is the same as one resistor of value:

Req=R1+R2+R3R_{\text{eq}} = R_1 + R_2 + R_3

Parallel. All three resistors sit between the same two nodes, so they all have the same potential difference VV across them. KCL at the top node says the branch currents add to the total:

I=VR1+VR2+VR3  ⇒  1Req=1R1+1R2+1R3I = \frac{V}{R_1} + \frac{V}{R_2} + \frac{V}{R_3} \;\Rightarrow\; \frac{1}{R_{\text{eq}}} = \frac{1}{R_1} + \frac{1}{R_2} + \frac{1}{R_3}
Try this
In the parallel preset, drag the ammeter onto each branch in turn and add the three readings. With the defaults they come to 2.182 + 1.455 + 2.909 = 6.545 A, which is exactly the reading on the cell's branch. Then lower R₁ and watch the smallest resistor take the largest share.

An ideal cell would hold its terminals at EE volts no matter how much current you drew. A real one cannot: its own chemistry has resistance rr, and the current has to get through that too. What the outside world actually sees is the terminal voltage:

Vterm=E−IrV_{\text{term}} = E - I r

This is why headlights dim when you crank an engine, and why a battery reads a healthy voltage with nothing attached and sags the moment it has to do work. Put the simulation on the single-loop preset, drag the voltmeter leads onto the two nodes, and lower R1R_1: as the current climbs, the reading falls away from EE.

Why the simulation will not let r be zero
A branch with no resistance at all is a short circuit: the equations demand infinite current and the matrix becomes singular. That is not a numerical wobble, it is the model honestly reporting that an ideal EMF across an ideal wire is unphysical. Every resistance in the simulation is therefore held at or above 0.01 Ω.

Each cell delivers P=EIP = EI into the circuit, and each resistance turns P=I2RP = I^2R of it into heat. Because KVL is conservation of energy, multiplying the loop equation by the current proves these must be equal overall:

∑cellsEkIk  =  ∑resistancesIk2Rk\sum_{\text{cells}} E_k I_k \;=\; \sum_{\text{resistances}} I_k^{2} R_k

The simulation shows both totals side by side, and they agree to the last decimal in every circuit — that is a genuine check on the solution, not decoration. In the default two-loop network it comes to 13.84 W each way, and note that E₂'s contribution to the left-hand side is negative: it is absorbing energy, not supplying it.

The glow on each resistor is scaled by its own I²R, so brightness is a fair visual proxy for how hot that component is getting. In the parallel preset the smallest resistor glows brightest.

Guessing loops by hand does not scale. The simulation uses nodal analysis, which turns the junction rule into a matrix equation and solves it by Gaussian elimination — the same method any circuit simulator uses.

Every branch is treated as an EMF in series with a resistance, so its current is a function of the potentials at its two ends. Substituting that into ∑I=0\sum I = 0 at each node gives one linear equation per unknown potential:

∑b1Rb Vn  −  ∑b1Rb Vother  =  −∑bsbEbRb\sum_b \frac{1}{R_b}\,V_n \;-\; \sum_b \frac{1}{R_b}\,V_{\text{other}} \;=\; -\sum_b \frac{s_b E_b}{R_b}
Here s = +1 when the branch is oriented away from node n and −1 when it points into it. One node is grounded at 0 V and its row is dropped, which is what makes the system solvable at all — only potential differences are physical.
javascript

// Assemble the conductance system G·v = i, one row per unsolved node.
for (const branch of branches) {
  const g = 1 / branch.R;
  for (const [id, s] of [[branch.from, 1], [branch.to, -1]]) {
    const row = unknowns.get(id);
    if (row === undefined) continue;       // the grounded node has no row
    G[row][row] += g;
    const col = unknowns.get(s === 1 ? branch.to : branch.from);
    if (col !== undefined) G[row][col] -= g;
    rhs[row] -= s * branch.emf * g;
  }
}

// Solve for the node potentials, then read every branch current back off them.
const V = gaussian(G, rhs);
for (const branch of branches) {
  branch.I = (V[branch.from] - V[branch.to] + branch.emf) / branch.R;
}

Unlike the rest of the site's simulations, there is nothing to integrate here — no positions, no velocities, no timestep. A resistive circuit settles instantly, so its state is the exact solution of a linear system, recomputed from scratch every frame. The only thing that advances with time is the animation of the charge carriers.

ParameterSymbolDescription
Circuit—Which network to build: single loop, series, parallel, or the two-loop network with two cells.
First cell EMFE₁Energy the main cell gives each coulomb of charge, in volts. Used by every preset.
First cell internal resistancer₁The main cell's own resistance (Ω). Raising it lowers the terminal voltage under load.
Second cell EMFE₂The opposing cell in the two-loop network (V). Ignored by the other presets.
Second cell internal resistancer₂Internal resistance of the second cell (Ω).
ResistorsR₁, R₂, R₃The external resistances (Ω). Which of them appear depends on the circuit selected.
  1. On the two-loop circuit, raise E₂ past 6.49 V and watch I3I_3 flip from negative to positive — the moment the second cell stops being charged and starts driving.
  2. Set E₁ and E₂ equal, then make R₁ and R₃ equal too. The two branches become symmetric and carry identical currents; the middle branch takes their sum.
  3. On the series circuit, drag the ammeter from branch to branch. The reading never changes. Then switch to parallel and repeat — now every branch is different.
  4. Push r₁ to 5 Ω on the single loop with a small R₁. Most of the energy is now dissipated inside the cell itself: a flat battery, getting warm and delivering very little.
  5. Turn off the charge-flow animation and the arrows, and try to predict the direction of every current before turning them back on.
Success!
If you can look at any circuit, mark arbitrary current arrows, write one junction equation per node and one loop equation per mesh, and then trust a negative answer when you get one — you can solve any DC network that will ever be put in front of you.