An LED needs a resistor in series to limit its current; without one it burns out almost instantly. Pick the supply voltage, the LED color and the current you want, and you get the resistor value, the nearest standard value you can buy and the wattage it needs.
It also handles several LEDs in series, and shows the resistor's color bands so you can find it in your parts drawer.
How to use
- Pick the supply voltage: 3.3 V or 5 V for an Arduino or ESP32, 12 V for cars and LED strips, or type your own.
- Pick the LED color; it sets the typical forward voltage. If you have the datasheet, type the exact value.
- Pick the current. 20 mA is the classic maximum for 5 mm LEDs; 5 to 10 mA is plenty for an indicator and makes the LED last longer.
- Use the standard value shown. It's rounded up, so the current stays at or below what you chose.
LED resistor formula
R = (supply voltage − LED voltage × number of LEDs) ÷ current. For a red LED (2 V) at 20 mA on 5 V: (5 − 2) ÷ 0.020 = 150 Ω. The resistor dissipates (5 − 2) × 0.020 = 0.06 W, so a standard 1/4 W resistor is more than enough.
LEDs in series and in parallel
In series, the LED voltages add up and one resistor serves the whole string, as long as the supply is higher than the total. In parallel, give each LED its own resistor: LEDs never share current evenly, and the one with the lowest voltage hogs most of it.
LED forward voltage by color
Red about 2.0 V, orange and yellow 2.1 V, classic green 2.2 V; blue, white and true green 3.0 to 3.4 V; infrared 1.2 to 1.5 V; UV around 3.4 V. These vary by manufacturer, so the datasheet always wins.