What size resistor do I need for an LED, and how do I calculate it?
Use R = (Vs − Vf) ÷ I. For a red LED with a typical forward voltage of 1.95 V on a 5 V supply at 20 mA, R = (5 − 1.95) ÷ 0.02 = 152.5 Ω. Round up to the next standard value, 160 Ω, which gives 19.1 mA and dissipates 58.1 mW in the resistor.
LED resistor formula
An LED holds a roughly fixed voltage across itself once it conducts, so the resistor has to drop the rest of the supply. Its value sets the current.
R = (Vs − Vdrop − n × Vf) ÷ I
- R
- series resistance in Ω
- Vs
- supply voltage in V
- Vdrop
- voltage lost in a driver transistor or pin, 0 if none
- n
- number of LEDs in series in the string
- Vf
- forward voltage of one LED at the design current
- I
- LED current in A
Once you round R to a standard value, the current it actually gives and the power in each part follow from the same voltages:
I = (Vs − Vdrop − n × Vf) ÷ R P(R) = I² × R P(LED) = Vf × I
The share of the supply power that reaches the LEDs is n × Vf ÷ Vs, so a long string on a supply just above its forward voltage is efficient, and a single LED on 24 V mostly heats the resistor. With several strings in parallel, each one has its own resistor and the supply current is the sum of the string currents.
Worked examples
Example 1: a red LED on 5 V at 20 mA
R = (5 − 1.95) ÷ 0.02 = 152.5 Ω. The next E24 value is 160 Ω, which gives 19.1 mA. The resistor drops 3.05 V and dissipates 58.1 mW, so with a 2× margin the smallest chip is 0805 (2012 metric), 1/8 W. If the LED is at its 2.5 V datasheet maximum, the current is 15.6 mA.
Example 2: Broadcom AN 1005, an LED switched by a transistor
The note drives a lamp at 42 mA from 5 V through a transistor with 0.1 V saturation, where Vf = 1.95 V. R = (5 − 0.1 − 1.95) ÷ 0.042 = 70.24 Ω. The note uses 70 Ω, which dissipates 123 mW at 42 mA, and specifies a 1/4 W part for the 2× margin. Rounding up to E24 instead gives 75 Ω, 39.3 mA and 116 mW.
Example 3: white LEDs on 12 V, three or two per string
Three white LEDs at 3.3 V typical leave 2.1 V for the resistor, giving 110 Ω. But the datasheet maximum is 4 V, and three such parts need the full 12 V, so the current can fall to zero. With two LEDs per string, R = 270 Ω gives 20 mA typical and still 14.8 mA with maximum-Vf parts.
LED resistor values for common supplies at 20 mA
One LED per resistor, E24 value at or above the exact result, using the typical forward voltages of the Kingbright WP7113 5 mm family. * marks values where a maximum-Vf part would get less than half the current.
| LED (typ. Vf) | 3.3 V | 5 V | 9 V | 12 V | 24 V |
|---|
| Red (AlGaInP, 630 nm), 1.95 V | 68 Ω | 160 Ω | 360 Ω | 510 Ω | 1.2 kΩ |
| Yellow (AlGaInP, 590 nm), 2.00 V | 68 Ω | 150 Ω | 360 Ω | 510 Ω | 1.1 kΩ |
| Yellow-green (GaP, 568 nm), 2.20 V | 56 Ω | 150 Ω | 360 Ω | 510 Ω | 1.1 kΩ |
| Green (InGaN, 525 nm), 3.20 V | 5.1 Ω * | 91 Ω | 300 Ω | 470 Ω | 1.1 kΩ |
| Blue (InGaN, 465 nm), 3.30 V | no headroom | 91 Ω | 300 Ω | 470 Ω | 1.1 kΩ |
| White (InGaN), 3.30 V | no headroom | 91 Ω | 300 Ω | 470 Ω | 1.1 kΩ |
| Infrared (940 nm), 1.20 V | 110 Ω | 200 Ω | 390 Ω | 560 Ω | 1.2 kΩ |
Resistor power and size for one red LED at 20 mA
The higher the supply, the more power the resistor burns. Sizes are the smallest Yageo RC_L chip with at least twice the dissipation as its 70 °C rating.
| Supply | Resistor (E24) | LED current | Resistor power | Chip size | Efficiency |
|---|
| 3.3 V | 68 Ω | 19.9 mA | 26.8 mW | 0402, 1/16 W | 59 % |
| 5 V | 160 Ω | 19.1 mA | 58.1 mW | 0805, 1/8 W | 39 % |
| 9 V | 360 Ω | 19.6 mA | 138 mW | 1210, 1/2 W | 22 % |
| 12 V | 510 Ω | 19.7 mA | 198 mW | 1210, 1/2 W | 16 % |
| 24 V | 1.2 kΩ | 18.4 mA | 405 mW | 2512, 1 W | 8 % |
Preset LED data
The presets in this LED calculator use the typical and maximum forward voltage at 20 mA and 25 °C, and the absolute maximum DC current, from each Kingbright datasheet.
| LED | Part | Vf typ. | Vf max. | Max DC current |
|---|
| Red (AlGaInP, 630 nm) | WP7113SURCK | 1.95 V | 2.5 V | 30 mA |
| Yellow (AlGaInP, 590 nm) | WP7113SYD | 2 V | 2.5 V | 30 mA |
| Yellow-green (GaP, 568 nm) | WP7113SGD | 2.2 V | 2.5 V | 25 mA |
| Green (InGaN, 525 nm) | WP7113ZGC/G | 3.2 V | 4 V | 30 mA |
| Blue (InGaN, 465 nm) | WP7113QBC/D | 3.3 V | 4 V | 30 mA |
| White (InGaN) | WP7113QWC/D | 3.3 V | 4 V | 30 mA |
| Infrared (940 nm) | WP7113F3C | 1.2 V | 1.6 V | 50 mA |
What goes wrong with LED resistors
The formula treats Vf as a constant, but it is not: it rises with current, falls as the LED warms (−1.9 mV/°C for the Kingbright red part, −3.0 mV/°C for the white and blue ones), and varies from part to part, which is why datasheets give a typical and a maximum value. When the resistor drops only a volt or two, those changes move the current a lot; when it drops several volts, they hardly matter. A microcontroller pin is not an ideal source either: its output voltage sags as it sources current (enter that loss as the driver drop), and the pin has its own current limit. Do not put LEDs in parallel on one resistor. For high-power LEDs or long strings near the supply voltage, a constant-current driver holds the current regardless of Vf and wastes far less power than a resistor.
Glossary
- Forward voltage (Vf)
- The voltage across a conducting LED at a stated current. Datasheets give a typical and a maximum value.
- Current-limiting resistor
- The series resistor that sets the LED current by dropping the voltage the LED does not use.
- Headroom
- The voltage left across the resistor: supply minus driver drop minus the LEDs’ forward voltages.
- String
- LEDs in series sharing one current and one resistor.
- Absolute maximum rating
- A limit that must not be exceeded, such as the maximum DC forward current at 25 °C.
- Driver drop
- Voltage lost in a transistor or logic output in series with the LED, for example its saturation voltage.
- E24 series
- The 24 standard resistor values per decade defined in IEC 60063, laid out for 5 % parts.
Frequently asked questions
How do you calculate an LED resistor value?
R = (Vs − Vf) ÷ I: subtract the LED's forward voltage from the supply and divide by the current you want. A red LED (1.95 V typical) on 5 V at 20 mA needs (5 − 1.95) ÷ 0.02 = 152.5 Ω; round up to the next standard value, 160 Ω.
What is a current-limiting resistor for LED circuits?
The series resistor that sets the LED current. An LED holds a roughly fixed voltage across itself once it conducts, so the resistor drops the rest of the supply. The current-limiting resistor formula follows from that: R = (Vs − Vf) ÷ I.
What resistor do I need for an LED on 5 V?
At 20 mA, 160 Ω for a typical red LED and 91 Ω for a typical white or blue one (E24 values at or above the exact result). Check the forward voltage in your LED's datasheet, because it sets the answer.
What resistor do I need for an LED on 3.3 V?
68 Ω for a red LED at 20 mA. A white or blue LED with a typical forward voltage of 3.3 V leaves nothing for a resistor on 3.3 V, so run it from 5 V, at a lower current where its forward voltage is lower (read the datasheet curve), or with a constant-current driver.
What resistor do I need for an LED on 12 V?
510 Ω for one red LED at 20 mA. It dissipates 198 mW, so with a 2× margin use a 1210 (3225 metric), 1/2 W resistor. Putting three or four red LEDs in series on 12 V wastes much less power in the resistor.
Can several LEDs share one resistor?
LEDs in series can, because the same current flows through all of them. LEDs in parallel should not: their forward voltages differ from part to part, so the one with the lowest Vf takes most of the current. Give each parallel string its own resistor.
How do I size the resistor for several LEDs in series?
Subtract every forward voltage: R = (Vs − Vdrop − n × Vf) ÷ I, with n in the “LEDs in series per string” field. Two white LEDs (3.3 V typical) on 12 V at 20 mA need 270 Ω, which gives 20 mA.
Why round the resistor up rather than to the nearest value?
A larger resistor gives a slightly lower current, which keeps the LED at or under the current you chose and under its maximum rating. Light output falls roughly in proportion to current, so 19 mA instead of 20 mA is about 5 % dimmer.
What wattage resistor do I need for an LED?
P = I² × R. Broadcom's LED application note AN 1005 rates the resistor at twice its dissipation. A red LED on 5 V with 160 Ω dissipates 58.1 mW in the resistor, so the smallest chip with that margin is 0805 (2012 metric), 1/8 W.
Why is my LED current different from the calculation?
The forward voltage varies between parts and with temperature. The Kingbright WP7113SURCK red LED is 1.95 V typical but up to 2.5 V, which on 5 V with 160 Ω lowers the current from 19.1 mA to 15.6 mA. The more voltage the resistor drops, the less these variations matter.
More free PCB tools
See all free electronics tools →
- Series and parallel resistor calculatorTotal resistance of up to eight resistors in parallel or series, or the resistor to add in parallel to reach a target.
- Ohm's law calculatorEnter any two of voltage, current, resistance and power to get the other two, with metric prefixes.
- Standard resistor values (E-series) finderNearest E3 to E192 standard value above, below and closest to any number, with the full E-series tables.
- Voltage divider calculatorOutput voltage, or the resistor pair for a target voltage using real E24 and E96 values, with load effects.
- Capacitive reactance calculatorReactance of a capacitor at any frequency, or the capacitance for a reactance, with ESR and a reactance-versus-frequency plot.
- Resistor color code calculatorRead 4, 5 and 6-band resistors, or find the bands for a value. SMD 3-digit, 4-digit and EIA-96 codes too.
Design the whole board, not one number
ProtoFlow is free AI PCB design software: describe a circuit and get a schematic with real parts, PCB layout with an autorouter, SPICE simulation and Gerber files. Native KiCad, Altium and EAGLE import and export. Free on macOS, Windows and Linux.