CONVERTER

LED Resistor Calculator

Enter your supply voltage, LED forward voltage, current and number of LEDs in series to get the resistor value, the real current and the wattage to buy.

Preset voltages are typical example values from specific LED datasheets. Check your datasheet; forward voltage varies by part, color and current.


  

About this tool

This LED resistor calculator works out the series resistor for one LED or a string of LEDs. Enter the supply voltage, the LED forward voltage, the current you want and how many LEDs are in series. You get the exact resistance, the next standard E12 or E24 value above it, the current you will actually get with that standard part, the power the resistor burns and a suggested wattage rating. It runs in your browser, and nothing is uploaded.

How to use the LED resistor calculator

  1. Enter the supply voltage, for example 5 V from USB or a microcontroller pin, 9 V from a battery, or 12 V.
  2. Set the forward voltage. Pick a color preset, or better, type the typical forward voltage (VF) from your LED's datasheet.
  3. Enter the current in milliamps. Stay below the datasheet's maximum continuous forward current.
  4. Enter the number of LEDs in series and, if you are building several identical strings, the number of parallel strings.
  5. Choose E12 or E24 and read the result. Press Copy result to paste it into your notes.

Why an LED needs a resistor

An LED is a diode. Below its forward voltage it barely conducts, and above it the current rises very steeply for small increases in voltage. Connect an LED straight across a supply that is even slightly above its forward voltage and the current is limited only by the supply and wiring, which can quickly exceed the LED's rating. A series resistor turns the leftover voltage into a predictable current. The more voltage the resistor drops, the less the current depends on small differences in the LED's forward voltage.

The formula

The resistor takes whatever voltage the LEDs do not, and Ohm's law gives its value:

R = (Vs − n × Vf) ÷ I
I_actual = (Vs − n × Vf) ÷ R_standard
P = I_actual² × R_standard

Here Vs is the supply voltage, n is the number of LEDs in series, Vf is one LED's forward voltage and I is the current in amps (20 mA = 0.020 A). The exact answer is rarely a value you can buy, so the tool rounds up to the next value in the IEC 60063 E12 or E24 series. Rounding up means the real current comes out at or slightly below your target, never above it. For the wattage, the tool doubles the calculated power and picks the next common rating (1/8, 1/4, 1/2, 1, 2, 3 or 5 W). The 2× margin is a widely used rule of thumb, not a standard. It keeps the resistor cooler than running it at its full rating.

Worked example

The tool opens with a 5 V supply, one red LED at 1.85 V and 20 mA. The resistor has to drop 5 − 1.85 = 3.15 V, so R = 3.15 ÷ 0.020 = 157.5 Ω. The next E24 value up is 160 Ω, which gives 3.15 ÷ 160 = 19.69 mA. The resistor dissipates 0.0196875² × 160 ≈ 62.02 mW. Doubled, that is about 124 mW, so a 1/8 W resistor is the smallest common size with the margin. A 1/4 W part also works and runs cooler. Switch to E12 and the next value up is 180 Ω, giving 17.5 mA.

A second example: a 12 V supply with three white LEDs at 3.0 V each leaves 12 − 9 = 3 V. At 20 mA that is exactly 150 Ω, which is already an E12 and E24 value.

Forward voltage presets

Forward voltage depends on the LED's chemistry, color, brand and current. The presets are example values from specific 5 mm LED datasheets, each measured at 20 mA: red 1.85 V typical (Kingbright WP7113SRD/D), yellow 2.0 V typical (Kingbright WP7113SYT), 568 nm green 2.2 V (Kingbright L-7113SGD), true green and blue 3.2 V typical (Multicomp MC703-1061 and part WW05A3SBQ4-N). The white LED datasheet used (Everlight 334-15/T1C1-4WYA) gives only a 3.0 V minimum and 3.6 V maximum, so the preset uses 3.0 V. Your LED may differ, so read its datasheet. Several of these are collected in this set of LED datasheets.

If you are unsure, use the lower end of the datasheet range. A lower Vf gives a larger resistor, so if the real LED drops more voltage, the current only falls.

Why parallel LEDs need one resistor each

It is tempting to wire several LEDs in parallel behind a single resistor. The problem is that no two LEDs have exactly the same forward voltage. The white LED datasheet above allows anywhere from 3.0 to 3.6 V. In parallel, the LED with the lowest forward voltage takes more than its share of the current. An LED's forward voltage also drops as it warms up, so the hottest LED can draw even more. Give each parallel string its own resistor, as this calculator assumes. Then each string's current is set by its own resistor, and the total supply current is simply the per-string current times the number of strings.

Common mistakes

Use cases

To read the resistor you end up with, use the Resistor Color Code Calculator, which also converts a value such as 160 Ω into its color bands.

Frequently asked questions

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

It depends on the LED. Using R = (5 − Vf) ÷ I, a red LED at 1.85 V and 20 mA needs about 157.5 Ω, so 160 Ω (E24) or 180 Ω (E12). A blue or white LED at about 3.2 V and 20 mA needs 90 Ω, so a 91 Ω E24 part or 100 Ω from E12.

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

For one LED at 20 mA, subtract its forward voltage from 12 V and divide by 0.020. A 3.2 V LED needs 440 Ω, and the next standard value up is 470 Ω in both E12 and E24. Putting several LEDs in series on 12 V reduces both the resistor value and the wasted power.

Can I run an LED from a 3.3V microcontroller pin?

Often yes for red, yellow and 568 nm green LEDs, whose forward voltage leaves room for a resistor. Blue, white and true green LEDs around 3.0 to 3.2 V leave very little voltage, so the current is hard to control. Also respect the pin current limit in your microcontroller datasheet, which may be well below 20 mA.

Does it matter which side of the LED the resistor goes on?

No. In a series circuit the same current flows through every part, so the resistor works the same before the anode or after the cathode. What matters is that the LED faces the right way: anode toward the positive supply, cathode toward ground.

Is it OK to use a slightly smaller resistor than calculated?

It raises the current above your target. The next value down is usually only a few percent away, so a few extra milliamps may still be within the LED rating, but check the maximum continuous current in the datasheet. The calculator shows the current with the next lower standard value so you can judge.

Why is my LED dim even with the right resistor?

Common causes are a supply that sags under load, a forward voltage higher than the value you entered, or a target current set low. Measure the voltage across the resistor and divide by its resistance to get the real current, then compare that with the datasheet current used for brightness ratings.