Last updated: October 2026
What resistor do I need for my LED?
How to calculate the resistor for an LED
The formula is Ohm's law applied to the voltage the resistor must drop:
R = (Vs − Vf) ÷ I
- Vs — your supply voltage (5V, 12V, 3.3V…)
- Vf — the LED's forward voltage (depends on color: red ≈ 2.0V, white/blue ≈ 3.2V)
- I — LED current in amps (20mA = 0.02A for a standard LED)
Resistors aren't sold in every value, so round up to the nearest standard E12 preferred value. Rounding down would push the current above your target. For background on the parts involved, see the light-emitting diode and resistor articles on Wikipedia.
What resistor do I need for LED Arduino 5V projects?
The classic Arduino case: a red LED (Vf ≈ 2.0V) driven from a 5V pin at 20mA. Applying the formula: (5 − 2) ÷ 0.02 = 150Ω — which happens to be a standard E12 value. It dissipates 3V × 0.02A = 0.06W, so a 1/8W resistor (0.125W ≥ 2 × 0.06W) is the safe, standard pick. For a blue or white LED on 5V: (5 − 3.2) ÷ 0.02 = 90Ω → round up to the E12 value 100Ω.
LED resistor calculator for 12V
On a 12V supply, a single red LED needs (12 − 2) ÷ 0.02 = 500Ω → E12 560Ω. It dissipates 10V × 0.02A = 0.2W, so use a 1/2W resistor (0.5W ≥ 2 × 0.2W) — a 1/4W resistor would run too hot. For 12V it's more efficient to wire LEDs in series so they share one resistor; see the next section.
How to calculate resistor for multiple LEDs in series
When LEDs are wired in series, the same current flows through all of them and their forward voltages add up: R = (Vs − N×Vf) ÷ I. Three white LEDs (3 × 3.2V = 9.6V) on 12V at 20mA need (12 − 9.6) ÷ 0.02 = 120Ω — one resistor for the whole string. The calculator handles this with the "N in series" tab. Important: if Vs is less than N×Vf, no resistor can make it work — you need a higher supply or fewer LEDs in the string.
How to use the calculator
1. Enter your supply voltage in volts. 2. Pick your LED color — the forward voltage fills in automatically, or choose "Custom…" and enter Vf from your LED's datasheet. 3. Set the LED current (20mA is standard for 5mm LEDs). 4. Choose the wiring: single LED, N LEDs in series, or N parallel strings of one LED. 5. Read off the exact resistor, the nearest buyable E12 value, the power dissipated, and the recommended wattage rating.
Note on parallel wiring: give each string its own resistor — the calculator assumes one resistor per string and reports the total supply current. See the FAQ below for why a single shared resistor is a bad idea.