Analog Electronics

How to Calculate an LED Resistor

Step-by-step guide to calculating the correct resistor value for LED indicator circuits.

Why LEDs need resistors

An LED is a current-driven component. Without current limiting, the LED may draw too much current and fail.

Formula

The common formula is R = (Vsupply - Vf) / I.

Example

For a 5 V supply, a 2 V red LED and 20 mA current, the resistor is (5 - 2) / 0.02 = 150 Ω.

Power rating

The resistor also dissipates power. In the example, P = I² × R = 0.06 W.

Practical design notes

For high-power LEDs, use a constant-current LED driver instead.

Use the calculator

Try the related tool and calculate your own values instantly.

Open LED Resistor Calculator