Guide
Build a simple LED circuit: the resistor maths, done slowly
Every electronics beginner meets the same first circuit: a battery, a resistor and one small LED. It looks too simple to need a guide — until the LED dies in a day, or refuses to light at all, and it turns out both failures were decided by one short calculation nobody did. This post does that calculation slowly. You will collect three numbers (your supply voltage, the LED's forward voltage for its colour, and the current you actually want), turn them into a resistor value with one subtraction and one division, pick the right standard resistor off the shelf, and build the loop on a breadboard. Then it deals honestly with the two questions everyone asks next — can several LEDs share one resistor, and why does a coin cell get away with no resistor at all? Batteries and breadboard only; nothing here touches mains electricity.

Here is the whole circuit: a battery, a resistor, and one LED, joined in a loop. Three parts. And yet this tiny loop teaches the single most useful habit in hobby electronics — never connect an LED to a power source and hope. An LED does not sip politely at whatever current it needs. Left unlimited, it grabs. So the resistor is not an accessory to this circuit. In a real sense, the resistor is the circuit, and choosing it takes exactly one subtraction and one division. Let's do them slowly, with real numbers, twice.
Everything below is low-voltage bench work — batteries and a breadboard. Nothing in this post goes anywhere near mains electricity, and it shouldn't: you can learn all of this at 9 volts or less.

Step 1: Know your three numbers
The calculation needs three numbers. Get them first, on paper, before anything touches the breadboard.
Number one: your supply voltage, Vs. Whatever battery or bench supply you are using, at face value: a 9 V battery is 9, a 5 V supply is 5, four AA cells in a holder are 6. Write it down.
Number two: the LED's forward voltage, Vf. An LED does not pass current until the voltage across it reaches a threshold set by the material inside it — and the material is what makes the colour, so each colour has its own threshold. Typical working ranges for small indicator LEDs:
| Colour | Typical forward voltage |
|---|---|
| Red | about 1.8–2.2 V |
| Orange | about 2.0–2.2 V |
| Yellow | about 2.0–2.4 V |
| Green | about 2.0–2.4 V (older type) or 2.9–3.5 V (modern true green) |
| Blue | about 3.0–3.5 V |
| White | about 3.0–3.5 V |
White sits with blue because, electrically, a white LED is a blue chip under a phosphor coating. Green is the honest muddle in the table: two different material families wear the same colour name, so check which one you have. And treat every figure here as a starting estimate — the datasheet for your actual part, which states Vf at a stated current, always wins. For the worked examples below we'll use red = 2.0 V and white = 3.2 V, the round mid-range values.
Number three: the current you want, I. Small 3 mm and 5 mm indicator LEDs are typically rated at about 20 mA maximum continuous. Maximum is not a target. Designing for 10–15 mA gives you a bright, cool-running LED with margin to spare, and the difference between 15 and 20 mA is far less visible than the numbers suggest. Beginners: aim for 10–15 mA and convert it to amps before it goes anywhere near a formula — 15 mA is 0.015 A. That conversion is where most first attempts at this maths quietly go wrong.
Step 2: Do the resistor maths
Why a resistor at all? Because once an LED reaches its forward voltage, it holds roughly that voltage across itself and offers very little resistance to anything more. Connect one straight across a supply higher than its Vf and the current doesn't rise gently — it races, and the LED cooks. The resistor's job is to stand in the loop and take whatever voltage the LED doesn't, and Ohm's law turns that leftover voltage into a controlled current:
R = (Vs − Vf) / I
Worked example one: a 9 V battery and a red LED, at 15 mA. Leftover voltage: 9 − 2.0 = 7.0 V. R = 7.0 / 0.015 = 466.7 Ω. You cannot buy 466.7 Ω. Resistors come in standard values, so take the next standard value above your answer: 470 Ω. Rounding up means the real current lands just under target — 7.0 / 470 = 14.9 mA. Perfect. (Rounding down would push the current over target, which is the one direction you never round.)
One last check, the one people skip: the resistor turns its 7 volts into heat. Power = volts × amps = 7.0 × 0.015 ≈ 0.105 W. The usual rule is a rating of at least twice the heat, so you want 0.21 W or more — a common quarter-watt (0.25 W) resistor just makes it. On a 9 V circuit this check matters; skip it on bigger supplies and resistors genuinely cook.
Worked example two: a 5 V supply and a white LED, at 20 mA. Leftover voltage: 5 − 3.2 = 1.8 V. R = 1.8 / 0.020 = 90 Ω exactly. Next standard value above: 100 Ω, giving 18 mA in practice. Resistor heat: 1.8 × 0.020 = 36 milliwatts — trivial; any standard resistor shrugs that off. Notice the pattern: the same method, the same two operations, whatever the colour or supply. The numbers change; the subtraction and division don't.
Step 3: Build it on the breadboard
Wire the loop in this order, battery disconnected until the end: battery positive to one end of the resistor, the resistor's other end to the LED's long leg, the LED's short leg back to battery negative. One loop, everything in series — that word series is doing real work, and step 4 is about why.
Polarity is the only fiddly bit. The LED conducts in one direction only. Its long leg is the anode, which faces positive; the short leg is the cathode, and the plastic rim has a flat side on the cathode side if the legs have been trimmed and you can't tell by length. Put the two legs in different breadboard rows — legs sharing a row are shorted together and nothing will light.
Now the question everyone asks at this point: does the resistor have to sit before the LED, on the positive leg? No. It can sit on either leg, and the circuit cannot tell the difference. In a series loop, the same current flows through every part of the loop — there is only one current, going round — so a resistor anywhere in that loop limits the whole loop. Before, after: identical.
Connect the battery last. If the LED lights, you're done, and it will sit there at its designed current for a very long time. If it doesn't light, don't poke at it live — disconnect, and turn the LED around. Backwards polarity is the beginner fault nine times out of ten.
Step 4: Series and parallel, honestly
Series is the friendly option. String LEDs one after another and their forward voltages simply add, so one resistor still serves the whole string: R = (Vs − total Vf) / I. Two red LEDs on our 9 V battery at 20 mA: total Vf = 4.0 V, leftover = 5.0 V, R = 5.0 / 0.020 = 250 Ω → fit 270 Ω (real current ≈ 18.5 mA). Every LED in a series string carries exactly the same current, so matching takes care of itself. The catch is arithmetic: the supply must exceed the total Vf with something left over for the resistor. Two white LEDs need about 6.4 V before any resistor gets a say — on a 5 V supply, that string is not happening.
Parallel is where honesty is required. Two LEDs side by side, each with its own resistor calculated for its own branch: completely fine, completely standard. Two LEDs side by side sharing one resistor: bad practice, however neatly it lights up on day one. No two LEDs have exactly the same forward voltage — even from the same packet, they differ by tenths of a volt — and LED current rises steeply with voltage. So the lowest-Vf LED takes more than its share, runs hotter, and as it warms its Vf drops a little further, so it takes even more. The shared resistor only fixes the total current; it has no say in how that total splits. And if one LED fails, the survivors inherit its share too. One resistor per LED is not fussiness. It's the whole design.
And the coin cell? You've seen LEDs taped straight onto a 3 V coin cell, no resistor, glowing happily. It works because the coin cell cheats for you: a coin cell has unusually high internal resistance — roughly 10–40 Ω hiding inside it, depending on the cell — and its voltage sags quickly under a load it was never designed for. Measured on a fresh cell, a white LED draws around 11 mA at first and fades toward 3 mA within the hour. The cell is acting as a lousy, unplanned resistor. It is still poor practice as a habit: the current is decided by the cell's brand and freshness rather than by you, the cell dies fast, and the trick does not scale — try the same bare-LED stunt on a battery pack that can actually deliver current, with low internal resistance, and the LED is destroyed. For a party throwie, fine. As your design method, no.
That's the entire discipline: collect three numbers, subtract, divide, round up, and give every parallel LED its own resistor. Every fancier LED circuit you will ever meet is this loop, dressed up.
Sources: electronics-education LED tutorials (polarity, current ratings, resistor limiting); a university first-circuit lab text (breadboard build; resistor position in a series loop); an LED forward-voltage reference by colour; LED resistor calculation lessons (formula, rounding up to standard E-series values, resistor power check, series vs parallel practice); published coin-cell throwie measurements.
Featured photo: "Solderless Breadboard with LEDs" by Ilikefood, via Wikimedia Commons — released for free use (cropped).
Frequently asked questions
Can I skip the resistor if my supply voltage equals the LED's forward voltage?
No. Forward voltage is a range, not a promise — your part might sit 0.2 V below the printed figure, and LED current rises steeply with small voltage increases. With no leftover voltage and no resistor, nothing controls the current at all. Always leave voltage for the resistor to work with.
Should the resistor go before or after the LED?
Either. In a series loop the same current flows through every component, so a resistor on the anode side and a resistor on the cathode side limit exactly the same current. Position it wherever the layout is neater.
Can identical LEDs from the same packet share one resistor in parallel?
They're not identical — forward voltages vary by tenths of a volt within a packet, and current follows the lowest-Vf part, which then warms and takes still more. Give each parallel LED its own resistor, or put them in series behind one resistor instead.
A coin cell lights an LED with no resistor. Can I do the same with AA batteries?
No. The coin cell only gets away with it because its high internal resistance and fast voltage sag limit the current for you. AA cells have low internal resistance and hold their voltage — a bare LED across them draws destructive current. The resistor is what makes the current *your* decision.
I built the loop and nothing lit up. What did I do wrong?
Work through it in order: is the LED the right way round (long leg toward positive)? Are its two legs in different breadboard rows, not the same one? Is the resistor value wildly too big — a 470 kΩ where you meant 470 Ω makes a very dim LED indeed? Then check the battery itself, ideally in a circuit you know works.