LED current-limiting resistors

Pick a series resistor from supply voltage, LED forward voltage, and target current.

A indicator LED needs a current-limiting resistor so forward current stays within the datasheet range.

Quick calculation

R = (Vsupply − Vf) / I

Use Vf from the LED datasheet (often about 2 V for red, higher for white or blue). Target I is commonly 5–20 mA for indicators. The LED resistor calculator rounds to a practical E24 value.

Pitfalls

Do not assume 3.3 V on a 5 V-tolerant GPIO means the LED is safe without a resistor. Check peak pin current. For parallel LEDs on one resistor, each string still needs its own ballast unless you verified matched Vf.

Related