LED current limiting resistor calculator
The resistor that sets an LED string's current, the standard value to fit, what it dissipates, and how far the current wanders once the supply, the LED and the resistor are all at the wrong end of their tolerances.
The rail feeding the string. Use the value it really sits at under load — a USB port is specified down to 4.4 V, not 5 V.
Forward voltage at the current below, from the datasheet curve rather than the headline number. Roughly 1.8–2.2 V for red, 3.0–3.4 V for blue, green and white.
Design current. 2–5 mA is plenty for a modern indicator; 20 mA is the old default and mostly wastes power and dazzles people.
LEDs in series share one current and add their forward voltages. Never put them in parallel on one resistor — the lowest-Vf part hogs the current.
Leave at 0 to get the nearest E24 value picked for you, or enter a resistor you already have to see what current it actually gives.
How far the rail can drift. The resistor drops the difference, so a small tolerance on a supply that barely exceeds Vf turns into a large swing in current.
Part-to-part spread in forward voltage, ±0.1–0.3 V for one bin. It is the main reason two LEDs from the same reel look different brightnesses.
Resistor tolerance, 1 % or 5 % for ordinary chip parts. It matters least of the three — the headroom across the resistor dominates.
- Exact resistor
- 150 Ω
- E24 value at or above
- 150 Ω
- Current with 150 Ω
- 20.0 mA
- Headroom across R
- 3.00 V
- Resistor power
- 60.0 mW → any 0603 or larger
- LED power / efficiency
- 40.0 mW · 40 %
- Worst case, ±5 % supply, ±0.2 V Vf, ±1 % R
- 16.8 to 23.2 mA
How this is calculated
Standard: Ohm's law; LED datasheet Vf–If curve
- η is the share of the power that reaches the LEDs rather than heating the resistor.
- Worst case low, with supply tolerance s and resistor tolerance r.
- Worst case high — this is the one that cooks the LED.
Assumptions
- Vf is taken at the design current; it rises with current (roughly logarithmically) and falls about 2 mV/°C as the die warms.
- LEDs in one string carry the same current by construction. Parallel strings on one resistor do not share and are not modelled.
- The E24 value is rounded up so the fitted resistor never drives the LED above the design current.
- DC. For PWM dimming the peak current is what matters here; the average is the duty cycle times it.
- No allowance for the driving pin: a GPIO adds its own output resistance and sinks or sources a limited current.
What sets an LED's series resistor
A resistor in series with one or more LEDs on a fixed supply. The LED drops roughly Vf regardless of current, so the rest of the supply sits across the resistor, and that sets the current. The resistor for a design current, the current you actually get once a stock value is fitted, and the power split between resistor and diodes are the first three expressions under How this is calculated above, with n the number of LEDs in series.
The quantity to watch is the headroom, Vs − n·Vf. With 3 V of headroom a 0.3 V shift in Vf moves the current 10 %; with 0.5 V it moves it 60 %. So the tool also stacks supply, Vf and resistor tolerances the wrong way and reports the current range you will see across a batch of boards.
Vf depends on the chemistry, not the package. Typical values at 20 mA:
| Colour | Vf |
|---|---|
| Infrared | 1.2 to 1.6 V |
| Red, orange, yellow | 1.8 to 2.2 V |
| Green (GaP, yellowish) | 2.0 to 2.4 V |
| Green (InGaN, pure), blue, white | 2.8 to 3.4 V |
| UV | 3.2 to 3.8 V |
Datasheets give Vf as min, typ and max at the test current, and vendors sell by Vf bin, so two reels of the same part number can differ by 0.4 V. Vf also drops about 2 mV/°C, so a warm LED pulls more current; not runaway with a resistor, but a visible drift when the headroom is small.
LED resistor chart
The series resistor for one LED on the common rails, computed by the calculator above and rounded up to the E24 value so the current comes out at or just under the target. Each cell is the part, the current it actually sets, and the power it dissipates, which is what decides the package. Forward voltages are typical; the calculator takes the number from the datasheet curve.
| Supply | Red, Vf 2.0 V, 20 mA | Red, 2.0 V, 10 mA | White or blue, Vf 3.2 V, 20 mA | White or blue, 3.2 V, 10 mA |
|---|---|---|---|---|
| 3.3 V | 68 Ω, 19.1 mA, 25 mW | 130 Ω, 10.0 mA, 13 mW | no headroom | no headroom |
| 5 V | 150 Ω, 20.0 mA, 60 mW | 300 Ω, 10.0 mA, 30 mW | 91 Ω, 19.8 mA, 36 mW | 180 Ω, 10.0 mA, 18 mW |
| 9 V | 360 Ω, 19.4 mA, 140 mW | 750 Ω, 9.3 mA, 65 mW | 300 Ω, 19.3 mA, 110 mW | 620 Ω, 9.4 mA, 54 mW |
| 12 V | 510 Ω, 19.6 mA, 200 mW | 1 kΩ, 10.0 mA, 100 mW | 470 Ω, 18.7 mA, 160 mW | 910 Ω, 9.7 mA, 85 mW |
| 24 V | 1.1 kΩ, 20.0 mA, 440 mW | 2.2 kΩ, 10.0 mA, 220 mW | 1.1 kΩ, 18.9 mA, 390 mW | 2.2 kΩ, 9.5 mA, 200 mW |
The 24 V column is the one to look at twice: the resistor burns ten times the LED's own power, and a 0603 will not survive it. The 3.3 V white cell has no entry because a tenth of a volt of headroom is not a design; that LED wants a 5 V rail or a constant-current driver.
Worked example: a red indicator on a 5 V rail
A red indicator on a 5 V rail, Vf 2.0 V, 20 mA.
headroom = 5.0 − 1 × 2.0 = 3.0 V
R = 3.0 / 0.020 = 150 Ω E24 value, fit it as is
I = 3.0 / 150 = 20.0 mA
P_R = 0.020² × 150 = 60 mW a 0603 (100 mW) is fine, 0402 (63 mW) is marginal
P_LED = 0.020 × 2.0 = 40 mW
η = 40 / (60 + 40) = 40 %Now the tolerances: a 5 % regulator, ±0.2 V of Vf spread from the bin, a 1 % resistor.
min: Vs = 4.75 V, Vf = 2.2 V, R = 151.5 Ω
I = (4.75 − 2.2) / 151.5 = 2.55 / 151.5 = 16.8 mA
max: Vs = 5.25 V, Vf = 1.8 V, R = 148.5 Ω
I = (5.25 − 1.8) / 148.5 = 3.45 / 148.5 = 23.2 mAA 20 mA design lands between 16.8 and 23.2 mA, about ±16 %. Fine for an indicator. Put the same LED on 3.3 V and the headroom is 1.3 V: fit 68 Ω and the same tolerances give 13.6 to 24.7 mA, a 1.8:1 spread. The 1 % resistor is not the problem; 0.4 V of Vf spread against 1.3 V of headroom is.
Current limiting resistor: before or after, and for several LEDs
The resistor limits the current by dropping whatever the supply has left over once the LED has taken its forward voltage, and a series loop has the same current everywhere in it, so the resistor works identically on the anode side or the cathode side. Put it wherever the layout is shortest; the only difference is which node sits at the supply and which swings, which matters for noise on a long lead and for nothing else.
Several LEDs in series share one resistor and one current, and their forward voltages add: the calculator's series count does exactly that, and the headroom shrinks by one Vf per LED until the rail runs out. Several LEDs in parallel on one resistor do not share the current equally: the part with the lowest forward voltage takes most of it, brightens, heats, and its Vf falls further. A seven-segment display is the everyday case, seven or eight LEDs that light in every combination; one resistor per segment, each sized here for one LED, is the arrangement that keeps every segment at the same brightness whatever else is lit. A shared resistor on the common pin makes an "8" dimmer than a "1" by a factor of seven.
Where the constant-Vf model stops being valid
The model. An LED is a diode with an exponential I-V curve, not a fixed drop. Constant Vf is accurate near the datasheet test current and worse away from it: a red LED at 2 mA reads 1.7 V, a power white at 100 mA may be 3.6 V. Take Vf from the curve at your current.
Driving from a GPIO. A microcontroller pin has tens of ohms of output resistance and a rated drive, typically 4 to 20 mA per pin with a budget per port and per device (STM32: 8 mA typ, 25 mA abs max, 120 mA for the chip; AVR: 20 mA per pin, 200 mA total). At 20 mA the pin has sagged a few hundred millivolts, so the headroom and the current are less than the calculator says. Use 2 to 5 mA for indicators, or a transistor.
PWM. The resistor sets the peak current; the duty cycle sets the average. 20 mA peak at 25 % duty is 5 mA average and the resistor power scales the same way. Keep the peak under the pulsed rating and the frequency above a few hundred hertz.
Parallel LEDs on one resistor. The one with the lowest Vf takes the most current, gets hottest, drops further, takes more. Two identical LEDs can split 40 mA as 25 and 15, and if one fails open the other gets the lot. One resistor per LED.
12 V strings. Three white LEDs at 3.2 V leave 2.4 V of headroom, which is why LED strip runs three per segment. Four leave nothing. The tool refuses when n·Vf reaches the supply; treat under 1 V of headroom as a warning.
When to stop using a resistor. Above about 100 mA the resistor burns as much as the LED, and brightness matching across channels or temperature is at the mercy of Vf. A constant-current driver (a linear sink like the CAT4101, a buck like the AL8860) regulates current directly and, switching, runs above 90 %.
Common LED resistor mistakes
- Using typ Vf and no tolerance, then wondering why three boards from one batch have three brightnesses.
- Forgetting P = I²R. 60 mW in a 63 mW 0402 at 85 °C is over its derating curve.
- Taking 20 mA from an MCU pin because the LED is rated for it. The pin sags, the total port budget goes, and the LED is far brighter than an indicator needs to be.
- Running blue or white LEDs from 3.3 V with a small resistor. The headroom is 0 to 0.5 V, the current is whatever the Vf bin happens to be, and a low-bin part may not light at all.
- Sharing one resistor between parallel LEDs to save a part.
Further reading
- ams-OSRAM application notes — Vf vs temperature and current curves, and the binning scheme that produces the spread.
- TI SLVA451A, Step-down LED driver with dimming — a switching constant-current driver, and the efficiency and dimming arguments that push you off a series resistor.
- STM32F103 datasheet, absolute maximum ratings — the per-pin and per-device current limits that a GPIO-driven LED has to live inside.