Free calculator

LED Resistor Calculator

An LED needs a resistor in series to limit its current. Take the LED’s forward voltage away from the supply voltage, then divide what is left by the current you want: that is the resistor in ohms. This calculator also rounds up to a standard E12 value and tells you the power rating to buy.

V

The battery or supply the LED and resistor are connected to.

V

The voltage an LED drops when it lights. Colour values are typical; your datasheet is the real answer.

A

20 mA is a common safe choice. Use less for a dimmer LED.

LEDs wired one after another share one resistor.

Result

Resistor to use (nearest E12 value, rounded up)
150 Ω
The exact value happens to be a standard E12 value.

The calculation

Voltage across the resistorsupply minus the LED voltage(s)
3 V
Exact resistance
150 Ω
Power in the exact resistor
60 mW

With the E12 resistor

Real LED current
20 mA
Power in the resistor
60 mW
Resistor rating to buyat least twice the power, so it stays cool
1/8 W
Power used by the LED
40 mW

The formula

The resistor that gives the wanted current
R=Us−n UFI\htmlData{sym=R}{R} = \dfrac{\htmlData{sym=U_s}{U_{\mathrm{s}}} - \htmlData{sym=n:leds}{n}\,\htmlData{sym=U_F}{U_{\mathrm{F}}}}{\htmlData{sym=I}{I}}
The heat the resistor has to survive
PR=I2R\htmlData{sym=P_R}{P_{\mathrm{R}}} = \htmlData{sym=I}{I}^2 \htmlData{sym=R}{R}

What each letter means

RR
Resistance (Ω · ohm) : How strongly something opposes current.
UsU_{\mathrm{s}}
Supply voltage (V · volt) : The source or supply voltage.
nn
Number of LEDs in series (no unit) : How many LEDs share one resistor, connected one after another. A count, so no unit.
UFU_{\mathrm{F}}
Forward voltage (V · volt) : The voltage a diode or LED drops when it conducts: about 0.7 V for silicon, about 2 V for a red LED. Datasheets usually write it V_F.
II
Current (A · ampere) : How much charge flows each second.
PRP_{\mathrm{R}}
Power in the resistor (W · watt)

How it works

An LED is not like a light bulb. Once the voltage across it reaches its forward voltage, the current rises very steeply, so with no resistor it would take far too much current and burn out. The resistor soaks up the voltage the LED does not use. With a 5 V supply and a red LED that drops 2 V, the resistor has to drop the other 3 V.

Resistors are sold in standard values. This page uses the E12 series (1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8 and 8.2, times ten, hundred and so on). It always rounds up to the next value, never down: a slightly bigger resistor means a slightly lower current, which is safe, while a smaller one would push the current above what you asked for.

The rating it suggests is the smallest standard size (1/8, 1/4, 1/2, 1 or 2 W) that is at least twice the power the resistor really dissipates, so it stays cool. Forward voltages are typical values that change by a few tenths of a volt between makers. If less than 0.5 V is left for the resistor, tiny differences in the supply or the LED change the current a lot, so the brightness will vary.

Worked example

  1. A 5 V supply, a red LED (typically 2 V) and a wanted current of 20 mA. The resistor must drop 5 V − 2 V = 3 V.
  2. R = 3 V ÷ 20 mA = 150 Ω. That is already an E12 value, so use 150 Ω.
  3. The resistor turns I² × R = (20 mA)² × 150 Ω = 60 mW into heat. Twice that is 120 mW, so a 1/8 W resistor is enough.
  4. Now a 12 V supply with a white LED (typically 3.2 V) at 20 mA. The resistor drops 8.8 V, so R = 8.8 V ÷ 20 mA = 440 Ω. That is not an E12 value, so go up to 470 Ω.
  5. With 470 Ω the current is 8.8 V ÷ 470 Ω = 18.72 mA, a little under 20 mA, and the resistor dissipates 164.8 mW. Twice that is 329.5 mW, so buy a 1/2 W resistor.

Common questions

Can I use a bigger resistor than the calculator says?

Yes. A bigger resistor lowers the current, so the LED is dimmer but safe. A smaller resistor raises the current above your target and can shorten the LED’s life or burn it out. That is why the calculator rounds up and never down.

Why does the resistor need a power rating?

The resistor turns the voltage it drops into heat: power = current × current × resistance. A tiny 1/8 W resistor is fine for a 20 mA indicator on 5 V, but on a high supply the same resistor would get too hot. The rating shown is at least twice the real power, so the part runs cool.

Where do I find my LED’s forward voltage?

On its datasheet, listed as the forward voltage at a test current. If you do not have one, the colour presets give typical values: about 2 V for red and orange, 2.1 V for yellow, 2.2 V for standard green and about 3 V to 3.2 V for blue, bright green and white. Blue and white LEDs need a supply well above 3.2 V.

Try it live

More calculators

All calculators · All lessons · How components work