LED Resistor Calculator — With E24 Values and Power Rating
Who this is for: For anyone blinking an LED from a microcontroller: the two things that go wrong are picking a resistor you can't buy and forgetting the resistor will dissipate real heat.
Series resistor for one or more LEDs: enter supply, forward voltage and target current to get the exact resistance, the nearest E24 value to buy, actual current and the power rating you need.
Quick answer: R = (supply voltage − LED forward voltage × LED count) ÷ target current in amps. A red LED (2.0 V, 10 mA) on a 3.3 V GPIO: R = (3.3 − 2.0) ÷ 0.01 = 130 Ω — which happens to be a standard E24 value. The calculator also rounds to the nearest E24 resistor above the exact value (safer: slightly less current), returns the actual current with that resistor, and tells you the power rating to buy (2× the dissipation).
ESP32 GPIO outputs 3.3 V · 5 V rail for longer strings
From the LED datasheet; 2.0 red · 3.2 blue/white
10 mA is bright for indicators; 20 mA is the classic max
Vf adds up — 2 × 2.0 V won't run from 3.3 V
| Quantity | Value | Why it matters |
|---|---|---|
| Voltage across resistor | 1.3 V | Supply minus the LED drop — sets the current with R |
| Recommended power rating | 125 mW | 2× headroom so the resistor runs cool |
| LED string dissipation | 20 mW | What the LEDs themselves burn |
| Formula | R = (Vs − Vf × count) ÷ I |
|---|---|
| E24 rounding | nearest standard value from above |
| Power rule | rating ≥ 2 × (Vs − Vf)² ÷ R |
| ESP32 GPIO | 10–12 mA safe · 40 mA absolute max |
| Typical Vf | red 2.0 V · yellow 2.1 V · green 2.2 V · blue/white 3.2 V |
How to calculate an LED series resistor
The LED series resistor does one job: drop the difference between the supply voltage and the LED's forward voltage, at a current the LED can survive. The formula is Ohm's law with one twist — an LED is not a resistor, it clamps its own voltage (Vf) once it conducts, so the resistor sees the leftover voltage entirely: R = (Vs − Vf×count) ÷ I.
The calculator adds the three practical steps that the bare formula skips. First, E24 rounding: the exact 133 Ω you computed doesn't exist in shops; the tool picks the nearest standard value from above (limiting current slightly below target, which is the safe direction for the LED). Second, real current: with the standard resistor the actual current differs from your target, and for indicator LEDs that difference is exactly what determines brightness. Third, power: the resistor burns (Vs − Vf)² ÷ R watts; anything over a quarter watt needs a physically bigger resistor, and running at 2× headroom keeps it cool.
There are also cases where the honest answer is "don't". If the supply is 3.3 V and the LED is a blue/white one (Vf ≈ 3.2 V), the leftover voltage is only 0.1 V — the resistor becomes ≈ 10 Ω and the actual current depends on how closely the LED's Vf matches the datasheet, which it rarely does. The tool still computes it, but the note warns you: for Vf close to the supply, use a constant-current driver or accept unstable brightness.
Common uses
- Picking the resistor for a status LED on an ESP32 GPIO (3.3 V, 10 mA)
- Driving an IR LED for a remote or sensor at exactly 20 mA
- Sizing resistors for a 12 V LED indicator panel (long strings in series)
- Checking how hot a 20 mA white LED's resistor will get before ordering
- Choosing between 10 mA (safe from any GPIO) and a transistor-switched 60 mA LED
Current limits when the LED sits on a GPIO
An ESP32 GPIO is comfortable at 10–12 mA and tolerates up to 40 mA absolute maximum — but two LEDs at 20 mA each already exceeds what you should pull from one pin, and GPIO34–39 (classic chip) can't drive an LED at all. For anything above ~12 mA, switch through a transistor or MOSFET: the GPIO drives the gate, the transistor carries the current. Connect the resistor on the LED side as usual, and never put an LED between a GPIO and ground without a resistor — that's how pins die.
Series and parallel LED rules
Series: forward voltages add (2 × 2.0 V = 4.0 V — already more than a 3.3 V GPIO can supply; use 5 V or 12 V rails for strings), current stays the same, one resistor for the whole string. Parallel: never share one resistor across parallel LEDs — Vf differs per LED, so one LED hogs the current. Give each LED its own resistor, or wire them in series when the supply allows.
Frequently Asked Questions
How do I calculate the resistor for an LED?
Can I drive an LED directly from an ESP32 GPIO?
Why can't I run a blue LED at full brightness from 3.3 V?
Does the resistor wattage actually matter?
Should LEDs go in series or parallel?
Which resistor value should I buy if the exact value doesn't exist?
More guides
10 starter projects in the right order: from blink to Wi-Fi to your first cloud dashboard, with the hardware list and the wiring traps each one teaches.
How to actually get weeks-to-months battery life: deep sleep modes, wake sources, the dev-board overhead leak, and a measurement recipe to find your real sleep current.
Which board should you buy in 2026? Wi-Fi and Bluetooth vs simplicity vs RP2040 — a decision table by project type, with the ESP32's edge for connected and AI hardware.
More Electronics calculators
Battery runtime for microcontroller projects: enter capacity, active current, duty cycle and sleep current to get real-world battery life in hours and days — the way it actually behaves on an ESP32-class board.
Two-resistor voltage divider: output voltage, divider current and dissipation — plus the R2 value that hits a target voltage, and the ESP32 ADC limits that decide whether your reading will actually be stable.
IPC-2221 trace width for your current, temperature rise and copper weight — external or internal layer — plus resistance and voltage drop when you enter the trace length.
Power supply sizing for LED strips: enter length and W/m to get total watts, total amps, the PSU wattage to buy with headroom, and how many power injection points the strip needs.