What Resistor for an LED? Why the Calculator's Answer Differs

šŸ“…
āœļø By CircuPilot Team
← Back to Blog Hub

Every guide gives you the same formula, and it is correct:

R = (Vsupply - Vf) / I

Five volts, a red LED at 2 V, 20 mA wanted: (5 - 2) / 0.02 = 150 Ī©. Round up to the 220 Ī© in your kit and you are done.

Then you measure it and get a different current. Not wildly different — but not 20 mA either. This article is about why, and it matters more than it sounds, because the same reason explains why two identical-looking LEDs from the same bag are not equally bright.

The formula assumes Vf is a constant. It is not.

Forward voltage is a point on a curve, not a property of the part. An LED's current rises exponentially with the voltage across it, so the voltage depends on the current you are already drawing. Quoting "2 V" for a red LED means "about 2 V at around 20 mA" — at 1 mA the same LED might sit at 1.8 V, and at 30 mA nearer 2.2 V.

That is circular, and it is why the formula is an approximation rather than an answer: you need Vf to get I, and Vf depends on I.

Three more things move it:

  • Colour, and by a lot. Red and amber sit near 1.8–2.2 V; green, blue and white are typically 3.0–3.4 V, because a shorter wavelength needs more energy per photon. A 3 V blue LED on a 3.3 V supply has only 0.3 V left for the resistor — the same calculation that gives a comfortable answer at 5 V gives almost nothing here.
  • Manufacturing spread. A datasheet gives a range, often ±10–20%. Two LEDs from the same bag will not match.
  • Temperature. Vf falls roughly 2 mV per °C, so an LED warms up and then draws slightly more current.

What the difference actually costs you

Take the standard beginner circuit — 5 V through 220 Ī© into a red LED — and solve it properly instead of with the formula.

current
formula, assuming Vf = 2.0 V13.6 mA
solved with a real diode model11.9 mA, with the LED at 2.38 V

About 13% apart, and in the safe direction. That is fine for one LED and a resistor. It stops being fine in two situations:

Near the supply voltage. A white LED at 3.2 V on a 3.3 V supply: the formula says the resistor drops 0.1 V. If the real Vf is 3.3 V instead, the current is zero and the LED does not light at all. A 10% tolerance on Vf became a working-or-not-working difference — and this is exactly the case where the maths looks fine.

LEDs in series. Three red LEDs at 2 V each is 6 V, which does not fit on a 5 V supply at all. Two fit, with 1 V left for the resistor — and that 1 V is where all the tolerance now lives.

The mistake that is not about Vf at all

Leaving the resistor out because the LED "seemed to work". An LED is a diode: past its turn-on voltage the current rises almost vertically for a tiny change in voltage. There is nothing in the LED limiting it. Connected straight across 5 V, the current is decided by the supply's own internal resistance and the wire — usually far past the LED's rating, and it fails in seconds to minutes.

The resistor is not a refinement. It is the only thing setting the current.

How to actually pick a value

1. Find Vf at the current you want, from the datasheet, not from a colour chart. If you only have a colour, use the top of the range — it errs toward less current, which is the safe direction.

2. Work out the resistor from what is left: R = (Vsupply āˆ’ Vf) / I.

3. Round up to a standard value. Up, not down: less current is dim, more current is dead.

4. Aim for 5–15 mA, not 20. Modern LEDs are bright at well under their maximum, and running below the limit buys you tolerance headroom and a longer life.

5. Check the power in the resistor — I² Ɨ R. At these currents it is milliwatts and never a problem, but the habit matters for the circuits where it is.

Check it before you build it

The reason this article can quote 11.9 mA rather than a formula result is that the circuit was solved with a real diode model rather than a subtraction.

In CircuPilot you can describe it — "a 5 V source with a 220 ohm resistor and a red LED" — and read the actual current and the actual voltage across the LED. Change the resistor and watch both move. Trying 3.3 V instead of 5 V, or a blue LED instead of red, takes a few seconds and shows you the case where the formula quietly stops working.

That is the habit worth having: the formula gets you a starting value, and solving the circuit tells you whether it survives the tolerance.

Open the simulator →

Related: how much power your resistor is dissipating, and why a voltage divider cannot power anything.