To drive an LED safely you add a series (current-limiting) resistor that drops the difference between the supply voltage and the LED’s forward voltage at your chosen current. This calculator gives the exact resistor, the nearest real-world part and the power it must handle — for hobbyists, makers and anyone wiring an LED to a battery, microcontroller pin or power rail.
How it works
An LED has a roughly fixed forward voltage (Vf). The resistor absorbs the leftover voltage at the current you want:
R = (V_supply − V_f) / I — with current I in amps.
The calculator also computes:
- Power in the resistor: P = (V_supply − V_f) × I
- Nearest standard part: it rounds up to the next E12 value so the real current never exceeds your target (a smaller resistor would push more current through the LED).
- Actual current with that standard resistor: I = (V_supply − V_f) / R.
If the supply voltage is not greater than the forward voltage, no resistor can drive the LED and the tool flags it.
Example
A red LED (Vf = 2.0 V) on a 5 V supply at 20 mA:
R = (5 − 2.0) / 0.020 = 3.0 / 0.020 = 150 Ω
| Quantity | Value |
|---|---|
| Exact resistor | 150 Ω |
| Nearest E12 part | 150 Ω |
| Resistor power | 3.0 × 0.020 = 0.06 W |
| Actual current | 20 mA |
A 150 Ω resistor is itself an E12 value, so the actual current lands exactly on the 20 mA target. The calculation runs entirely in your browser — nothing is sent anywhere.