LED Resistor Calculator

Enter the supply voltage, the LED's forward voltage and current, and how many LEDs are in series.

From the LED's data sheet. Typical values at 20 mA: red 1.8 V, amber 2.0 V, yellow 2.2 V, blue 3.6 V (Electronics Tutorials).
Electronics Tutorials: common LEDs have "a nominal forward current rating of about 10 to 30 mA, with 12 to 20 mA being the most common range". The data sheet gives the rated maximum.
Resistor rating ÷ dissipated power; at least 2 is common practice.

Standard E12 resistor (next value up)

390 Ω

Resistor wattage rating

1/2 W

Calculated resistance

350 Ω

Current with the E12 resistor

17.95 mA

Resistor power at the LED current entered

140 mW

Minimum rating (power × margin)

280 mW

Total LED forward voltage

2 V

How it works

An LED drops a nearly fixed forward voltage Vf once it conducts, and its current rises steeply with any extra voltage, so it needs something to set the current. A series resistor does that: it takes the voltage left over, Vs − n × Vf for n LEDs in series, and by Ohm's law passes I = (Vs − n × Vf) ÷ R.

Solving for R at the LED current wanted gives the calculated resistance. Resistors are sold in preferred values; the calculator picks the next E12 value up (IEC 60063), so the actual current comes out at or a little below the current entered, and shows that current.

The resistor dissipates the leftover voltage times the current, P = (Vs − n × Vf) × If, worked out at the current entered (the E12 resistor, passing a little less current, dissipates no more). The rating margin multiplies that power, and the smallest common wattage rating at least that large is shown.

Formula

R = (Vs − n × Vf) ÷ If
R(E12) = smallest of 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82 × 10^k that is ≥ R
I(actual) = (Vs − n × Vf) ÷ R(E12)
P = (Vs − n × Vf) × If;   minimum rating = P × margin

Example

One LED with a 2 V forward voltage at 20 mA from a 9 V supply needs (9 − 2) ÷ 0.02 = 350 Ω. The next E12 value is 390 Ω, which passes 7 ÷ 390 = 17.95 mA. The resistor dissipates 7 × 0.02 = 140 mW; twice that is 280 mW, so the rating shown is 1/2 W.

Three LEDs of 1.2 V each from 5 V at 10 mA leave 5 − 3.6 = 1.4 V for the resistor: 140 Ω, rounded up to 150 Ω (9.33 mA).

Assumptions and limitations

  • The forward voltage is treated as constant. A real LED's Vf varies with current, temperature and between parts of the same type, so the actual current differs somewhat from the calculated one.
  • Typical forward voltages in the help text are from Electronics Tutorials' LED characteristics table (2026), at 20 mA; the LED's data sheet gives the value for a specific part.
  • The supply is a steady DC voltage. A battery's voltage falls as it discharges, and the current falls with it.
  • LEDs in series share one current. LEDs in parallel on one resistor are not modelled.
  • Resistor tolerance (±10 % for E12 parts) shifts the current by about the same proportion.
  • The listed wattage ratings and the 2× margin are common practice, not a standard. This is an estimate for circuit design and learning, not a substitute for the LED's and resistor's data sheets.

Frequently asked questions

Why round the resistor up rather than to the nearest value?

A larger resistor passes less current, so rounding up keeps the LED at or below the current entered. Rounding down to the nearest value can push the current above it.

What happens without a resistor?

Above its forward voltage an LED's current rises steeply with voltage, so on a supply above Vf nothing but the supply's own limits sets the current. Electronics Tutorials' example puts an LED with a 2 V drop on 5 V through only 100 Ω and gets 30 mA instead of 10 mA.