Skip to main content

How to Size an LED Resistor: The Current-Limiting Resistor Every LED Needs

Why every LED needs a series current-limiting resistor, the R=(Vs-Vf)/If formula, forward voltage and current explained, with an Arduino 5V worked example.

Published By Li Lei
#electronics #led #arduino #resistor #hardware

How to Size an LED Resistor: The Current-Limiting Resistor Every LED Needs

The first LED I ever wired straight to a battery lasted about two seconds. A faint flash, a wisp of smoke, and a dead part. I had treated the LED like a light bulb, something you just connect to power. It is not. An LED is a current device, and if you do not control that current with a series resistor, the LED controls it for you, badly, by burning out.

This post walks through why an LED needs a current-limiting resistor, how to calculate the right value with one short formula, and how forward voltage and forward current actually behave. Everything here is what you need for a real Arduino or hobby circuit, not textbook abstraction. If you would rather skip the arithmetic, the LED Resistor Calculator runs the whole thing and snaps the answer to a resistor you can actually buy.

Why an LED needs a series resistor

A regular resistor obeys a smooth, linear relationship: double the voltage across it and you double the current through it. An LED does not behave that way. Below its forward voltage it conducts almost nothing. Above it, the internal resistance collapses to nearly zero, so the current rises almost vertically with voltage.

That steep curve is the whole problem. Once a 2 V red LED starts conducting, a tiny extra push, even a tenth of a volt, sends current shooting from a safe 20 mA toward several amps. Nothing inside the LED stops it. Connect a 2 V LED directly across a 5 V supply and it tries to drop those leftover 3 V across its own near-zero resistance, which means an enormous current and a dead diode in seconds.

The series resistor is what fixes this. It sits in line with the LED and absorbs the voltage the LED does not use. Because the resistor is linear and predictable, it sets the current for the whole branch. The LED only decides its forward voltage; the resistor decides how much current flows. That division of labor is the entire reason the part survives.

Forward voltage and forward current

Two numbers describe an LED for this purpose.

Forward voltage (Vf) is the drop across the LED once it is conducting. It depends mostly on color, because color tracks the energy of the emitted light:

  • Red: about 2.0 V
  • Yellow and green: about 2.1 V
  • Blue and white: about 3.2 V

Blue and white sit higher because they are higher-energy colors. Vf also drifts a little with current and temperature, so a 5 percent variance is normal. Use the datasheet figure when you have it; the typical values above are a fine starting point when you do not.

Forward current (If) is how much current you want flowing through the LED. For a standard indicator LED, 20 mA is the classic target: bright and well within the part's rating. Many modern LEDs are visibly lit at 5 to 10 mA, which is gentler on a microcontroller pin. The one trap here is units. Datasheets quote If in milliamps, but the resistor formula uses amps. 20 mA is 0.02 A. Forget to convert and your resistance comes out a thousand times too small.

The formula: R = (Vs − Vf) / If

Here is the equation that sizes the resistor:

R = (Vs − Vf) / If

Read it as a sentence. The supply voltage minus the LED's forward voltage is the voltage left over for the resistor. Divide that leftover voltage by the current you want, and Ohm's law hands you the resistance. This is just V = I × R rearranged for the resistor's own share of the circuit. If the relationship feels shaky, an Ohm's Law Calculator lets you poke at V, I, and R until it clicks.

For multiple LEDs wired in series, subtract every LED's drop: R = (Vs − n·Vf) / If, where n is the number of LEDs in series. They all share the same current, so one resistor still does the job, but the supply has to clear the sum of all the forward voltages before any current flows at all.

A worked example: 5 V, a 2 V red LED, 20 mA

Take the most common hobby case. You have a 5 V supply (a USB port, an Arduino's 5 V pin), a red LED with a 2.0 V forward voltage, and you want 20 mA through it.

Plug in the numbers:

  • Leftover voltage: 5 V − 2 V = 3 V
  • Convert current: 20 mA = 0.02 A
  • Resistance: 3 V ÷ 0.02 A = 150 ohms

So a 150 ohm resistor in series with that LED holds the current at 20 mA. 150 ohms happens to land exactly on a standard value, so you can buy it off the shelf. When the math gives an in-between number, round up to the next standard value, never down: a slightly larger resistor means slightly less current, which is the safe direction. A 215 ohm result becomes 220, not 200.

Now check the heat. The resistor turns that leftover voltage into power: P = (Vs − Vf) × If = 3 V × 0.02 A = 0.06 W. A common 1/4 W resistor handles that with room to spare. Bump the supply to 12 V, though, and a single-LED resistor can creep past a 1/4 W rating and start to scorch, so you would move up to a 1/2 W part. A good rule is to pick a wattage at least twice the calculated dissipation so the part runs cool.

Common mistakes that cook LEDs and resistors

A few errors come up again and again:

  • Skipping the milliamp-to-amp conversion. Typing 20 instead of 0.02 makes the resistance 1000 times too small, which means 1000 times too much current.
  • Rounding the resistor down. A smaller resistor pushes more current through the LED, the unsafe direction. Always round up to the next standard value.
  • Ignoring wattage. The resistance can be perfect and the resistor still overheats because you never checked the power rating. On higher supply voltages this matters.
  • Paralleling LEDs on one resistor. Two LEDs almost never have identical forward voltages, so one hogs the current and burns out first. Wire them in series and set n, or give each LED its own resistor.

Once you have the resistance and want to find or verify the physical part, a Resistor Color Code Calculator translates between the value and the colored bands printed on the body.

Putting it together

The mental model is short. An LED sets a forward voltage but cannot limit its own current, so a series resistor does it instead. Subtract the LED drop from the supply, divide by the current you want, round the resistance up to a real part, and confirm the wattage. That is R = (Vs − Vf) / If, plus a power check, and it is the whole job for the vast majority of indicator and hobby circuits.

Do it once by hand so the formula is yours, then let the LED Resistor Calculator handle the standard-value snapping and wattage pick on every build after that. Your LEDs will outlast the project instead of the first two seconds of it.


Made by Toolora · Updated 2026-06-13