Skip to content

Free calculator

LED resistor calculator

An LED needs a resistor in series to set its current. The LED keeps its forward voltage for itself, and the resistor takes whatever is left of the supply. Type your supply, pick the LED's colour and the current you want, and this gives the resistor to fit.

A USB port or Arduino pin is 5 V.

Sets the forward voltage below.

From the LED's datasheet, if you have it.

20m = 20 mA, a typical small LED's limit.

Resistor to fit

390 Ω
Exact value
350 Ω
Current with it
17.9 mA
Resistor's power
126 mW
Rating to buy
½ W or more
Colour bands
orange, white, brown
Each LED's power
35.9 mW

350 Ω isn't a value you can buy, so this rounds up to the next standard (E12) value. Rounding up keeps the current at or under your target.

The sum

R = Vsupply − VLED over I

For a string of LEDs in series, take off every LED's forward voltage: Vsupply − n × VLED.

A worked example

A 9 V battery, a red LED that drops about 2.0 V, and a target of 20 mA:

R = 9 − 2.0 over 0.02 = 350 Ω

350 Ω isn't a value you can buy, so round up to the next standard (E12) value: 390 Ω. That gives (9 − 2) ÷ 390 ≈ 18 mA, a touch under the target. The resistor burns 7 × 0.018 ≈ 0.126 W, just over half a ¼ W part's rating, so a ½ W resistor will run cooler and last longer.

Free lesson

Now build it yourself

Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.

Try it yourself: free lesson

“Ohm's law” is lesson 5 of 6 in Copper Flats, Electronics World 1. Free with an account. Lessons unlock in order, so you’ll do the 4 before it first.

Or start from the very first lesson, no account needed

The ideas behind it

Questions people ask

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

For a red LED at 20 mA: (5 − 2.0) ÷ 0.02 = 150 Ω, which is a standard value. A blue or white LED drops about 3.2 V, so (5 − 3.2) ÷ 0.02 = 90 Ω, and you'd fit 100 Ω.

Why round up and not down?

A bigger resistor means less current. Rounding up keeps the LED at or under the current you chose; rounding down pushes it over.

Can several LEDs share one resistor?

In series, yes: one resistor sets the current for the whole string, as long as the supply is bigger than all their forward voltages added up. In parallel, give each LED its own resistor, because the one with the lowest forward voltage would take most of the current.

What current should an LED run at?

Most small 5 mm LEDs are rated 20 mA, and many are bright enough at 5–10 mA. An Arduino pin should stay well under 20 mA. Check the datasheet for your part.

More calculators

Every calculator