Pick a supply voltage and an LED colour, check the forward current, then press Calculate to get the limiting resistor value.
Choosing a colour fills in a typical forward voltage (Vf) below. Datasheet values vary by manufacturer, adjust it if you know the exact figure.
Most 3mm and 5mm indicator LEDs are happy between 10mA and 20mA. Check the datasheet before going higher.
Always fit a resistor rated at or above the recommended power shown here, and double-check the LED polarity before powering the circuit. A resistor run too close to its rated power gets hot and can fail over time.
Why a GPIO pin cannot drive an LED on its own
A Raspberry Pi GPIO pin, designed in Cambridge and now sitting on countless bedroom desks and school benches, outputs 3.3V and can only source a few tens of milliamps safely. Wire an LED straight to it, or to an Arduino's 5V rail, and the LED's low internal resistance once lit lets current climb far past that limit within seconds, damaging the pin or the LED itself. GCSE Design and Technology electronics courses teach the series resistor as the fix: it absorbs the spare voltage and fixes the current at a safe value.
Typical forward voltages and the E24 resistor series
| LED colour | Typical Vf |
|---|---|
| Infrared | 1.2V |
| Red | 2.0V |
| Yellow | 2.1V |
| Green | 2.2V |
| Blue / White | 3.2V |
| Ultraviolet | 3.4V |
Resistors sold in the UK almost always come from the E24 series, twenty four values per decade (1.0, 1.1, 1.2, 1.3, 1.5... up to 9.1, then the decade repeats). The calculator rounds your result to the nearest of those values so the figure matches what is actually in a component drawer or on a supplier's shelf.
What this calculator cannot do
This tool sizes a resistor for a single LED on a steady DC supply. It will not size a resistor for LEDs wired in series or in parallel strings, does not allow for battery voltage sagging as it discharges, and does not replace the maximum current figure printed on the actual component datasheet.
A worked example
A red LED (Vf = 2.0V) run from a 5V USB supply at 20mA needs R = (5 - 2.0) / 0.02 = 150 ohms, dissipating P = (5 - 2.0) x 0.02 = 0.06W, well inside a standard 0.25W resistor. For any other single-component electrical sum, from Ohm's law to power, try the Ohm's Law Calculator, or convert the result into other physics units with the Physics Unit Converter.