LED Resistor Calculator

Get the right current-limiting resistor for your LEDs, rounded to a standard value, with the wattage rating you need.

Standard resistor—
Exact resistance—
Actual current—
Resistor power—
Use a rating of at least—
Total LED power—

This free LED resistor calculator finds the current-limiting resistor for one LED or a string of LEDs in series. Enter the supply voltage — 3.3 V, 5 V, 9 V, 12 V, 24 V or any other — and the LED color or forward voltage to get the nearest standard resistor value, the actual LED current and the resistor wattage you need. It works for Arduino, ESP32 and Raspberry Pi projects, car and 12 V lighting, and LED strips.

LED resistor formula

R = (Vsupply − n × Vf) ÷ I
P(resistor) = I² × R

Vf is the LED's forward voltage, n is the number of LEDs in series and I is the LED current in amps (mA ÷ 1000). The result is rounded up to the next standard E12 or E24 value, and the actual current is recalculated with that value.

Worked example: three white LEDs on 12 V

Three white LEDs at 3.1 V each drop 9.3 V, leaving 12 − 9.3 = 2.7 V for the resistor. At 20 mA: 2.7 ÷ 0.02 = 135 Ω, rounded up to 150 Ω (E24), giving 18 mA. The resistor dissipates 0.018² × 150 ≈ 49 mW, so a 1/4 W resistor is plenty.

LED resistor chart (20 mA, single LED)

Standard E24 resistor for one LED at 20 mA, rounded up. Use the calculator for other currents or LEDs in series. On 3.3 V, run LEDs at a lower current, since a small change in supply or LED voltage makes a big difference.

SupplyRed (~2 V)Yellow (~2.1 V)Green (~2.2 V)Blue / white (~3.1 V)
3.3 V68 Ω62 Ω56 Ω10 Ω *
5 V150 Ω150 Ω150 Ω100 Ω
9 V360 Ω360 Ω360 Ω300 Ω
12 V510 Ω510 Ω510 Ω470 Ω
24 V1.1 kΩ1.1 kΩ1.1 kΩ1.1 kΩ

* Not recommended: so little voltage is left for the resistor that the LED current will vary a lot with supply and LED tolerance.

Once you have the value, find its color bands with the resistor color code calculator.

Typical LED forward voltages

ColorForward voltage
Infrared1.2–1.5 V
Red / orange1.8–2.2 V
Yellow1.9–2.2 V
Green (standard)2.0–2.4 V
Green (InGaN, bright)2.8–3.4 V
Blue / white2.8–3.4 V
UV3.0–3.8 V

Exact values vary with the part and current — the datasheet's typical Vf at your chosen current is best.

Frequently asked questions

Why does an LED need a resistor?

An LED’s current rises steeply once the voltage passes its forward voltage. Without something to limit the current, a small change in supply voltage or temperature can push the current high enough to destroy the LED in a fraction of a second. A series resistor sets the current.

What current should I use for an LED?

Standard 5 mm indicator LEDs are usually rated for 20 mA maximum, but modern LEDs are bright at 2–10 mA. Running below the maximum extends LED life and saves power. Check the datasheet for high-power LEDs.

What resistor do I need for an LED on 5 V?

For a red LED (about 2.0 V) at 20 mA: (5 − 2.0) ÷ 0.02 = 150 Ω. For a white or blue LED (about 3.1 V): (5 − 3.1) ÷ 0.02 = 95 Ω, so use the next standard value up, 100 Ω.

What resistor do I need for an LED on 12 V?

For one LED at 20 mA, use 510 Ω for a red LED (about 2.0 V) or 470 Ω for a white or blue LED (about 3.1 V). To waste less power on 12 V, put three white LEDs or four to five red LEDs in series with one resistor — enter the count in "LEDs in series" above.

What resistor should I use for an LED on an Arduino, ESP32 or Raspberry Pi?

GPIO pins should be kept well below their maximum current, so 5–10 mA is a good target. At 10 mA, a red LED needs 300 Ω on a 5 V Arduino and 130 Ω on a 3.3 V ESP32 or Raspberry Pi. Blue and white LEDs need about 3 V, which leaves very little headroom on 3.3 V — they may be dim or need a transistor driver from a higher supply.

Can I use one resistor for several LEDs in parallel?

It is not recommended. LEDs have slightly different forward voltages, so one will hog the current and fail first, then the next one gets even more. Give each parallel LED (or series string) its own resistor.

Why round the resistor up rather than down?

A higher resistance gives slightly less current, which is safe. Rounding down gives more current than intended. This calculator picks the next standard value up.

Standard formulas, tested results

This calculator uses standard engineering formulas, shown in the method section above, and is checked against hand-worked examples. How the calculators are made.

Related calculators