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.
Quick reference: LED resistor values by color (5V, 20mA)
Forward voltage depends mainly on color, so here are the standard picks for the most common setup — a 5V supply (Arduino pin) driving one LED at 20mA. Values use the calculator's own default forward voltages; exact values from your LED's datasheet always win.
| LED color | Typical Vf range | Resistor (exact) | Nearest E12 | Power dissipated |
|---|---|---|---|---|
| Infrared (IR) | ~1.4 V | 180 Ω | 180 Ω | 0.072 W |
| Red | 1.8–2.2 V | 150 Ω | 150 Ω | 0.060 W |
| Yellow | 1.9–2.2 V | 145 Ω | 150 Ω | 0.058 W |
| Green | 2.0–3.1 V | 140 Ω | 150 Ω | 0.056 W |
| Blue | 3.0–3.7 V | 90 Ω | 100 Ω | 0.036 W |
| White | 3.0–3.4 V | 90 Ω | 100 Ω | 0.036 W |
| UV | ~3.4 V | 80 Ω | 82 Ω | 0.032 W |
The highest dissipation here is 0.072 W, so with the standard 2× safety margin a 1/4W resistor covers every row. For a different supply voltage or current, run the calculator above.
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.
Why a bigger resistor isn't safer — just dimmer
Beginners often grab a much larger resistor "to be safe" — 1kΩ where 150Ω would do. It won't damage anything, but it starves the LED: current drops far below the LED's rated 20mA and the result is a faint glow you can barely see in daylight. Safety comes from the power rating (use 1/8W or higher for these small values, and check the calculator's dissipation figure), not from oversizing the resistance.
The other classic mistake is skipping the resistor because the supply "almost matches" — a 3.3V rail driving a 3.2V LED still needs one, because without it there's nothing limiting current and the LED draws until it burns out. When in doubt, run the numbers through the calculator above — or check the arithmetic on our scientific calculator. And if your LED runs on batteries, our battery runtime calculator tells you how long the whole circuit stays lit.
Worked example: three red LEDs in parallel on a 9V battery
Series strings suit high-voltage supplies. On a 9V battery, parallel wiring is often the better layout — each LED gets its own resistor and its own path to the supply. Say you want three red LEDs (Vf 2.0V) at 20mA each:
Step 1 — One resistor per string: each string is just a single LED, so the single-LED formula applies per string: (9 − 2.0) ÷ 0.02 = 350Ω. Round up to the nearest E12 value: 390Ω, one for each LED.
Step 2 — The current you actually get: the larger resistor drops the current slightly below target: (9 − 2.0) ÷ 390 = 17.9mA per string — a touch dimmer than 20mA, and safely under the LED's rating.
Step 3 — Total draw and resistor rating: the battery feeds all three strings, so it supplies 3 × 17.9 = 53.8mA in total. Each resistor dissipates 7V × 17.9mA ≈ 0.126W, so a standard 1/4W resistor keeps the usual two-times safety margin. A typical 550mAh 9V alkaline runs the trio for roughly ten hours — the battery runtime calculator works this out for any battery and load.
Why not save two resistors and share one? Because no two LEDs have exactly the same forward voltage, even from the same packet. With a shared resistor, the string with the lowest Vf takes more than its share of current, runs hotter, and its Vf drops further as it warms — so it takes even more. One resistor per string removes the competition entirely, which is why the calculator's parallel mode is built that way. Parallel wiring has two further advantages on battery projects: the circuit keeps working, dimmer but lit, if one LED fails, and the full supply voltage is available to every LED — useful for blue and white LEDs whose 3.2V forward voltage leaves little room for series strings on low-voltage supplies. The arithmetic throughout is plain Ohm's law; for anything beyond it, the scientific calculator covers the general maths.