Lelifi·tools

LED Resistor Calculator

A 5 V supply with a red LED at 1.8 V and 20 mA needs 160 ohms. Round up to 180 ohms and the circuit settles at 17.8 mA, with 0.057 W burned in the resistor and the LED held near its forward voltage.

Enter supply voltage, LED forward voltage and current to get the resistor value, the nearest standard part and the power it burns.

By the Lelifi editors ·

Key takeaways

Typical LED forward voltage by color (volts)1.2Red1.8Yellow2Green2.2Blue3White33.61.8 V
Forward voltage ranges by LED color, with a red part at 1.8 V marked.
Resistor sizing, worked in steps5 V supply, red LED 1.8 V, 20 mA targetR = (5 - 1.8) / 0.020= 3.2 / 0.020= 160 ohms, choose 180 ohms= 17.8 mA actual
The calculator's arithmetic for the classic 5 volt red LED circuit.
On this page
  1. Why an LED needs a series resistor
  2. Forward voltage depends on the LED color
  3. Worked examples at 3.3, 5, 9 and 12 volts
  4. Rounding to a standard resistor value and which way to round
  5. Resistor power rating and heat
  6. Strings of LEDs on one supply
  7. Supply tolerance and other real world errors
  8. Checking the circuit before you solder

Why an LED needs a series resistor

A light emitting diode holds its forward voltage almost constant, so the resistor in series sets the current that flows through the circuit. Give an LED exactly its forward voltage from a stiff supply and a small change in voltage moves the current a long way, which is why an LED wired straight across a battery can glow bright for a moment and then die. The resistor absorbs the voltage difference and turns the remaining volts into a predictable current.

The sizing formula follows from Ohm's law applied to the resistor alone:

Worked example: a 5 V supply feeds a red LED with a forward voltage of 1.8 V, and the target current is 20 mA. The resistor sees 5 - 1.8 = 3.2 V, so R = 3.2 ÷ 0.020 = 160 ohms. The next standard value up is 180 ohms, which gives (5 - 1.8) ÷ 180 = 0.0178 A (17.8 mA), a little under target and safely inside the rating.

Check the voltage the other way: 20 mA through 180 ohms drops 0.020 × 180 = 3.6 V, which leaves 5 - 3.6 = 1.4 V across the LED. That is slightly below the 1.8 V forward voltage, which is why the settled current comes out below 20 mA. The LED and the resistor settle at a point where both equations agree, and the calculator reports that settled current for you.

Forward voltage depends on the LED color

The forward voltage is set by the semiconductor material, and the material sets the color, so the two travel together. The Rensselaer Polytechnic Institute circuits course notes list approximate thresholds from 1.2 V for infrared parts to 3.6 V or more for blue and ultraviolet, and the Grinnell College electronics reading puts the usual range at 1.7 V to 3.4 V for visible colors.

LED colorTypical forward voltageCommon use
Infrared1.2 VRemote controls, sensors
Red1.8 to 2.2 VIndicators, seven segment digits
Orange and yellow2.0 to 2.2 VStatus lights
Green2.2 V (older) to 3.2 V (modern)Power indicators
Blue3.0 to 3.6 VIndicators, RGB mixes
White3.0 to 3.6 VLighting, backlights
Ultraviolet3.4 to 3.7 VCuring, fluorescence

Those are starting points. The exact value lives in the datasheet, and it drifts with current and temperature, so a red LED specified at 2.0 V may measure 1.7 V at 5 mA. The Carnegie Mellon kinetics course exercise uses 1.6 V for a typical red part at 20 mA, which shows how much parts vary. When a datasheet is missing, start at the low end of the color's range for a dim run and measure.

Two LEDs of the same color from the same bag can differ by a tenth of a volt. That spread is invisible with a series resistor, and it is one reason the resistor design survives part swaps.

Worked examples at 3.3, 5, 9 and 12 volts

The table runs the formula for the supplies most builders keep on the bench. The exact value is (Vs - Vf) ÷ I, the standard value is the next E12 step at or above it, and the actual current and resistor power follow from that chosen resistor.

