MakerKiln

LED Resistor Calculator

The series resistor an LED needs, from your supply voltage, the LED's forward voltage and the current you want to run.

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

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:

<iframe src="https://makerkiln.com/led-resistor-calculator/embed/" title="LED Resistor Calculator" loading="lazy" style="width:100%;max-width:560px;height:560px;border:1px solid #d9dee8;border-radius:14px"></iframe>
<p style="font:13px/1.4 system-ui,sans-serif;margin:6px 2px">Free calculator by <a href="https://makerkiln.com/led-resistor-calculator/" target="_blank" rel="noopener">MakerKiln</a></p>
<script>window.addEventListener("message",function(e){if(e.data&&e.data.mk==="h"&&e.data.slug==="led-resistor-calculator"){var f=document.querySelector('iframe[src="https://makerkiln.com/led-resistor-calculator/embed/"]');if(f){f.style.height=e.data.h+"px"}}});</script>
Download the file

Prefer to host it yourself, offline or on an intranet? Download the file above. Keep the MakerKiln credit and it is free to use.