Why your LED needs a resistor (and which one to use)

By Mihai Dumitru · 11 October 2026 · 5 min read

On this page

Put an LED straight on a 9 V battery and it lights up for a second. Then it's dead. No warning, no second try.

The fix is one resistor that costs a few bani. Below is a live circuit. Pick a supply and an LED colour, and it tells you which resistor to use. Then untick the resistor and see what happens.

LED resistor calculator

Pick a supply and an LED. The resistor value updates as you go.

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

What actually goes wrong

An LED is not a light bulb. A bulb's filament has resistance, so it limits its own current. An LED doesn't do that. Below a certain voltage almost nothing flows. Once you pass it, the LED barely resists at all. The current shoots up, the tiny chip inside overheats and that's it.

That voltage is called the forward voltage, and it depends on the colour:

  • Red: about 2.0 V
  • Yellow: about 2.1 V
  • Green: about 2.2 V (some bright greens are closer to 3 V)
  • Blue and white: about 3.0 to 3.3 V

A normal 5 mm LED handles about 20 mA at most. For an indicator light, 10 mA is already bright. Often 5 mA is enough, and the LED lives longer.

The math is one line

The resistor takes whatever voltage the LED doesn't use. So:

Resistor = (supply voltage − LED voltage) ÷ current

Example: a red LED on 5 V USB, at 10 mA. (5 − 2) ÷ 0.010 = 300 Ω.

You can't buy a 300 Ω resistor. They come in standard steps called the E12 series: 100, 120, 150, 180, 220, 270, 330, 390, 470, 560, 680, 820, then the same again times 10. Always go up to the next one, here 330 Ω. A bigger resistor means a bit less current, which is the safe side. With 330 Ω you get about 9 mA. Your eyes won't see the difference.

If the units confuse you, the Ohm's law guide has the short version. Remember: 10 mA is 0.010 A.

Does the resistor get hot?

A little. It turns the extra voltage into heat. Power = current² × resistance. In the example: 0.009 × 0.009 × 330 ≈ 27 mW. A normal 1/4 W resistor (250 mW) won't even feel it.

It starts to matter with higher voltages. A red LED on 24 V at 20 mA needs a 1.2 kΩ resistor, and that resistor turns about 0.4 W into heat. A 1/4 W part would get really hot. The calculator picks a rating with double margin, so here it says 1 W.

Common mistakes

  • No resistor at all. Sometimes it works for a while. Then it doesn't.
  • Rounding down. You calculate 300 Ω and use 270 Ω because you have it. That's more current than you planned. Round up.
  • One resistor for several LEDs in parallel. LEDs never share current evenly. One takes more, gets hotter, takes even more, dies. Then the next one gets all of it. Give each LED its own resistor.
  • LED in backwards. Nothing burns, it just doesn't light. The long leg (anode) goes to plus. The flat edge on the rim is minus.
  • Supply too low. A blue LED on two AA batteries (3 V) barely glows, if at all. It needs about 3.1 V before it really starts.

Before or after the LED?

Doesn't matter. In a simple loop the same current flows through everything, so the resistor limits it from either side. Put it where it's easier to wire.

Quick reference for 10 mA

Already rounded up to standard 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Ω

VoltTrial has LEDs and resistors. Build this circuit, press Run and tap any pin to read voltage and current. Then take the resistor out and watch what happens. Breaking things there costs nothing.

Try it in VoltTrial

Read next