Kirchhoff's law calculator (KCL and KVL) with steps

Updated

Draw your circuit and Circuitsteps applies Kirchhoff's laws for you, step by step: KCL at every node with nodal analysis, or KVL around every loop with mesh analysis. You get every equation, the matrix they form, and the current through and voltage across every component.

A circuit with two voltage sources
A circuit with two voltage sources Solve this circuit step by step →

Edit the circuit above, or draw your own, then select Solve step by step.

How to use the Kirchhoff's law calculator

  1. Draw the circuit. Choose a part from the toolbar, then click and drag on the grid to place it. Connect the parts' ends, using wires where you need them.
  2. Enter the values. Double-click a part to change its value, such as 4 Ω4\,\Omega or 12 V12\,\text{V}. Prefixes like k and m work too.
  3. Place a reference node (the ground symbol) if you want node voltages. Branch currents and component voltages don't need one.
  4. Choose what to solve for: Node voltages, Branch currents (the current through each component), Mesh currents or Component voltages, for every one or just one.
  5. Choose the method. Nodal analysis writes the equations with KCL, and mesh analysis writes them with KVL. Then solve.

Kirchhoff's laws

Kirchhoff's current law (KCL) says the currents flowing into a node add up to the currents flowing out. Equivalently, the sum of the currents leaving a node is zero:

∑kik=0\sum_k i_k = 0

Kirchhoff's voltage law (KVL) says the voltages around any closed loop add up to zero: the rises equal the drops.

∑kvk=0\sum_k v_k = 0

Together with Ohm's law, v=iRv = iR, they're enough to solve any circuit of resistors and sources. The question is just how to organise the equations, and that's what nodal and mesh analysis are:

MethodUnknownsEquationsNumber of equations
Branch currentsThe current in every branchKCL at nodes, and KVL around loopsOne per branch
Nodal analysisNode voltagesKCL at each nodeOne per node, less the reference node
Mesh analysisMesh currentsKVL around each meshOne per mesh

Nodal and mesh analysis need fewer equations than writing KCL and KVL for every branch, which is why Circuitsteps uses them. Both give every branch current in the end.

Example: KCL and KVL by hand

In the circuit above, a 12 V12\,\text{V} source V1V1 and a 3 V3\,\text{V} source V2V2 are joined by R1R1 (4 Ω4\,\Omega) and R3R3 (1 Ω1\,\Omega), with R2R2 (4 Ω4\,\Omega) down the middle. Find the current through each resistor.

Step 1: label the branch currents

Let I1I_1 flow right through R1R1, I2I_2 flow down through R2R2, and I3I_3 flow right through R3R3. If a guess is the wrong way round, its answer just comes out negative.

Step 2: KCL at the top middle node

I1I_1 flows in, and I2I_2 and I3I_3 flow out:

I1=I2+I3I_1 = I_2 + I_3

Step 3: KVL around each loop

Clockwise around the left loop, up through V1V1, right through R1R1 and down through R2R2:

−12+4I1+4I2=0-12 + 4I_1 + 4I_2 = 0

Clockwise around the right loop, up through R2R2 (against I2I_2), right through R3R3, and down through V2V2 from its + end to its − end:

−4I2+1I3+3=0-4I_2 + 1I_3 + 3 = 0

Step 4: solve

Substitute I1=I2+I3I_1 = I_2 + I_3 into the first loop's equation to get 8I2+4I3=128I_2 + 4I_3 = 12. The second gives I3=4I2−3I_3 = 4I_2 - 3, so 24I2=2424I_2 = 24:

I1=2 A,I2=1 A,I3=1 AI_1 = 2\,\text{A}, \qquad I_2 = 1\,\text{A}, \qquad I_3 = 1\,\text{A}

The node between the resistors is at 12−4×2=4 V12 - 4 \times 2 = 4\,\text{V}. Checking with the outer loop: R1R1 drops 8 V8\,\text{V} and R3R3 drops 1 V1\,\text{V}, and 12−8−1=3 V12 - 8 - 1 = 3\,\text{V}, which is V2V2.

Solve this example in Circuitsteps to see the same answers found with nodal analysis (one KCL equation) or mesh analysis (two KVL equations).

What it can solve

Circuits with resistors, independent voltage and current sources, dependent sources, and capacitors and inductors at DC (where a capacitor is an open circuit and an inductor is a short circuit). It handles supernodes and supermeshes automatically, and finds node voltages, mesh currents, the current through each component and the voltage across each component.

Tips for using Kirchhoff's laws

Frequently asked questions

Is the Kirchhoff's law calculator free?

Yes. Circuitsteps is free to use, with no sign-up.

Does it use KCL or KVL?

Both, depending on the method you choose. Nodal analysis writes a KCL equation at each node, and mesh analysis writes a KVL equation around each mesh. Either way you get every equation, the matrix, and the answers.

Can it find the current through every resistor?

Yes. Choose Branch currents to get the current through each component, or Component voltages to get the voltage across each one, and it shows how each is worked out.

What is the difference between KCL and KVL?

KCL (Kirchhoff's current law) says the currents leaving a node add up to zero. KVL (Kirchhoff's voltage law) says the voltages around a closed loop add up to zero. KCL is the basis of nodal analysis, and KVL is the basis of mesh analysis.

Does it work on a phone?

Yes. On a phone or tablet, Circuitsteps has a touch editor: tap a part to add it, drag to move it, and tap Solve step by step.

Stuck on a circuit? Get the full step-by-step solution.Solve it now →