LED Resistor Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 12/5/2026
The LED resistor is R = (supply voltage − LED voltage) ÷ I. For a 2 V red LED on a 5 V supply at 20 mA: (5 − 2) ÷ 0.020 = 150 Ω, dissipating 0.06 W.
Explanation
An LED is never connected straight to a power supply: once its threshold voltage is reached, the current through it rises very fast and destroys it within moments. So a resistor is placed in series to set the current. Its calculation relies on Ohm's law. The LED takes a roughly constant voltage, its forward voltage, shown in the datasheet: around 2 V for a red LED, more like 3 V for a white or blue one. The rest of the supply voltage appears across the resistor, which must let the desired current through: R = (supply voltage − n × LED voltage) ÷ I. With a 2 V LED on 5 V at 20 mA, 3 V remain and R = 3 ÷ 0.020 = 150 Ω. Several identical LEDs in series share a single resistor, provided the sum of their voltages stays below the supply: three 3 V white LEDs on 12 V leave 3 V, again 150 Ω. If the sum exceeds the available voltage, the LEDs don't light up and the calculator shows no result. Then pick the next standard value up (E12 series: 150, 180, 220, 270, 330, 390, 470 Ω…), which slightly reduces the current, and a power rating at least twice the calculated dissipation: a 0.25 W resistor is ample for 0.06 W. For LEDs in parallel, use one resistor per branch. To revisit the relationship between voltage, current and resistance, use the Ohm's law calculator; to combine several resistors, the equivalent resistance calculator.
Example: a red LED on a 5 V USB port
Inputs
Supply: 5 V. LED: 2 V. 1 LED. Current: 20 mA.
Calculation
Voltage across the resistor = 5 − 1 × 2 = 3 V. R = 3 ÷ (20 ÷ 1,000) = 150 Ω. Power = 3 × 0.020 = 0.06 W.
Result
Use a 150 Ω resistor (or the next value up, 180 Ω) rated 0.25 W.
Frequently asked questions
What if I use a higher resistance?
The current drops and the LED is a little dimmer, with no risk to it. That is why you always round up to the next standard value rather than down.
Can one resistor serve several LEDs in parallel?
Not recommended: LEDs never have exactly the same forward voltage, and the one with the lowest draws more current, heats up and ages faster. Use one resistor per LED or per series branch.
What about a power LED or an LED strip?
High-power LEDs are better driven by a constant-current driver, more efficient than a resistor. LED strips already include their resistors and connect to the stated voltage, often 12 or 24 V.