Lesson 2 of 3 in Step 3 · LEDs, diodes and capacitors

Choosing a resistor for an LED

By Mihai Dumitru · · · 6 min read

On this page

An LED is a light-emitting diode. Like every diode, it barely conducts below its forward voltage and then lets through almost any current the circuit allows. On its own it has no way to limit that current, so it needs a resistor in series. This page shows how to choose that resistor.

In the tool, choose a supply and an LED colour. You can also remove the resistor to see why it is there.

LED resistor calculator

Choose the supply, the LED colour and how much current you want. The resistor value is worked out for you.

Supply
LED colour
5V
Use this resistor
330 Ω
Exact value
300 Ω
Real current
9.09 mA
Resistor heat
27.3 mW → 0.25 W part

Forward voltage and current

Two numbers from the LED's datasheet matter here. The forward voltage depends mostly on the colour: about 2.0 V for red, 2.1 V for yellow, 2.2 V for many greens, and about 3.0 to 3.3 V for blue and white. Some bright green LEDs are closer to 3 V. If you don't have the datasheet, these typical values are close enough.

The second number is the current. A standard 5 mm LED is usually rated for a maximum of 20 mA. You rarely need that much. For an indicator light, 10 mA is already bright, often 5 mA is enough, and the LED lasts longer when it runs below its maximum.

The calculation

The LED keeps its forward voltage, and the resistor takes the rest of the supply voltage. Applying Ohm's law to the resistor gives:

R = (supply voltage − LED forward voltage) ÷ current

For a red LED on 5 V USB at 10 mA: (5 − 2) ÷ 0.010 = 300 Ω. That isn't a standard value. As explained on the colour code page, resistors come in standard series, and for an LED you round up to the next value, here 330 Ω. A larger resistor means slightly less current, which is the safe direction. With 330 Ω the current is about 9 mA, and the difference in brightness can't be seen.

The resistor's power

The resistor turns its share of the voltage into heat, as described on the power page. In the example above that is 0.009 × 0.009 × 330, about 27 mW, which any common resistor handles easily. It matters with higher supplies. A red LED on 24 V at 20 mA needs 1.2 kΩ, and that resistor turns about 0.4 W into heat, so it should be rated 1 W. The tool shows the rating to use.

Mistakes that come up often

  • Leaving out the resistor. The LED may work for a while, but it runs far above its rating and fails sooner or later.
  • Rounding down. Using 270 Ω because it's in the drawer, when you calculated 300 Ω, means more current than planned.
  • One resistor for several LEDs in parallel. LEDs never share current evenly, so one takes more, heats up and takes even more. Each LED needs its own resistor.
  • The LED is backwards. It simply stays dark. The longer leg is the anode and goes towards plus. The flat edge on the rim marks the cathode.
  • The supply is too low. A blue LED on two AA batteries (3 V) glows very weakly or not at all, because 3 V is below its forward voltage.

Quick reference at 10 mA

Already rounded up to E12 values:

  • Red LED: 3 V → 100 Ω, 5 V → 330 Ω, 9 V → 820 Ω, 12 V → 1 kΩ
  • Blue or white LED: 5 V → 220 Ω, 9 V → 680 Ω, 12 V → 1 kΩ

It doesn't matter whether the resistor is placed before or after the LED. In a simple loop the same current flows through both, so the resistor limits it from either side.

Check yourself

  1. Which resistor do you need for a red LED (2 V) at 10 mA from a 9 V battery?

    Show the answer

    R = (9 − 2) ÷ 0.01 = 700 Ω. The next standard value up is 820 Ω, which gives about 8.5 mA and is still bright.

  2. Which resistor do you need for a blue LED (3 V) at 10 mA from 5 V?

    Show the answer

    R = (5 − 3) ÷ 0.01 = 200 Ω. The next standard value up is 220 Ω, giving about 9 mA.

  3. How much power does the resistor in the first question turn into heat?

    Show the answer

    It has 7 V across it and about 8.5 mA through it: 7 × 0.0085 = 0.06 W. A common 1/4 W resistor is plenty.

  4. Why shouldn't two LEDs in parallel share one resistor?

    Show the answer

    Their forward voltages are never exactly equal. The LED with the lower forward voltage takes most of the current and can burn out. Give each LED its own resistor.

Read next