KEMI
/

KEMI Docs · Circuit Practice

How to Choose an LED Current-Limiting Resistor

Last updated: 2026-10-04

The LED resistor calculation is one formula: R = (Vs − Vf) / I. The catch is that neither Vf nor Vs is a fixed number. Forward voltage varies from part to part and with temperature, even within one part number, and the supply moves around inside its tolerance. That is how you end up with a design where the math checked out but some boards are dim and others are glaring. This article shows how to check the formula at its worst cases, how much power margin the resistor needs, how to arrange multiple LEDs, and where a resistor stops being good enough and you need a constant-current driver.

1

The formula and its three variables

An LED's brightness is set by current, not voltage. Near Vf the current rises exponentially with voltage, so connecting an LED straight to a voltage source leaves the current unlimited. The series resistor takes the leftover voltage (Vs − Vf) and that sets the current. Here are the three variables.

LED colorApproximate Vf rangeNotes
Red, orange, yellow (AlGaInP)1.8 to 2.4 Vtypical around 2.0 V
Yellow-green (GaP, old-style green)2.0 to 2.4 Vlow efficiency, rarely used now
True green (InGaN)2.8 to 3.6 Vsame family as blue and white
Blue, white (InGaN)2.8 to 3.6 Vtypical 3.0 to 3.2 V
Infrared (IR)1.2 to 1.6 Vremotes and sensors

These ranges are rough industry figures. For a real design, take the typical and maximum Vf from the datasheet of the exact part you are using. Set current by the brightness you need, not by the absolute maximum rating (often 20 to 30 mA for small indicator LEDs). Modern high-efficiency chip LEDs are often bright enough indoors at 2 to 5 mA, and perceived brightness does not scale linearly with current, so cutting 10 mA to 5 mA dims the LED less than you would expect. Treat the supply as a range, not a nominal value. A USB 2.0 port, for example, is specified at 4.75 to 5.25 V on VBUS.

2

Worked example: a white indicator on USB 5 V

We want a white LED (Vf typical 3.0 V, range 2.8 to 3.4 V) at 10 mA from USB 5 V. The nominal calculation gives R = (5 − 3.0) / 0.010 = 200 Ω, and 200 Ω is an E24 value, so we use it. Now add the worst cases.

CaseVsVfCurrent
Nominal5.00 V3.0 V10.0 mA
Brightest5.25 V2.8 V12.3 mA
Dimmest4.75 V3.4 V6.8 mA

Current spans 6.8 to 12.3 mA, about 1.8×. For an indicator that is acceptable, and 12.3 mA is within the LED's rating. Now run the same LED from 3.3 V. The nominal calculation gives R = (3.3 − 3.0) / 0.010 = 30 Ω, but a part with Vf = 2.8 V draws 16.7 mA and one with Vf = 3.4 V barely lights. The smaller the headroom (Vs − Vf), the more the Vf spread gets amplified into current spread. The relative change in current is roughly ΔVf / (Vs − Vf): with 0.3 V of headroom, a 0.2 V shift in Vf moves current by 67%. Our working rule is at least 1 V of headroom, ideally five times the Vf spread. If you can't get that, use a higher rail or go constant-current.

3

Resistor power and derating

Power in the resistor is P = I² × R = (Vs − Vf) × I. Resistor power ratings under the IEC 60115 family are guaranteed up to a specified ambient temperature (commonly 70 °C, about 158 °F) and derate linearly above it. In practice, keep resistors at or below 50% of their room-temperature rating. At a few milliamps for an indicator it never matters, but higher voltages get you to the limit quickly.

Take a red LED (Vf 2.0 V) at 10 mA on a 12 V automotive supply. At a nominal 12 V, R = 10 / 0.01 = 1 kΩ and the resistor dissipates 0.1 W. But a vehicle supply sits around 14.4 V while charging. At 14.4 V the current is 12.4 mA and the resistor burns 0.154 W. That exceeds an 0805 (1/8 W = 0.125 W), and a 1206 (1/4 W) runs at 62%, over the 50% guideline. The fix is two 510 Ω 1206 resistors in series: each carries about 0.075 W at 14.4 V (30% of rating), and the heat is spread over two spots. Separately, vehicle supplies carry transients covered by ISO 7637-2 and ISO 16750-2, so the power input needs its own protection regardless of the resistor math.

4

Multiple LEDs: series yes, parallel no

5

Driving LEDs straight from MCU pins

An MCU datasheet lists the absolute maximum current per pin (often 20 to 25 mA) and, separately, the test current at which output voltages VOH and VOL are guaranteed (often 4 to 8 mA). The more current you pull, the further the pin sags from the rail, so use VOH at your operating current in place of Vs. For a red LED at 5 mA on a 3.3 V MCU whose VOH at that current is 3.1 V, R = (3.1 − 2.0) / 0.005 = 220 Ω. There are also total-current limits per port or per supply pin, so add up all your LEDs. If you exceed those limits or lack headroom, switch the LED with a transistor or MOSFET and power it from a higher rail.

PWM dimming and the resistor

With PWM dimming the resistor sets the peak current while the LED is on, and duty cycle sets the average brightness. Size the resistor for maximum brightness and dim in software. Keep the PWM frequency in the hundreds of hertz or higher so flicker is not visible.

6

When you need a constant-current driver

7

Common mistakes

8

Practical checklist

  1. Did you take Vf typical and maximum, and the rated current, from the datasheet?
  2. Did you set current by required brightness (start at 2 to 10 mA for indicators)?
  3. At maximum Vs and minimum Vf, is current within rating?
  4. At minimum Vs and maximum Vf, is it still bright enough?
  5. Is headroom (Vs − Vf) at least 1 V?
  6. Is resistor power at worst case 50% of rating or less?
  7. Does every parallel LED have its own resistor?
  8. For direct MCU drive, did you check per-pin and per-port current and VOH?
  9. For 1 W-class LEDs or a widely varying supply, did you consider a constant-current driver?

FAQ

Does the resistor go before or after the LED?

It is a series circuit, so current is the same and either position works. When the LED is switched by an MCU pin or a switch, the resistor often goes on the pin side for routing and ESD reasons.

If the calculated value isn't in E24, round up or down?

Usually up, toward less current. The brightness difference is barely visible and you gain margin at the maximum-current corner.

Can an RGB LED use one resistor?

No. Red (about 2 V) and green or blue (about 3 V) have different Vf, so each color needs its own resistor. Check whether the part is common-anode or common-cathode to place the resistors correctly.

Do 12 V LED strips need resistors?

Typical 12 V strips already have three LEDs in series plus a resistor in every segment, so you only connect power. Feeding them more than their rated voltage breaks that built-in calculation.

See also

This article summarises the working rules KEMI uses in real design and fabrication work. For production, part datasheets and fab specifications take precedence.