LED Resistor Calculator
Every LED needs a series current-limiting resistor to prevent it from drawing too much current and burning out. This calculator works out the correct resistor value from three simple inputs: the supply voltage, the forward voltage of the LED, and the current you want the LED to draw. The result is both the exact calculated resistance and the nearest E24 standard resistor value from your component bin, plus the power the resistor will dissipate. The formula is straightforward. An LED is not a simple resistor; it has a characteristic forward voltage, below which almost no current flows and above which current rises steeply. The resistor sits in series with the LED to absorb the difference between the supply voltage and the LED forward voltage, limiting the current to a safe level. If the supply is 5 V and the LED forward voltage is 2.1 V, then 2.9 V must be dropped across the resistor. At a desired current of 20 mA (0.020 A), the required resistance is 2.9 / 0.020 = 145 ohms. The nearest E24 value is 150 ohms, which gives a slightly lower current of about 19.3 mA, well within the LED's safe operating range. The power dissipated in the resistor is 2.9 x 0.020 = 0.058 W, so a standard quarter-watt (250 mW) resistor is more than adequate. Common LED forward voltages are around 1.8 V to 2.2 V for red and yellow, 2.8 V to 3.5 V for green and blue, and similar for white LEDs. The 5 V supply used in the default is typical of a USB port, Arduino or Raspberry Pi GPIO pin used in NZ maker and hobbyist projects.
Always use a resistor with a power rating at least twice the calculated dissipation. Standard 1/4 W (250 mW) resistors suit most low-power LED circuits.
How it works
The voltage across the resistor is Vr = Vsupply minus Vled. The required resistance is R = Vr / I, where I is the desired current in amperes (milliamps divided by 1000). The nearest E24 standard value is found by computing E24 = 10^(round(24 x log10(R)) / 24) and selecting the closest value from the E24 series. The actual current with the E24 resistor is Ia = Vr / E24. Power in the resistor is P = Vr x I (exact) or Vr x Ia (with standard resistor). If the supply voltage is less than or equal to the LED forward voltage, the resistor result shows a warning because the LED would not light.
Worked example
Supply voltage is 5 V and the LED forward voltage is 2.1 V (a common red LED). The voltage across the resistor is 5 minus 2.1 = 2.9 V. With a desired current of 20 mA (0.020 A), the required resistance is 2.9 / 0.020 = 145 ohms. The nearest E24 standard value is 150 ohms, which allows an actual current of 2.9 / 150 = 19.3 mA. The resistor dissipates 2.9 x 0.020 = 58.0 mW, well within the rating of a standard 250 mW resistor. These match the default values above.
Related calculators
- Volts Amps Watts Ohms Calculator: solve any two of V, I, R and P using Ohm's Law.
- Voltage Divider Calculator: calculate the output voltage of a resistor voltage divider.
- Amp Hour and Battery Life Calculator: find how long a battery will power a given load.
- RC Time Constant Calculator: charging and discharging times for an RC circuit.