LED Resistor Calculator: Series Resistor Value, Wattage and Current for LEDs
By FindMySum · Last reviewed
A light-emitting diode is one of the simplest parts to wire up, and one of the easiest to destroy. Connect it directly to a battery and it can draw enough current to burn out almost instantly. The fix is a single resistor in series with the LED, and choosing it is a short exercise in Ohm's law. This calculator works out the exact resistance, rounds it to a resistor you can buy, and tells you the current you will really get, how much heat the resistor makes and how efficient the circuit is. The opening example is a red LED on a 5 V USB supply at 20 mA.
Why the resistor is needed
An ordinary resistor follows Ohm's law: double the voltage and the current doubles. An LED doesn't. Below its forward voltage (about 2 V for a red LED, about 3 V for blue and white) almost no current flows. Just above it, the current rises steeply, so a change of a few tenths of a volt can be the difference between a dim glow and a dead part. A small change in temperature shifts the curve too.
That makes it impractical to set an LED's current by choosing the supply voltage. Instead, you give the LED a little more voltage than it needs and let a resistor take up the difference. The resistor's voltage, and therefore the current, is set by Ohm's law, and it changes only gently if the LED's forward voltage wanders.
The formula
For n LEDs in series, each with forward voltage Vf, on a supply Vs, at the current I you want:
R = (Vs − n × Vf) ÷ I
The top of the fraction is the voltage left for the resistor. For the default example, one red LED at about 2.0 V on 5 V at 20 mA:
R = (5 − 2.0) ÷ 0.020 = 3.0 ÷ 0.020 = 150 Ω
Use amps in the formula (20 mA = 0.020 A) and the answer comes out in ohms.
The resistor turns its share of the power into heat:
P = I² × R = (Vs − n × Vf) × I
Here that is 0.020² × 150 = 0.06 W. Resistors are sold by power rating, and a common rule is to choose one rated for at least twice the power it will dissipate so it runs cool and lasts. Twice 0.06 W is 0.12 W, so a 1/8 W (0.125 W) part is enough, and the ubiquitous 1/4 W resistor has plenty of margin.
Rounding to a real resistor
Resistors come in preferred values defined by IEC 60063. The E12 series has twelve values per decade (10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68 and 82, then 100, 120 and so on); E24 has twenty-four, adding values such as 11, 13, 16, 20, 24, 30, 36, 43, 51, 62, 75 and 91; E96 has ninety-six for 1% parts. The exact answer rarely lands on one of them.
Round up. A larger resistor gives a little less current and a little less light, which is hard to see; a smaller one pushes the LED beyond the current you chose. For a blue LED (about 3.2 V) on a 9 V battery, the exact value is (9 − 3.2) ÷ 0.020 = 290 Ω. The next E24 value up is 300 Ω, giving 5.8 ÷ 300 = 19.3 mA; the next E12 value is 330 Ω, giving 17.6 mA. Both are fine. The calculator shows the chosen value and its neighbours with the current each would give.
Strings of LEDs
When LEDs are wired one after another, the same current flows through each, so their forward voltages add and a single resistor sets the current for the whole string. Three white LEDs at 3.2 V each need 9.6 V; on a 12 V supply the resistor drops the remaining 2.4 V, and at 20 mA that is 2.4 ÷ 0.020 = 120 Ω. That resistor dissipates only 0.048 W, compared with 0.18 W if each LED had its own resistor on 12 V.
Don't push a string too close to the supply voltage. If the LEDs need 11.5 V of a 12 V supply, the resistor has only 0.5 V to work with, and a small change in the supply or in Vf makes a large change in the current. Leaving 10 to 20 percent of the supply across the resistor keeps things predictable. If the LEDs need more than the supply, they won't light properly at all, and the calculator says so.
For more LEDs than one string can take, wire several identical strings in parallel, each with its own resistor. Enter the number of strings and the calculator adds up the supply current and power. Avoid putting LEDs in parallel on one shared resistor: their forward voltages are never exactly equal, so the LED with the lowest Vf takes most of the current.
Efficiency
The resistor's power is wasted as heat. The fraction of the supply power that reaches the LEDs is:
efficiency = n × Vf ÷ Vs
One red LED on 5 V is only 40 percent efficient; three white LEDs on 12 V reach 80 percent. That is why designers group LEDs into strings close to the supply voltage, and why battery-powered lights and high-power LEDs use switching constant-current drivers instead of resistors.
Choosing the forward voltage and current
Datasheets give the forward voltage at a test current, usually as a typical value and a maximum. As a starting point:
| LED | Typical Vf at 20 mA |
|---|---|
| Red, orange | about 2.0 V |
| Yellow | about 2.1 V |
| Green (InGaN), blue, white | about 3.2 V |
| Infrared (940 nm) | about 1.3 V |
Older "traditional" green LEDs made from gallium phosphide run at about 2.2 V, so check which kind you have. For the current, 20 mA is the classic rating of 3 mm and 5 mm indicator LEDs, but modern high-efficiency parts are bright at 5 to 10 mA, and running below the maximum extends their life. Never exceed the absolute maximum current on the datasheet.
If you don't know your LED's forward voltage, light it with a generous resistor (1 kΩ on 5 V), measure the voltage across it with a multimeter and use that as a custom value.
Limits of the calculation
The calculation treats the forward voltage as fixed. In reality Vf rises a little with current and falls as the LED warms (by roughly 2 mV per °C), and it varies from part to part, so the actual current can differ by a few percent from the figure shown. Resistor tolerance (5 percent for E24 parts) adds a similar uncertainty. For indicator LEDs this doesn't matter. For power LEDs rated at hundreds of milliamps or more, use a constant-current driver and treat the result here as a rough guide only.
More questions
Can I run an LED straight from a 3 V coin cell without a resistor?
Often it works, because a CR2032 coin cell has a high internal resistance (tens of ohms) that limits the current, and its 3 V is close to a white LED's forward voltage. That internal resistance is doing the job of the series resistor. On any stiff supply, such as a bench supply, USB or a lithium-ion pack, always add the resistor.
Why does my LED look dim with the calculated resistor?
Check the forward voltage. If your LED's real Vf is higher than the value you entered, less voltage is left for the resistor and the current is lower than planned. Measure the voltage across the LED while it is lit and enter that as a custom Vf. Some LEDs are also simply rated for less light at 20 mA than others.
Does it matter which side of the LED the resistor goes on?
No. In a series circuit the same current flows through every part, so the resistor can go on the anode side or the cathode side. Putting it on the positive side is a common habit, and in a matrix or multiplexed display the layout decides, but the current is the same.
What is the difference between E12 and E24 resistors?
They are sets of preferred values defined by IEC 60063. E12 has 12 values per decade (10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82) for 10% parts; E24 adds the in-between values such as 11, 13, 16 and 20 for 5% parts, and E96 has 96 values for 1% parts. Hobby kits usually stock E12 or E24.
Can I use a resistor on an LED strip?
Most 12 V and 24 V LED strips already have resistors built in, one for each group of three or six LEDs, and run straight from the rated supply. Adding another resistor only dims them. This calculator is for bare LEDs and for designing your own strings.
Sources
- Kingbright WP7113SECK/J3 5 mm LED datasheet (forward voltage at IF = 20 mA)
- Kingbright WP7113NT 5 mm LED datasheet (forward voltage at IF = 20 mA)
- IEC 60063:2015 Preferred number series for resistors and capacitors
- P. Horowitz and W. Hill, The Art of Electronics, 3rd edition (Cambridge University Press, 2015)
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.