ElectronicsInfoline

Calculators

LED resistor calculator

By Bulan Sarkar

Enter the supply, the LED and the current you want. You get the exact resistor, the next standard value up, the current that value really gives, and the wattage the resistor needs. Strings of LEDs in series work too.

Share this calculator
V
V

Typical figure. The datasheet's value at your current is better.

mA
Standard values from
5 V+220 Ω3 V across it2 V13.6 mAthe resistor takes whatever voltagethe LEDs leave over, and thatsets the current round the loop
Resistor (E12, next value up)
220 Ω
exact value 200 Ω
Current you get
13.6 mA
13.2 mA to 14.1 mA if each LED's forward voltage is 0.1 V off
Resistor power
40.9 mW
use a ⅛ W part or bigger
Power in each LED
27.3 mW
Total from the supply
68.2 mW
Reaches the LEDs
40 %
the rest warms the resistor

Quick answer

Take the LED's forward voltage away from the supply and divide by the current: R = (Vs − Vf) / I. A red LED at 10 mA on 5 V works out at 300 Ω, so you'd fit 330 Ω, the next standard value up.

The formula

R = (Vsupply − n × Vf) / I

An LED holds its forward voltage, Vf, fairly steady over a wide range of current, and it has almost no resistance of its own above that. Connect one straight across a supply above Vf and the current climbs until something burns. The series resistor takes whatever voltage is left over, and Ohm's law turns that leftover voltage into a current. With n LEDs in the string, each one takes its own Vf out of the supply first.

5 V330 Ω3.0 VLED2.0 Vcurrent 9.09 mA
Figure 1. The LED holds about 2 V. The resistor takes the other 3 V, and that sets the current.
12 V3.1 VLED3.1 VLED3.1 VLED2.7 Vresistor3 × 3.1 V = 9.3 V
Figure 2. Three white LEDs on 12 V leave the resistor only 2.7 V to work with. That thin margin is why the current is so sensitive to Vf.

The calculator rounds up to the next standard value, never down, so the real current lands at or a little below the one you asked for. It then works out the power in the resistor, I²R, and suggests a rating at least twice that. A resistor run at its full rating is hot enough to hurt and drifts; half its rating is the usual rule.

The forward voltages in the list are typical figures for ordinary 3 mm and 5 mm LEDs: about 2.0 V for red, about 3.1 V for white and blue. Real parts vary by a tenth of a volt or more between samples, and the current range under the result shows what that does. The LED lesson explains why colour sets the voltage, and LED circuits covers strings, parallel LEDs and PWM dimming.

16 mA20 mA20 mA target0
Figure 3. The same resistor and three LEDs, with 0.1 V of spread on each. With little headroom, small voltage differences become large current differences.
Red2 VOrange / amber2.1 VYellow2.1 VYellow-green2.2 VTrue green3.1 VBlue3.1 VWhite3.1 VInfrared1.3 V
Figure 4. The typical forward voltages the calculator uses. Blue and white need the most voltage.

Worked example in numbers

Exact resistor
300 Ω
Standard value
330 Ω
Real current
9.09 mA
Resistor power
27.3 mW

Worked examples

A red LED on a 5 V pin

A red LED at about 2.0 V, driven at 10 mA from 5 V. The resistor sees 5 − 2.0 = 3.0 V, and 3.0 V / 10 mA = 300 Ω. That is not in E12, so take the next value up, 330 Ω.

With 330 Ω the current is 3.0 V / 330 Ω = 9.09 mA, a little under the target. You will not see the difference in brightness. The resistor dissipates 27.3 mW, so an ⅛ W part is plenty, and the LED itself takes 18.2 mW.

Three white LEDs in series on 12 V

Three white LEDs at about 3.1 V each need 3 × 3.1 = 9.3 V between them. At 20 mA from 12 V, the resistor gets the other 2.7 V: 2.7 V / 20 mA = 135 Ω. The next E12 value up is 150 Ω, which gives 18 mA and dissipates 48.6 mW; an ⅛ W resistor covers it.

