Logo

MonoCalc

/

Kirchhoff's Laws Circuit Solver

Physics

The classic textbook problem: two batteries on either side of a middle resistor. E2 ends up being charged.

R1 4.000 Ω1.364 AR2 2.000 Ω272.7 mAE112.00 V1.364 AR36.000 Ω1.091 AE26.000 V272.7 mA1.364 A272.7 mAA 12.00 VNode AB 6.545 VNode BC 6.000 VNode CGND 0 VNode GNDR1 on (0,0)–(1,0). Select to edit.R2 on (1,0)–(2,0). Select to edit.Empty edge (2,0)–(3,0). Select to place a component.Empty edge (3,0)–(4,0). Select to place a component.Empty edge (4,0)–(5,0). Select to place a component.Wire on (0,1)–(1,1). Select to edit.Wire on (1,1)–(2,1). Select to edit.Empty edge (2,1)–(3,1). Select to place a component.Empty edge (3,1)–(4,1). Select to place a component.Empty edge (4,1)–(5,1). Select to place a component.Empty edge (0,2)–(1,2). Select to place a component.Empty edge (1,2)–(2,2). Select to place a component.Empty edge (2,2)–(3,2). Select to place a component.Empty edge (3,2)–(4,2). Select to place a component.Empty edge (4,2)–(5,2). Select to place a component.Empty edge (0,3)–(1,3). Select to place a component.Empty edge (1,3)–(2,3). Select to place a component.Empty edge (2,3)–(3,3). Select to place a component.Empty edge (3,3)–(4,3). Select to place a component.Empty edge (4,3)–(5,3). Select to place a component.E1 on (0,0)–(0,1). Select to edit.R3 on (1,0)–(1,1). Select to edit.E2 on (2,0)–(2,1). Select to edit.Empty edge (3,0)–(3,1). Select to place a component.Empty edge (4,0)–(4,1). Select to place a component.Empty edge (5,0)–(5,1). Select to place a component.Empty edge (0,1)–(0,2). Select to place a component.Empty edge (1,1)–(1,2). Select to place a component.Empty edge (2,1)–(2,2). Select to place a component.Empty edge (3,1)–(3,2). Select to place a component.Empty edge (4,1)–(4,2). Select to place a component.Empty edge (5,1)–(5,2). Select to place a component.Empty edge (0,2)–(0,3). Select to place a component.Empty edge (1,2)–(1,3). Select to place a component.Empty edge (2,2)–(2,3). Select to place a component.Empty edge (3,2)–(3,3). Select to place a component.Empty edge (4,2)–(4,3). Select to place a component.Empty edge (5,2)–(5,3). Select to place a component.Point (0,0)Point (1,0)Point (2,0)Point (3,0)Point (4,0)Point (5,0)Point (0,1)Point (1,1)Point (2,1)Point (3,1)Point (4,1)Point (5,1)Point (0,2)Point (1,2)Point (2,2)Point (3,2)Point (4,2)Point (5,2)Point (0,3)Point (1,3)Point (2,3)Point (3,3)Point (4,3)Point (5,3)

Resistor heat:

low → high share of dissipated power

· blue arrows: real current · dashed arrows: assumed direction · ~ floating

Edit the circuit

Select an empty edge between two grid points to place a wire, resistor, battery or current source.

Select a component to change its value, label, polarity or reference direction.

Select a point to make its node the ground (0 V).

The component table below the schematic does the same from the keyboard.

Components

LabelTypeValueUnitFrom → to (reference)Actions
(0,0) → (1,0)
(1,0) → (2,0)

—

0 Ω

(0,1)–(1,1)

—

0 Ω

(1,1)–(2,1)
(0,1) → (0,0) (+ at (0,0))
(1,0) → (1,1)
(2,1) → (2,0) (+ at (2,0))

Results

LabelTypeValueReal currentVoltagePowerRole
R1Resistor4.000 Ω1.364 A, left→right5.455 V7.438 Wdissipating
R2Resistor2.000 Ω272.7 mA, left→right545.5 mV148.8 mWdissipating
E1Battery12.00 V1.364 A, bottom→top12.00 V terminal16.36 Wdelivering
R3Resistor6.000 Ω1.091 A, top→bottom6.545 V7.140 Wdissipating
E2Battery6.000 V272.7 mA, top→bottom6.000 V terminal1.636 Wbeing charged

Power delivered 16.36 W = power absorbed 16.36 W ✓

Max KCL residual 0.00e+0 A · max KVL residual 1.78e-15 V

Node voltages

A12.00 V
B6.545 V
C6.000 V
GND0 V

