An LED is a diode that lights up — but it is also a diode, which means it has almost no resistance of its own once it starts conducting. Connect an LED straight across a battery and it will try to draw far more current than it can survive, and it will burn out in seconds. The fix is one cheap component: a series resistor that drops the extra voltage and sets the current to a safe value. This post shows the calculation, works a complete example with a 9 V battery, and shows how to choose the resistor's power rating.
Figure 1: The LED circuit (a), and the LED current against the series resistor value (b). Below about 220 Ω the current passes the LED's 30 mA limit; 360 Ω gives a safe 19.4 mA. (Schematic, not to scale.)
The formula
The resistor must drop the supply voltage minus the LED's forward voltage, at the LED's operating current:
R = (Vs − VF) / IF
Vs is the supply voltage, VF is the LED's forward voltage and IF is the current you want through the LED. A typical small red LED has VF ≈ 2.0 V and runs happily at IF = 20 mA, with an absolute maximum of about 30 mA. Other colours differ — green is about 2.2 V, blue and white about 3.0–3.3 V — so check the LED's datasheet when you have it; the values used here are typical for a standard 5 mm red LED.
Worked example — red LED on a 9 V battery
A standard red LED with VF = 2.0 V and target current IF = 20 mA, powered from a 9 V battery.
Step 1 — voltage across the resistor: the resistor must drop VR = Vs − VF = 9 − 2 = 7 V. Check: 7 V across the resistor plus 2 V across the LED adds back to 9 V ✓ (Kirchhoff's voltage law).
Step 2 — resistor value: R = VR / IF = 7 / 0.020 = 350 Ω. Resistors are sold in standard values, so pick the nearest one above the calculated value: 360 Ω (a standard E12 value). Picking the next value up keeps the current just under the 20 mA target.
Step 3 — actual current with 360 Ω: I = VR / R = 7 / 360 = 0.0194 A (19.4 mA) — just under the 20 mA target and well below the 30 mA maximum ✓.
Step 4 — resistor power rating: the resistor turns its 7 V drop into heat: PR = VR × I = 7 × 0.0194 = 0.136 W. Check: PR = I² × R = 0.0194² × 360 = 0.136 W ✓. A standard ¼ W (0.25 W) resistor handles this with almost twice the needed rating, so use ¼ W. A good rule is to use a resistor rated at least twice the power it will actually dissipate.
Step 5 — where the power goes: the LED itself takes PLED = VF × I = 2 × 0.0194 = 0.039 W (39 mW). The battery supplies P = 9 × 0.0194 = 0.175 W in total. Only 39 mW of 175 mW — about 22% — reaches the LED; the resistor wastes the other 78% as heat. That is the price of this simple method: it is fine for an indicator LED, but wasteful for a high-power light.
Step 6 — the same LED on 12 V: R = (12 − 2) / 0.020 = 500 Ω → nearest standard value 510 Ω. Actual current: I = 10 / 510 = 19.6 mA. Resistor power: PR = 10 × 0.0196 = 0.196 W. A ¼ W resistor would run at 0.196 / 0.25 = 78% of its rating — too hot for comfort — so use a ½ W resistor here.
What happens with the wrong resistor
With 100 Ω on 9 V, the current would be 7 / 100 = 70 mA — more than twice the LED's 30 mA maximum, and the LED would burn out. With 220 Ω it would be 7 / 220 = 31.8 mA, still above the limit. With 1 kΩ it would be only 7 mA: safe, but the LED would be dim. The graph in Figure 1 shows the whole trade-off: bigger resistor, smaller current, dimmer but safer LED.
Key points to remember
- Always use a series resistor with an LED: R = (Vs − VF) / IF.
- Worked example: 9 V battery, red LED (VF = 2.0 V, 20 mA) → 350 Ω calculated, 360 Ω standard value, actual current 19.4 mA.
- Size the resistor's power rating at least twice the power it dissipates: here 0.136 W → use a ¼ W resistor; on 12 V the same LED needs 510 Ω and a ½ W resistor (0.196 W).
- Check the LED's forward voltage and maximum current on its datasheet — colours differ, and the 2.0 V / 20 mA values here are typical for a standard red LED.
- Never connect an LED directly across a supply: with no resistor the current is limited only by the LED's tiny internal resistance, far above its 30 mA limit.