77.5 % of the power reaches the LEDs, much better than three separate LEDs each with its own resistor on 12 V. The catch is the small headroom. If each LED lands 0.1 V away from 3.1 V, the current runs from 16 mA to 20 mA. A fourth LED would need 12.4 V, more than the supply, and the calculator refuses it.

Several LEDs in parallel

Give each LED, or each series string, its own resistor. Two LEDs sharing one resistor do not share the current evenly: the one with the slightly lower forward voltage takes more, runs hotter, drops lower still and takes more again. The current limiting lesson covers why a resistor is the simplest limit, and resistor power rating covers what the wattage figure means for a part on a real board.

✗ wrongR✓ rightRR
Figure 5. Give each LED or string its own resistor. On a shared resistor, the LED with the lower Vf takes most of the current.

Tips and tricks

  • Measure the current without breaking the circuit: read the voltage across the resistor and divide by its value. 2.9 V across 330 Ω is 8.8 mA.
  • Treat 20 mA as the datasheet's test current, not a target. Most modern 3 mm and 5 mm indicator LEDs are bright enough at 2 to 5 mA, and a lower current also keeps a microcontroller pin well inside its limit.
  • Size the resistor for the highest supply voltage, not the nominal one. A car's "12 V" sits nearer 14 V with the engine running, and the current rises with it.
  • Check the polarity before you blame the resistor. The longer leg is the anode, and the flat on the rim marks the cathode. A reversed LED stays dark, and many are only rated for about 5 V in reverse.
  • With unmarked LEDs from a mixed bag, measure Vf first: put the LED in series with 1 kΩ on 5 V and read the voltage across it. Then use that figure here instead of the colour preset.

What we would do

For an indicator on a 5 V or 3.3 V board, we would use an ordinary 5 mm LED at 5 to 10 mA with the quarter-watt resistor this calculator gives, rounded up. For strings on 12 V, keep at least a volt or two across the resistor so the current doesn't swing with Vf. For 1 W LEDs, or a supply that wanders, skip the resistor and use a constant-current driver or the LM317 as a current limiter.

A box of 1 % metal-film resistors covering the E12 range is worth having before you start. Hobby electronics shops in India sell them, and so do Digi-Key, Mouser and LCSC elsewhere.

Questions people ask

What resistor do I need for an LED on 5 V?

For a red LED (about 2.0 V) at 10 mA: (5 − 2.0) / 0.01 = 300 Ω, so fit 330 Ω, the next standard value up. Blue and white LEDs need about 3.1 V, which leaves less for the resistor, so the value comes out smaller.

What resistor do I need for an LED on 12 V?

One white LED at about 3.1 V and 20 mA needs (12 − 3.1) / 0.02 = 445 Ω. The next E12 value up is 470 Ω, and it dissipates 169 mW, so use a resistor rated ½ W. On 12 V it is usually better to put two or three LEDs in series on one resistor, which wastes less power.

Can several LEDs share one resistor?

In series, yes: one resistor sets the current for the whole string. In parallel, no. The LED with the lowest forward voltage takes most of the current, so give each LED or each string its own resistor.

What happens if I connect an LED without a resistor?

On a supply above its forward voltage, nothing limits the current and the LED burns out, sometimes in a fraction of a second. LEDs sold as 5 V or 12 V types have the resistor built in; ordinary 3 mm and 5 mm LEDs do not.

What wattage resistor does an LED need?

Work out I² × R and pick a rating at least twice that. A red LED at 10 mA on 5 V puts only 27.3 mW into its resistor, so an ordinary quarter-watt part is plenty. Strings on 12 V or 24 V at 20 mA and more are where the wattage starts to matter.

One email a month from the bench

New circuits, lessons, part guides and calculators, on the first Sunday of each month.

We'll send one email to confirm. Every email has a one-click unsubscribe. Privacy policy

Lessons behind this calculator

Author: Bulan Sarkar · Report an error

The calculation runs in your browser, so the results change as you type. The formulas are the same ones the lessons are checked against. Other calculators are on the calculators page.

For practice: the DC Circuits Workbook has 100 graded problems, LED resistors and dividers among them, each with a worked solution.