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 color | Approximate Vf range | Notes |
|---|---|---|
| Red, orange, yellow (AlGaInP) | 1.8 to 2.4 V | typical around 2.0 V |
| Yellow-green (GaP, old-style green) | 2.0 to 2.4 V | low efficiency, rarely used now |
| True green (InGaN) | 2.8 to 3.6 V | same family as blue and white |
| Blue, white (InGaN) | 2.8 to 3.6 V | typical 3.0 to 3.2 V |
| Infrared (IR) | 1.2 to 1.6 V | remotes 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.
| Case | Vs | Vf | Current |
|---|---|---|---|
| Nominal | 5.00 V | 3.0 V | 10.0 mA |
| Brightest | 5.25 V | 2.8 V | 12.3 mA |
| Dimmest | 4.75 V | 3.4 V | 6.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
- Never parallel LEDs on one shared resistor. Current crowds into the LED with the lowest Vf. Vf also drops as an LED heats up (roughly −2 mV/°C), so the LED drawing the most current gets hotter and draws even more, a positive feedback loop. If you need parallel strings, give each LED its own resistor.
- Series LEDs share the same current, so brightness is even and one resistor is enough. The supply must exceed the sum of the Vf values plus headroom.
- Series example: three white LEDs on 12 V (3 × 3.0 V = 9.0 V) at 20 mA gives R = 3.0 / 0.02 = 150 Ω. If all three sit at Vf = 2.8 V, the total is 8.4 V and current is 24 mA (possibly over rating); at 3.4 V each it is 10.2 V and 12 mA. Each LED added to a string adds its Vf spread while shrinking relative headroom, so for this kind of string either derate to about 15 mA or use a constant-current source.
- Multi-channel displays: LEDs of the same color but from reels with different Vf bins look different in brightness. For cosmetically critical products, order a single bin or use a constant-current driver.
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
- High-power LEDs: from 1 W parts (350 mA) up, resistor losses reach hundreds of milliwatts to watts and brightness variation shows. A switching LED driver is the standard answer.
- Large supply variation: a discharging lithium cell (4.2 V down to 3.3 V) or a vehicle supply makes resistor-limited brightness wander constantly.
- Small headroom: as in the 3.3 V white LED example, below 1 V of Vs − Vf a resistor cannot hold current steady.
- Efficiency: a resistor wastes (Vs − Vf) / Vs of the power. A white LED on 5 V turns 40% of the input into heat in the resistor.
- Simple linear constant-current options: a two-transistor current source (I ≈ 0.6 V / R), or an LM317 wired as a current regulator (I = 1.25 V / R). The LM317 approach needs roughly 3 to 4 V of extra headroom beyond the LED, so it does not suit low-voltage designs; use a dedicated linear LED driver IC there.
7
Common mistakes
- Assuming Vf from color. 'Green means 2 V' was true for old GaP LEDs. Today's saturated greens are InGaN and sit around 3 V.
- Calculating at nominal voltage only. Current and resistor power peak at maximum supply and minimum Vf.
- Designing to the absolute maximum current. Running a 20 mA LED at 20 mA leaves no margin and hurts lifetime and heating. Use the lowest current that gives the brightness you need.
- One resistor for parallel LEDs. That causes current hogging and thermal runaway.
- Forgetting reverse voltage. LED reverse ratings are often only about 5 V. Add a reverse-protection diode on AC or polarity-reversible inputs.
- Ignoring VOH sag on MCU pins. At higher currents the pin voltage drops and the LED is dimmer than calculated.
8
Practical checklist
- Did you take Vf typical and maximum, and the rated current, from the datasheet?
- Did you set current by required brightness (start at 2 to 10 mA for indicators)?
- At maximum Vs and minimum Vf, is current within rating?
- At minimum Vs and maximum Vf, is it still bright enough?
- Is headroom (Vs − Vf) at least 1 V?
- Is resistor power at worst case 50% of rating or less?
- Does every parallel LED have its own resistor?
- For direct MCU drive, did you check per-pin and per-port current and VOH?
- 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.