SupplyLEDVfTargetExact RChosen (E12)Actual currentResistor power
3.3 VRed1.8 V20 mA75 ohms82 ohms18.29 mA0.0274 W
5 VRed1.8 V20 mA160 ohms180 ohms17.78 mA0.0569 W
5 VBlue3.2 V20 mA90 ohms100 ohms18.0 mA0.0324 W
9 VRed1.8 V10 mA720 ohms820 ohms8.78 mA0.0632 W
12 VWhite3.2 V20 mA440 ohms470 ohms18.72 mA0.1647 W
12 VRed2.0 V15 mA667 ohms680 ohms14.71 mA0.1471 W

Follow the 9 V row: 9 - 1.8 = 7.2 V across the resistor, 7.2 ÷ 0.010 = 720 ohms exact, and the next E12 step up is 820 ohms, so the current is 7.2 ÷ 820 = 0.00878 A (8.78 mA). Follow the 12 V white row: 12 - 3.2 = 8.8 V, 8.8 ÷ 0.020 = 440 ohms exact, chosen 470 ohms, current 8.8 ÷ 470 = 0.0187 A (18.7 mA), and the resistor burns (0.01872)² × 470 = 0.165 W, which is inside a quarter watt rating but warm to the touch.

Notice the pattern: a higher supply with the same LED wastes more volts in the resistor. The 3.3 V red circuit gives 1.8 V to the LED and 1.5 V to the resistor, while the 12 V red circuit gives 2 V and 10 V. Both light the LED the same, but the 12 V version turns almost seven times more energy into heat per milliamp.

Rounding to a standard resistor value and which way to round

Resistors come in preferred values. The E12 series repeats twelve values per decade: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82, then the same numbers times ten, a hundred, and so on. A computed 160 ohms does not exist in the drawer, but 150 and 180 do, and 440 ohms becomes 470.

Always round up, never down. Rounding down raises the current above target, and the margin between a typical 20 mA rating and the absolute maximum is small. Rounding up only dims the LED a few percent, which is invisible in an indicator application. The table above rounds every exact value up to the next E12 step, the twelve value series most shops stock.

Tolerance matters more than the rounding. A 5% carbon film 180 ohm resistor can measure 171 to 189 ohms, so the current in the 5 V red circuit ranges from 3.2 ÷ 171 = 0.0187 A (18.7 mA) to 3.2 ÷ 189 = 0.0169 A (16.9 mA). That spread is harmless at 20 mA ratings, and 1% metal film parts shrink it fivefold if the design sits close to the limit.

If you need a value between two steps, put two resistors in series: values in series add up, so 150 + 33 = 183 ohms. The calculator also reports the actual current for the chosen value, which is the number to compare against the datasheet maximum, not the target current you typed.

Resistor power rating and heat

The resistor turns the voltage difference into heat, and the power is P = I²R, with I in amps. A 20 mA circuit through 180 ohms burns (0.02)² × 180 = 0.072 W, comfortably inside a quarter watt part. The same 20 mA through 470 ohms burns 0.188 W, which is three quarters of a quarter watt rating and runs hot; a half watt part is the better pick there.

High current LEDs move the goalposts. A one watt LED runs at 350 mA, not 20 mA. On a 5 V supply with a 3.2 V forward voltage, the resistor is (5 - 3.2) ÷ 0.35 = 5.1 ohms, and it burns (0.35)² × 5.1 = 0.63 W, which needs a 1 W or 2 W resistor with airflow and a pad big enough to sink the heat. At that point a switching constant current driver wastes less power than a resistor does.

Rule of thumb: keep the resistor below half its rated power, and rate the part at least twice the calculated dissipation. A resistor running at its full rating reaches temperatures that discolor boards and drift in value over time.

Strings of LEDs on one supply

LEDs in series share one current, so their forward voltages add. Three white LEDs at 3.2 V each drop 9.6 V, and on a 12 V supply the resistor sees 12 - 9.6 = 2.4 V, so R = 2.4 ÷ 0.020 = 120 ohms, which happens to be an exact E12 value. Four of the same LEDs drop 12.8 V, more than the supply, and the string stays dark no matter how small the resistor gets.

SupplyStringTotal VfResistor voltageR at 20 mAWorks?
12 V2 white6.4 V5.6 V280 ohmsYes, wastes more in heat
12 V3 white9.6 V2.4 V120 ohmsYes, efficient
12 V4 white12.8 VnegativenoneNo, never lights
5 V2 red3.6 V1.4 V70 ohmsYes
5 V3 red5.4 VnegativenoneNo, never lights

