PortDock

LED Resistor Calculator

LED series resistor and its power from supply voltage, forward voltage (Vf), current and LEDs in series, and the current with an E12/E24 value. 5, 12, 24 V.

Results
Voltage across the resistor Vs − n × Vf
Calculated resistor
Nearest standard value / current
Next value up / current (at or below target)
Resistor power (next value up)
Power per LED (next value up)

The defaults (24 V, Vf 2.0 V, 10 mA) are an example. Enter Vf and If from your LED's datasheet — they vary by colour, part and temperature, and datasheets usually give typical and maximum values separately.

Results update as you type. Everything runs in your browser; nothing you type is sent anywhere.

Formulas

  • R = (Vs − n × Vf) ÷ If
  • Resistor power P = If² × R = (Vs − n × Vf) × If
  • Power per LED = Vf × If
  • Current with a chosen R: If = (Vs − n × Vf) ÷ R

By supply voltage (Vf 2.0 V, 10 mA, next E12 value up)

SupplyCalculated RE12CurrentResistor power
5 V300 Ω330 Ω9.09 mA27.3 mW
12 V1 kΩ1 kΩ10 mA100 mW
24 V2.2 kΩ2.2 kΩ10 mA220 mW

Vf 2.0 V and 10 mA are example values to show the calculation. The higher the supply, the more power the resistor takes at the same current: at 24 V it is over ten times the LED's 20 mW.

How to read it

  • Picking the next standard value up keeps the current at or below the target. If the nearest value is below, the current ends up slightly higher.
  • A part or temperature with Vf below the datasheet typical value draws more current. The smaller the gap between supply and Vf (e.g. Vf 3 V on 5 V), the bigger the effect.
  • LEDs in series cut resistor power, but as the supply approaches n × Vf the current becomes sensitive to Vf. If Vs ≤ n × Vf there is no voltage left for the resistor.
  • Use a resistor rated well above the calculated power — how far below its rating to run it is in the resistor datasheet's derating curve.

Where it is used

  • Status LEDs in 24 V DC control panels and sensor or relay indicators wired directly.
  • Driving an LED from a microcontroller pin (3.3 V or 5 V) — check the pin current limit in the MCU datasheet.
  • Several LEDs in parallel on one resistor do not share current evenly because of Vf differences. Give each string its own resistor.

FAQ

What is the LED resistor formula?

R = (supply voltage − LED forward voltage) ÷ LED current. For 5 V, Vf 2 V and 20 mA: 3 V ÷ 0.02 A = 150 Ω, and the resistor dissipates 60 mW.

What resistor for an LED on 24 V?

With Vf 2 V and 10 mA: (24 − 2) ÷ 0.01 = 2.2 kΩ, dissipating 0.22 W. A 1/4 W resistor leaves almost no margin, so choose a higher rating or lower the current.

What about several LEDs in series?

Subtract Vf once per LED. Three LEDs with Vf 3 V on 12 V at 20 mA: (12 − 9) ÷ 0.02 = 150 Ω.

What if the result is not a standard value?

Use the next standard value up and the current comes out slightly below target. That is the «Next value up / current» row above.

To make a value from two resistors, use the Parallel & Series Resistor Calculator. For voltage drop over long wiring, use the Voltage Drop & Wire Size Calculator.

Basis

Resistance, current and power follow Ohm's law (definitions). E12 and E24 values come from Vishay document 28372 (the IEC 60063 tables). Check the LED's Vf and If and the resistor's power rating in their datasheets.