Local onlyThe math runs in JavaScript in this tab. Your figures are remembered in this browser's local storage, and nothing is uploaded.
An LED is a diode, not a bulb. Give it the full supply voltage and it pulls as much current as it can and burns out. A resistor in series holds the current down to a safe level. Tell this your supply, the LED's forward voltage and the current you want, and it gives you the resistor to use.
The formula
The resistor carries the voltage the LED does not. Subtract the LED's forward voltage from the supply, and divide by the current in amps. A 5 V supply, a 2 V red LED and 20 mA works out to three volts across the resistor, divided by 0.02 amps, which is 150 ohms. That is the whole of it, and it is the value this rounds to the nearest resistor you can actually buy.
Forward voltage and current
The forward voltage comes from the LED's color and its datasheet. Red sits around 1.8 to 2.2 volts, yellow and green a little higher, and blue and white up around 3 to 3.4. Current is your choice up to the LED's rating, usually 20 mA. Most indicator LEDs look just as bright at half that, and running them softer keeps them cool and lasts longer.
The power rating matters
The resistor turns the leftover voltage into heat, and it has to be built to take it. The power is the voltage it drops times the current through it. At a few milliamps a quarter-watt resistor is fine, but push the current up or drop a lot of voltage and the resistor runs hot, so size it with room to spare. This shows the wattage and names a rating to clear it.
More than one LED
LEDs in series share one resistor, and their forward voltages add up, so three 2 V LEDs need 6 volts before the resistor even starts. Keep the total below your supply or there is nothing left to drive them. LEDs in parallel each want their own resistor, because no two LEDs are identical and a single shared resistor lets the greedy one hog the current.
More MakerKiln tools
- vrefStepper Driver VrefThe voltage to dial into an A4988, DRV8825 or TMC2209 for the current you actually want.→
- per hour3D Printer Cost Per HourWhat an hour on the machine costs you, for 11 common printers side by side.→
- price itHandmade Pricing CalculatorMaterials, time, running costs and every sales fee, turned into a price that leaves real profit.→
Put this calculator on your site
Free to embed, and welcome. It runs the same way, in your visitor's browser, and it sizes itself to fit. Paste this where you want it, and it stays current on its own:
Prefer to host it yourself, offline or on an intranet? Download the file above. Keep the MakerKiln credit and it is free to use.