LED resistor calculator (and Zener diode)
Calculate the resistor for one or more LEDs in series: value, power rating and standard E12 or E24 resistor with its real current. Also for a Zener diode.
An LED cannot be connected straight to a battery or a power supply: it needs a series resistor to limit its current. This calculator gives you that resistor for one or several LEDs in series, the power it will dissipate, the standard resistor (E12 and E24 series) you have to buy and the real current it will give. It also works the other way around: what current a resistor you already have gives, or what voltage you need. And it works for the resistor of a Zener diode regulator.
How to use the calculator
- Choose LED or Zener.
- For an LED, choose the color: its typical forward voltage is filled in. If the manufacturer's datasheet gives another one, type it in. Enter how many LEDs go in series.
- For a Zener, enter its voltage and the load current it will supply.
- Of these three values, enter two: supply voltage, current and resistance. The one you leave empty is calculated, in the unit you choose (mA, kΩ…).
- Below you get the resistor power, the recommended power rating and the standard resistors with their real current. In the drawing, the LEDs shine more or less according to the current and the resistor turns red if a 1/4 W one would overheat.
LED resistor formula
Where Us is the supply voltage, UF the forward voltage of each LED, n the number of LEDs in series and I the current you want (in amperes: 20 mA = 0.02 A). The resistor takes the excess voltage. Solving for the others:
The power the resistor dissipates is the voltage across it times the current:
Choose a resistor rated for at least twice that power (1/8 W, 1/4 W, 1/2 W, 1 W, 2 W…): that way it runs warm, not hot, and lasts longer. The calculator recommends the first standard rating that meets the power of the exact resistor; with the standard resistor, which is slightly larger, the power drops a little.
LED voltage by color
The forward voltage depends on the material of the LED, which is what gives its color. These are typical values at about 20 mA for a 5 mm LED; each manufacturer gives its own in the datasheet.
| Color | Typical forward voltage |
|---|---|
| Infrared | 1.2 V |
| Red | 2.0 V |
| Orange, yellow and standard green | 2.1 V |
| High-brightness green, blue and white | 3.2 V |
| Ultraviolet | 3.4 V |
Ordinary 5 mm LEDs handle about 20 mA (high-brightness ones, sometimes 30 mA). At 10 mA they already shine well and last longer. Power LEDs (1 W, 3 W) need a constant-current driver, not a resistor.
Standard resistors: E12 and E24 series
The calculated value almost never exists: resistors are made in the standard values of the E series (IEC 60063). You pick the standard value right above, so that the current ends up slightly below the one you want rather than above it.
- E12 (±10%): 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68 and 82, and their multiples of 10.
- E24 (±5%): the above plus 11, 13, 16, 20, 24, 30, 36, 43, 51, 62, 75 and 91.
To read the colors of the resistor, use the resistor color code calculator (in the related calculators, at the end of the page).
Worked example
A red LED (2 V) at 20 mA with a 12 V power supply:
The next standard value up is 560 Ω in E12 (green, blue, brown and silver or gold), which gives I = 10 / 560 ≈ 17.9 mA, or 510 Ω in E24 (≈ 19.6 mA). Since it dissipates 0.2 W, the recommended rating is 1/2 W. Three white LEDs in series (3 · 3.2 = 9.6 V) on the same supply need only R = (12 − 9.6) / 0.02 = 120 Ω and 0.048 W: in series the energy is used much better.
Resistor for a Zener diode
A reverse-connected Zener diode holds its voltage Uz almost constant: with a series resistor it makes a simple regulator for small voltages. The resistor has to supply the Zener current (Iz) and the load current (IL) at the same time:
Choose an Iz of 10% to 20% of the Zener's maximum current (for a 0.5 W, 5.1 V one, about 10 mA). If the load is disconnected, all the current flows through the Zener: check that it can handle that power. If the load draws a lot of current or the supply varies a lot, a voltage regulator is better.
Frequently asked questions
Why does an LED need a resistor?
Because an LED does not limit its own current: above its forward voltage, a few tenths of a volt more make the current shoot up and burn it out. The resistor takes the excess voltage and sets the current: I = (Us − UF) / R.
What resistor do I use for an LED on 5 V or 12 V?
For a red LED (2 V) at 20 mA: on 5 V, R = (5 − 2) / 0.02 = 150 Ω; on 12 V, R = (12 − 2) / 0.02 = 500 Ω, which in the E12 series is 560 Ω (about 17.9 mA). For a white or blue one (3.2 V) on 5 V you get 90 Ω: use 100 Ω.
Can I run several LEDs with a single resistor?
In series, yes: the voltages add up (n · UF) and must stay below the supply with some margin. In parallel with a single resistor, no: the LED with the lowest voltage takes more current and ends up burning out. Use one resistor for each branch.
What wattage should the resistor be?
At least twice the power it dissipates: P = (Us − n · UF) · I. On 12 V, a red LED at 20 mA dissipates 0.2 W, so a 1/2 W resistor is better than the usual 1/4 W one, which would run very hot.
How do you calculate the resistor for a Zener?
The resistor has to supply the Zener current plus the load current: R = (Us − Uz) / (Iz + IL). With no load, all the current goes through the Zener, so check that it can handle Uz · (Iz + IL).
