An LED sets its brightness by its current, not its voltage, so it needs a series resistor to limit that current. The resistor is the supply voltage minus the LED’s own forward drop, divided by the current you want. A red LED (about 1.8 V) on a 3.3 V rail at 5 mA wants (3.3 − 1.8) ÷ 0.005 = 300 Ω. Set your own numbers below.
Inputs
Result
300
Ω · series resistor
Nearest standard value (E24): 300 Ω
Power in the resistor
7.5 mW
The formula
R = (Vsupply − Vf) ÷ I. Subtract the LED’s forward voltage first: the LED “eats” that much, and only the leftover voltage falls across the resistor. Then it’s Ohm’s law on the resistor. Two inputs you have to get from the datasheet or pick deliberately: the forward voltage Vf (it varies by colour and part, from ~1.8 V for red up to ~3.4 V for blue and white) and the current you want.
Round up to a real part
The exact number is rarely a stocked value, so the calculator snaps it to the nearest E24standard (the 5% preferred-value series, IEC 60063). It rounds UP, which means a slightly higher resistance and a touch less current. That is the safe direction: a little dimmer beats over a limit. For an indicator you will not notice the difference between 300 Ω and 330 Ω.
From a real board
The OTD L1.01 ESP32-S3 board carries a power indicator LED off its 3.3 V rail, sized with exactly this calculation (One Thousand Drones, L1.01 design 2026). Indicator LEDs are comfortable at 2 to 10 mA, well under the 20 mA a typical 5 mm part is rated for, and dimmer LEDs draw less and read fine on a board you look at up close.
Check the resistor’s power
The resistor burns (Vsupply − Vf) × I. For an indicator that is a few milliwatts, so any 0402/0603 part is fine. It matters at higher currents: a 5 V rail driving 20 mA burns 60 mW in the resistor, so pick a part rated for at least twice the dissipation.
When a resistor is the wrong tool
A series resistor suits indicators. It is a poor fit for a high-power LED: the resistor wastes real power as heat, and the current drifts as the LED warms and its forward voltage falls. Power LEDs want a constant-current driver that holds the current steady regardless. That is a different board entirely. See the power-LED driver course.
References
- Your LED’s datasheet for the forward voltage Vf and the absolute-maximum current.
- IEC 60063 preferred values (the E12/E24/E96 resistor and capacitor series).
- One Thousand Drones. ESP32-S3 USB-C breakout (L1.01), indicator LED. Build the board.