LED resistor.
Pick a supply, drop, and target current. Get the series resistor for N LEDs — plus power and a standard-value rounding.
Typical Vf by LED color
| Color | Vf (≈20 mA) |
|---|
Approximate values. Always verify with your LED's datasheet at your operating current and temperature.
Sizing an LED resistor
An LED needs something to limit its current: above its forward voltage (Vf) a tiny increase in voltage makes the current shoot up. A series resistor drops whatever supply voltage the LEDs don't use, and that sets the current.
R = (Vs − N × Vf) / I and the resistor dissipates
P = I² × R.
Example. Three white LEDs (Vf ≈ 3.2 V each) in series on 12 V at
20 mA: (12 − 3 × 3.2) / 0.020 = 120 Ω, which is a standard E12 value.
The resistor dissipates 0.020² × 120 = 0.048 W (the calculator shows
48 mW), and it suggests a rating of at least 125 mW (⅛ W), about twice the
real dissipation.
Gotcha: Vf isn't a constant. It varies by color (about 2.0 V for red and 3.2 V for blue or white, see the table above) and from part to part. In the example only 2.4 V is left for the resistor, so if those LEDs are really 3.0 V each the current rises to 25 mA, and at 3.3 V each it falls to 17.5 mA. Leave more headroom (fewer LEDs per string) or use a constant-current driver when brightness has to match.
Questions people actually ask
What resistor do I need for an LED on 5 V?
For a red LED (Vf about 2.0 V) at 20 mA: (5 − 2.0) / 0.020 = 150 Ω. For a blue or white LED (Vf about 3.2 V) at 20 mA: (5 − 3.2) / 0.020 = 90 Ω, so round up to the next standard value, 100 Ω.
Can several LEDs in parallel share one resistor?
It's not a good idea. Small differences in forward voltage mean one LED takes more than its share of the current, runs brighter and hotter, and fails first. Give each LED, or each series string, its own resistor.
Why round the resistor up to an E-series value?
Rounding up keeps the current at or below your target. In the 5 V blue LED example, 90 Ω rounds up to 100 Ω, which gives 1.8 V / 100 Ω = 18 mA instead of 20 mA, a difference you won't see.
How much current should an LED get?
Check the datasheet. Many standard 5 mm indicator LEDs are rated around 20 mA continuous, and modern high-efficiency LEDs are often plenty bright at 5 to 10 mA, which also saves power.
Does the resistor go on the anode or the cathode side?
Either. In a series circuit the same current flows through every part, so the resistor limits it equally well on either side of the LED.
Can I run a white LED from 3.3 V with a resistor?
Barely. With a Vf around 3.2 V, only about 0.1 V is left across the resistor, so the current swings a lot with small changes in Vf or supply. Use a higher supply voltage or a constant-current LED driver.