Kirchhoff equations

Hover, focus or tap an equation to highlight its node or mesh on the schematic. Tap again to release it.

N = 4 nodes, B = 5 branches, so 3 KCL + 2 KVL equations (B − N + 1 = 2 meshes).

Node A

−IE1+IR1=0-I_{\mathrm{E1}} + I_{\mathrm{R1}} = 0−IE1+IR1=0-I_{\mathrm{E1}} + I_{\mathrm{R1}} = 0

Node B

−IR1+IR2+IR3=0-I_{\mathrm{R1}} + I_{\mathrm{R2}} + I_{\mathrm{R3}} = 0−IR1+IR2+IR3=0-I_{\mathrm{R1}} + I_{\mathrm{R2}} + I_{\mathrm{R3}} = 0

Node C

−IE2−IR2=0-I_{\mathrm{E2}} - I_{\mathrm{R2}} = 0−IE2−IR2=0-I_{\mathrm{E2}} - I_{\mathrm{R2}} = 0

Mesh M1

E1=R3 IR3+R1 IR1\mathrm{E1} = \mathrm{R3}\,I_{\mathrm{R3}} + \mathrm{R1}\,I_{\mathrm{R1}}12=6 IR3+4 IR112 = 6\,I_{\mathrm{R3}} + 4\,I_{\mathrm{R1}}

Mesh M2

−E2=−R3 IR3+R2 IR2-\mathrm{E2} = -\mathrm{R3}\,I_{\mathrm{R3}} + \mathrm{R2}\,I_{\mathrm{R2}}−6=−6 IR3+2 IR2-6 = -6\,I_{\mathrm{R3}} + 2\,I_{\mathrm{R2}}
I_E1 = 1.364 AI_E2 = -272.7 mAI_R1 = 1.364 AI_R2 = 272.7 mAI_R3 = 1.091 A

I_E2 = -272.7 mA, so the real direction is opposite to the assumed arrow.

Scope: DC steady state with ideal, linear parts only. AC and phasors, capacitors and inductors, diodes and transistors, and dependent (controlled) sources are not supported.

About This Tool

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 = 0

How the solver sets up the problem

  1. 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 r carry the same current.
  2. 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.
  3. 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.
  4. 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.

Choosing the ground node
Voltages are always measured from a reference. By default the solver grounds the − terminal of the first battery. Select any point and choose "Set as ground" to move it. Currents and power don't change, only the node voltages shift.

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.

Scope
This is a DC steady-state solver for linear, ideal parts: resistors, batteries and independent current sources. AC phasors, capacitors, inductors, diodes, transistors and dependent sources are not modelled.

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.

Frequently Asked Questions

Is the Kirchhoff's Laws Circuit Solver free?

Yes, Kirchhoff's Laws Circuit Solver is totally free :)

Can I use the Kirchhoff's Laws Circuit Solver offline?

Yes, you can install the webapp as PWA.

Is it safe to use Kirchhoff's Laws Circuit Solver?

Yes, any data related to Kirchhoff's Laws Circuit Solver only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this Kirchhoff's laws solver work?

It merges wire-connected points into nodes, treats every other component as a branch with one unknown, then writes Kirchhoff's current law at all nodes but one per circuit and Kirchhoff's voltage law around every window-pane mesh of your drawing. The resulting linear system is solved by Gaussian elimination, and node voltages and powers are derived from the branch currents.

Why does a current come out negative?

Every resistor and battery has a reference arrow, the direction the equations assume. A negative answer means the real current flows the other way. The schematic always draws the real direction, while the equations keep the assumed one, just as in a textbook.

How do I know if a battery is being charged?

Look at the role column. When current enters a battery at its + terminal, the battery absorbs power and is being charged; when current leaves the + terminal, it is delivering power. With internal resistance the tool also shows the terminal voltage and the I²r loss.

Why does the tool refuse to solve some circuits?

Ideal components can describe impossible circuits: a wire across a battery, a loop of batteries with no resistance, or a current source with nowhere for its current to go. These have no unique solution, so the tool names the parts involved and highlights them instead of returning a meaningless answer.

Can it solve AC circuits or circuits with capacitors and diodes?

No. It handles DC steady state with ideal resistors, batteries (with optional internal resistance) and current sources. AC phasors, capacitors, inductors, diodes, transistors and dependent sources are outside its scope.

How accurate are the results?

The equations are solved exactly up to double-precision rounding, after scaling the rows and columns so mixed units such as megaohms and millivolts stay well conditioned. The KCL and KVL residuals and the power balance shown under the results let you confirm the answer.