Parallel strings are a different animal. Each parallel branch needs its own resistor, because two LEDs sharing one resistor do not share the current evenly: the part with the lower forward voltage hogs the current, heats up, drops less voltage, and hogs more, until it fails. That process is called thermal runaway, and one resistor for a parallel pair is the classic way to trigger it.

Series is the efficient direction: one current, one resistor, and the resistor voltage is the leftover after the LEDs. The limit is the supply, which must exceed the string total by a few volts for the resistor to do its job.

Supply tolerance and other real world errors

A 12 V automotive rail is not 12 V. With the engine running it sits near 14.4 V, and the calculator's current figure changes with it: the 12 V white circuit at 470 ohms draws 11.2 ÷ 470 = 0.0238 A (23.8 mA) at 14.4 V instead of 18.7 mA, 27% above the design point. Size the resistor for the highest voltage the rail can reach, not the nominal one, or pick a constant current driver.

Other errors worth checking before power up:

The NIST SI unit guide covers the definitions behind the arithmetic, and a $10 multimeter covers the rest: measure the actual current through the series loop and compare it to the calculator's prediction before anything is soldered.

Checking the circuit before you solder

Breadboard first, meter second, solder third. Wire the LED and resistor in series, power it through the meter on a milliamp range, and read the loop current. The reading should sit a few percent under the calculator's prediction, because the real forward voltage will not match the assumed one exactly.

Measure the voltage across the LED itself to learn the part's true forward voltage at your chosen current, then enter that measured value back into the calculator for a second pass. One iteration is usually enough to land within 5% of any target current.

Watch the heat during the first minute. A quarter watt resistor at 0.15 W is warm but touchable, and anything that stings a fingertip after ten seconds is over its comfortable rating. Dim, correct, and re-measure; LEDs fail slowly from heat, so an overcurrent shows up as a shortened life rather than an immediate pop, which makes it easy to miss without the meter.

Frequently asked questions

What resistor do I need for a 5V LED circuit?

For a red LED at 1.8 V and 20 mA: R = (5 - 1.8) / 0.02 = 160 ohms, so pick 180 ohms and the current lands at 17.8 mA.

What resistor for a 12V LED?

A 12 V supply with a white 3.2 V LED at 20 mA needs 440 ohms exact, so use 470 ohms, which passes 18.7 mA.

Can I run an LED without a resistor?

Not from a stiff supply. The LED current climbs steeply once the forward voltage is reached, and without a resistor or a driver the part can burn out in seconds.

What is the forward voltage of a red LED?

Typically 1.8 to 2.2 V. The exact value depends on the part and the current, so check the datasheet or measure it.

Why is my LED current lower than the calculation?

The real forward voltage is probably higher than the value you entered, which leaves fewer volts for the resistor. Measure it and recalculate.

What resistor for a 3.3V red LED?

(3.3 - 1.8) / 0.02 = 75 ohms exact, so use 82 ohms and get about 18.3 mA.

How many LEDs can I put in series on 12V?

Divide 12 V by the forward voltage and round down: four 2 V reds (8 V total) or three 3.2 V whites (9.6 V) fit, but not four whites at 12.8 V.

Can LEDs share one resistor in parallel?

No. Each parallel branch needs its own resistor, or the LED with the lower forward voltage takes most of the current and can fail.

What wattage resistor for an LED circuit?

P = I x I x R. A 20 mA circuit through 470 ohms burns 0.188 W, so a half watt part is a safer pick than a quarter watt.

What resistor for a 1W LED on 5V?

At 350 mA and a 3.2 V forward voltage: (5 - 3.2) / 0.35 = 5.1 ohms, burning 0.63 W, so use a 2 W resistor or a constant current driver.

Why do LEDs light unevenly with one resistor?

Forward voltage varies between parts, so the lowest voltage LED draws the most current, heats up, and draws even more, a feedback loop called thermal runaway.

What happens at 14.4V instead of 12V?

Current rises with the extra volts. The 470 ohm white LED circuit goes from 18.7 mA at 12 V to 23.8 mA at 14.4 V, so size for the top of the rail.

Should I round the resistor up or down?

Round up to the next standard value. Rounding up only trims brightness slightly, while rounding down pushes the current past the target.

Is 20 mA safe for every 5mm LED?

It is the common rating, not a universal one. Some parts are rated 30 mA and high brightness types less, so confirm the datasheet maximum.

Spotted a wrong number or a broken result?

More Tech tools

See all Tech tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.