Get a quote

Free tool

LED resistor calculator

Choose the supply or pin voltage, the LED colour (or type its forward voltage), the current you want and how many LEDs share the string. You get the exact resistor, the next standard E12 and E24 values with the current each gives, the power in the resistor and a rating that covers it.

5 V red LED, 10 mA: 300 ΩPin voltage to resistor, part T-02

Free tool. Nothing to sign up for, and nothing you type leaves your browser.

A steel control box open on a Witbank workshop bench with a row of red, green and yellow indicator LEDs in its door and a small blue microcontroller board inside

LED resistor calculator

Runs in your browser, nothing is sent
The supply
The LED

20 mA is a common maximum for 5 mm indicator LEDs, and 5 to 10 mA is often bright enough. A microcontroller pin has its own limit per pin and for the whole chip: check the datasheet.

LED resistor

Resistor
-
Nearest E12 at or above
-
Nearest E24 at or above
-
Across the resistor
-
Resistor power and rating
-
LED power
-


Copies these results into the Details box of the quote request on this page.

Typical figures for planning. The LED's datasheet gives the forward voltage and the current it is rated for, and the microcontroller's datasheet gives what each pin can drive.

The same LED (2 V, 10 mA, 1 in series) on other supplies
SupplyResistorNearest E12Resistor power
3.3 V130 Ω150 Ω13 mW
5 V (yours)300 Ω330 Ω30 mW
12 V1,000 Ω1 kΩ100 mW
24 V2,200 Ω2.2 kΩ220 mW

Before you solder it in

  • The forward voltage changes with colour, maker and current, and the datasheet gives a range. Measure across a lit LED with a multimeter if the brightness matters.
  • Each LED gets its own resistor when LEDs run side by side (in parallel). One shared resistor lets the LED with the lowest forward voltage take most of the current.
  • An Uno or Nano pin is a 5 V supply for this sum; an ESP32, Pico or STM32 pin is 3.3 V. For more than a few mA per pin, switch the LED with a transistor or MOSFET. More on the board on Arduino Uno.
  • LED strips and high power LEDs are a different job: strips have their resistors on board, and power LEDs need a constant current driver.

A fitter in Witbank (eMalahleni) is building a status panel for a conveyor: an Uno drives a few LEDs from its 5 V pins, and the rest hang off the plant's 24 V supply. Each needs a series resistor, and guessing gives a dim LED, a dead one or a hot resistor. This calculator works the value out and picks the standard part. The board itself is on Arduino Uno.

What the resistor has to drop

An LED holds roughly its forward voltage across itself, whatever the supply. The resistor takes the rest and sets the current: resistance = (supply less the LED voltages) / current. The forward voltage depends on colour: about 2.0 V for red, 2.1 V for yellow, 2.2 V for older yellow green, around 3.0 to 3.1 V for bright green, blue and white, and 1.3 V for infrared. Those are typical figures; the LED's datasheet gives the real range at your current.

Worked example: one red LED on a 5 V pin

The starting figures are a 5 V pin, one red LED at a typical 2.0 V and 10 mA:

FigureResult
Across the resistor3 V
Exact resistor300 Ω
Next E12 value330 Ω, giving 9.09 mA
Next E24 value300 Ω, giving 10 mA
Resistor power30 mW
LED power20 mW

A 1/8 W resistor already has double the margin, and the common 1/4 W part is fine.

The 24 V side of the panel

The table under the calculator runs the same LED on other supplies. At 3.3 V it needs 130 Ω, 150 Ω in E12. At 12 V it is 1 kΩ and 100 mW. At 24 V it is 2.2 kΩ and 220 mW: too close to a 1/4 W rating, so the calculator suggests 1/2 W. LEDs in series can share one resistor if their forward voltages add up to well under the supply; LEDs side by side each need their own.

Pin limits and when to use a transistor

20 mA is a common maximum for 5 mm indicator LEDs, and 5 to 10 mA is often bright enough indoors. A microcontroller pin has its own limit, per pin and for the whole chip, and the datasheet gives both. For bright LEDs, many LEDs or anything over about 20 mA, let the pin switch a transistor or MOSFET and let the supply carry the current.

Frequently asked questions

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

For a red LED at 10 mA, (5 less 2.0) / 0.010 = 300 Ω, so 330 Ω from the E12 series. A blue or white LED at about 3.1 V needs 190 Ω, so 220 Ω. Check the LED's datasheet for its forward voltage and rated current.

Can I connect an LED without a resistor?

Not to a voltage source. Nothing limits the current, so the LED, the pin or both can fail. Boards with a built in LED already have its resistor, and LED modules and strips usually do too; a bare LED always needs one or a constant current driver.

Why is my blue LED dim on a 3.3 V board?

A blue or white LED needs about 3.1 V, which leaves only 0.2 V for the resistor on a 3.3 V pin. The current then swings with every small change in voltage. Power the LED from 5 V and switch it with a transistor from the 3.3 V pin.

Who will quote me for LEDs, resistors or a panel build in Witbank (eMalahleni)?

Electronics shops, component distributors and builders of small control panels who work in and around Witbank. Send the request on this page with the parts or the job; we pass it on and they quote you directly. We sell, build and program nothing ourselves.

Read more

More tools

Get a quote for Arduino Uno

Tell us what you need: Arduino, ESP32, Raspberry Pi, Pico or STM32 boards, starter kits, chips, components, sensors, motors and displays, a soldering station, a PLC or PLC programming, PCBs made, designed or assembled, firmware, an IoT device or an Arduino project built for you. Electronics suppliers, distributors, PCB houses, embedded developers and PLC integrators who work in your area quote you directly. We sell, stock, make or program nothing ourselves. It is free and there is no obligation. Please leave out your street address.

Parts and services requestArduino Uno
Request
No. MC-9578
Status
Not sent

The request

What you want optional, it helps the quote

Your request-

The list optional

Up to 12 lines: boards, chips, sensors, motors, PCBs, hours of programming or a build.

Usual lines, tap to add:

Needs and options

You

Free and no obligation. By sending you agree that we may share your request with suitable electronics suppliers, PCB houses, developers and PLC integrators. See our privacy policy.