Wire an LED straight across a battery and one of two things happens: nothing, because the supply is below the LED's threshold, or a brief flash followed by a dead component. There is rarely a comfortable middle ground. An LED is a current-driven device pretending to be a voltage-driven one, and that mismatch is exactly why almost every LED circuit has a humble resistor sitting next to the diode.
This article explains what that resistor actually does, how to pick its value, and how to check that it can handle the heat. The arithmetic is short, but the reasoning behind it is worth getting right, because the same logic carries over to LED strips, indicators, and the early stages of any lighting design.
Why this calculation matters
The defining trait of a diode is a steep current-voltage curve. Below the forward voltage, almost no current flows. Above it, current rises almost vertically: a tiny increase in voltage produces a large jump in current. An LED behaves the same way. Around its rated operating point, the forward voltage barely moves while the current can swing wildly.
That is the whole problem. A voltage source does not negotiate. If your 5 V rail sits even slightly above the LED's forward voltage, the diode will try to conduct an enormous current, heat up, conduct even more freely, and run away until something gives. You cannot control LED current by controlling voltage directly — the curve is too steep. You need a component that pushes back as current rises. A series resistor does precisely that: every extra milliamp drops more voltage across the resistor, leaving less for the diode, which throttles the current automatically. It turns an unstable arrangement into a predictable one.
This matters in practice for indicator LEDs on a panel, status lights on a board, backlights, and any string of LEDs run from a fixed supply. Skip the resistor and you are relying on luck and wiring resistance to save the part.
The core formula
The resistor and the LED share the same current because they are in series. The supply voltage splits between them. Whatever the LED does not drop, the resistor must:
V_supply = V_LED + V_resistor
Rearranging for the resistor voltage and applying Ohm's law gives the design equation:
R = (V_supply - V_LED) / I
Here V_supply is the rail voltage, V_LED is the LED's forward voltage at the chosen current, and I is the current you want to run. The numerator is simply the voltage left over for the resistor to absorb.
There is a second equation you must never skip — the power the resistor dissipates as heat:
P = I^2 * R
equivalently P = V_resistor * I. A resistor rated below this figure will overheat, drift, and eventually fail. Pick a resistor whose power rating comfortably exceeds the calculated value, with margin to spare.
Two practical notes. First, V_LED depends on color and current; a red LED might sit near 2.0 V while a white or blue one runs closer to 3.2 V. Use the value from the datasheet at your target current, not a guessed round number. Second, real resistors come in standard values (the E12 or E24 series), so you will round to the nearest available part. Rounding up slightly lowers the current, which is the safe direction.
A worked example
Suppose you want to run a single LED from a 5.0 V supply. The LED's datasheet gives a forward voltage of V_LED = 2.0 V at the recommended current, and you choose to drive it at I = 20 mA.
Step 1 — find the voltage across the resistor. The LED takes 2.0 V, so the resistor must absorb the rest:
V_resistor = V_supply - V_LED = 5.0 - 2.0 = 3.0 V
Step 2 — apply Ohm's law. Divide that voltage by the target current:
R = (V_supply - V_LED) / I
R = 3.0 / 0.020
R = 150 ohm
So a 150 ohm resistor in series with the LED sets the current to 20 mA. A standard 150 ohm part exists in the E12 series, so no rounding is needed here.
Step 3 — check the power rating. The resistor carries 20 mA and has 150 ohm:
P = I^2 * R = (0.02)^2 * 150 = 0.0004 * 150 = 0.06 W
The resistor dissipates 0.06 W, or 60 mW. A common 1/4 W (0.25 W) resistor handles this with a wide margin, so the smallest standard part is perfectly adequate. Had the supply been much higher, this check would have mattered more — the same exercise on a 24 V rail would push the dissipation up sharply.
Common mistakes
Using the supply voltage in place of the resistor voltage. The resistor only ever sees V_supply minus V_LED. Plugging the full 5.0 V into Ohm's law instead of 3.0 V gives a resistor that is too large and an LED that is too dim.
Guessing the forward voltage. V_LED is not a universal constant. It shifts with LED color, with current, and with temperature. A design built around an assumed 2.0 V can be noticeably off if the real part runs at 3.0 V, especially on a low-voltage rail where the leftover voltage is small.
Forgetting the power check entirely. The resistor equation tells you the value but says nothing about heat. On low-voltage indicator circuits the dissipation is tiny, which lulls people into ignoring it. On higher-voltage rails it can easily exceed a 1/4 W part.
Putting one resistor across several parallel LEDs. LEDs in parallel do not share current equally, because their forward voltages are never identical. The one with the lowest V_LED hogs the current. Give each LED branch its own resistor, or wire the LEDs in series behind a single resistor instead.
Treating the resistor as optional when the supply "looks close." A 3.0 V coin cell driving a 2.9 V LED still needs current limiting. Without resistance, the only things holding back the current are the cell's internal resistance and the wiring — an unreliable safety net that changes as the battery ages.
Try the interactive NovaSolver calculator
Once you are comfortable sizing the resistor, the next questions are about efficiency and heat: how bright the LED actually is at a given drive current, how hot the junction gets, and where the best operating point sits. The LED Design & Thermal Calculator on NovaSolver takes a forward current, forward voltage, wall-plug efficiency, and thermal resistances, and returns the junction temperature, operating luminous flux, luminous efficacy, and input power, with a live curve of drive current versus flux and efficacy. It is the tool to reach for once a circuit moves beyond a single indicator LED into real lighting design.
Related calculators
- Shockley diode equation — see the exponential current-voltage curve that makes series current limiting necessary in the first place.
- RC / RL circuit — useful when an LED is switched or dimmed and you need to understand the transient before the current settles.
- Semiconductor PN junction — the physics of the junction that gives a diode its forward voltage and steep curve.
You can browse the rest in the electromagnetics and electronics tools hub.
Closing note
The LED series resistor is one of the first calculations an electronics beginner learns, and one of the last an experienced designer stops respecting. The idea is simple: an LED sets its own voltage, so something else has to set its current, and a resistor is the cheapest way to do that. Compute the value from the leftover voltage, confirm the resistor can shed the heat, and check the forward voltage against the real datasheet rather than a remembered number. Get those three things right and a small resistor turns a fragile diode into a circuit you can trust.
Top comments (0)