Calculate the correct current-limiting resistor for any LED. Works for single LEDs and series strings. Instant result with nearest standard E12 value.
Calculate Resistor Value
V
Arduino = 5 V · Raspberry Pi = 3.3 V · 9 V battery = 9 V
V
Red ≈ 2.0 V · Blue/White ≈ 3.3 V (check datasheet)
mA
Standard LEDs: 10–20 mA · High-brightness: 30–50 mA
1
The Formula
The current-limiting resistor is calculated using Ohm's Law. The voltage across the resistor equals the supply voltage minus the total LED voltage drop:
R = ( VS − N × Vf ) / If
Where:
R — resistor value in ohms (Ω)
VS — supply voltage (V)
Vf — forward voltage of one LED (V)
N — number of LEDs in series
If — desired forward current (A)
The resistor dissipates power equal to P = (VS − N × Vf) × If. Choose a resistor rated at least twice this power to be safe.
Worked Examples
1 Arduino + Red LED
Supply VS5 V
Forward Vf2.0 V
Current If20 mA
LEDs in series1
R = (5−2.0)/0.020150 Ω
2 12 V + White LEDs
Supply VS12 V
Forward Vf3.3 V
Current If20 mA
LEDs in series3
R = (12−9.9)/0.020105 Ω → 120 Ω
3 3.3 V + Blue LED
Supply VS3.3 V
Forward Vf3.0 V
Current If10 mA
LEDs in series1
R = (3.3−3.0)/0.01030 Ω → 33 Ω
4 9 V battery + IR LED
Supply VS9 V
Forward Vf1.7 V
Current If50 mA
LEDs in series1
R = (9−1.7)/0.050146 Ω → 150 Ω
Standard E12 Resistor Values
Always round up to the next standard value so the LED current stays at or below your target. Rounding down increases current above the rated maximum.
Series
Values (× 1, 10, 100, 1 k, 10 k …)
E12
10
12
15
18
22
27
33
39
47
56
68
82
E24
10
11
12
13
15
16
18
20
22
24
27
30
E12 resistors are available everywhere. E24 gives closer values and is standard in most online shops.
Frequently Asked Questions
Why does an LED need a resistor?
▾
An LED has a nearly fixed forward voltage drop (typically 2.0–3.5 V). Without a resistor the excess supply voltage would drive unlimited current through the LED, destroying it within milliseconds. A series resistor limits the current to a safe operating level, usually 10–20 mA for standard LEDs.
What is the LED resistor formula?
▾
R = (VS − N × Vf) / If
VS = supply voltage, Vf = LED forward voltage, N = number of LEDs in series, If = desired current in amperes. This is simply Ohm's Law applied to the voltage drop across the resistor.
What forward voltage should I use for different LED colors?
▾
Typical forward voltages at 20 mA:
• Red: 1.8–2.2 V (use 2.0 V)
• Orange / Yellow: 2.0–2.2 V
• Green (standard): 2.0–2.2 V
• Green (high-efficiency): 3.0–3.5 V
• Blue: 3.0–3.5 V
• White: 3.0–3.5 V
• UV (400 nm): 3.5–4.0 V
• IR (850–940 nm): 1.2–1.7 V
Always check the LED datasheet for the exact Vf at your target current.
How many LEDs can I wire in series?
▾
You can connect as many LEDs in series as you like, as long as the total forward voltage of all LEDs is at least 1–2 V less than the supply voltage. For example, with a 12 V supply and white LEDs (Vf = 3.3 V each), you can safely wire 3 LEDs in series (3 × 3.3 = 9.9 V, leaving 2.1 V for the resistor).
What resistor wattage do I need?
▾
Minimum power rating: P = (VS − N × Vf) × If. Choose at least double this for a safety margin. In most 5 V / 20 mA circuits the resistor dissipates only 60 mW — a standard ¼ W (0.25 W) resistor is easily sufficient.
What happens if I use a resistor that is too small?
▾
Too much current flows, the LED overheats and its lifetime drops dramatically — often failing within seconds at extreme overcurrent. Always round calculated values up to the next standard resistor size. Never round down.