LED resistor calculator

The series resistor for an LED — rounded up to a value you can buy, because rounding to the nearest puts more current through the LED than you asked for. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.

It has to round up, and every other calculator rounds to the nearest

The sum is easy: the resistor drops whatever the LED does not, so R = (supply − forward) ÷ current. The answer is almost never a value you can buy, and which way you round it is not a detail. Round down to the nearest preferred value and the LED gets more current than you asked for; round up and it gets less, which is always safe.

This page rounds up, and tells you the current the LED will actually draw as a result.

The forward voltage is not a constant

It depends on the colour — roughly 1.8 V for red up to 3.2 V or more for blue and white, because the voltage is set by the band gap of the semiconductor and that is what decides the colour. It also drifts with temperature and varies between parts from the same reel. The figures in the dropdown are typical, not specified; the datasheet for your actual LED is the authority, and using a typical figure is exactly why you want the safe direction of rounding.

Never connect an LED straight to a supply

An LED is a diode, not a resistor. Past its forward voltage the current rises almost vertically with voltage, so there is nothing to limit it but the supply and the wiring — and it will destroy itself, usually in less than a second. The resistor is not an optimisation. A coin cell gets away with it only because its own internal resistance is doing the job.

The resistor has to survive it too

It dissipates (supply − forward) × current, which for a 12 V supply and a 20 mA red LED is about 0.2 W — enough that a 1/4 W part runs warm and a 1/8 W part is a mistake. The convention is to buy at least double the calculated power. The tool says which standard rating that is.

The resistor's tolerance moves the current too

A 5% resistor marked 150 Ω is anywhere between 142.5 and 157.5 Ω, so a nominal 20 mA is really 19 to 21 mA before the LED's own spread is counted. That is fine — an LED's brightness barely changes over a few per cent of current, which is why 5% parts are normal here and 1% parts are a waste of money. It matters only when you are running near the part's absolute maximum, and the answer there is to stop doing that.

Several LEDs: in series, not in parallel

LEDs in series share one resistor and one current, and that works as long as the supply is bigger than all their forward voltages added together. LEDs in parallel on one resistor do not share anything: the one with the lowest forward voltage takes most of the current, gets hotter, drops even less, and takes more still. Give each one its own resistor.

What it will not do

Where to go next