Resistor formula for an LED
In a simple indicator circuit, the resistor drops the voltage left over after the LED forward-voltage drop. For a string of identical LEDs in series:
Total Vf = number of LEDs × Vf of each LED
Voltage across resistor = supply voltage − total Vf
Ideal R = voltage across resistor / target current
With a 5 V supply, a 2 V LED and a target current of 20 mA, the ideal
resistance is:
R = (5 V − 2 V) / 0.020 A = 150 Ω
The ideal value comes from the formula, but a real resistor has a
commercial value and tolerance. With E24 and ±5%, the tool recommends
160 Ω. Its lower limit is 152 Ω, so the calculated current does not
exceed 20 mA because of tolerance alone.
Full 5V example
Press Load example to check this result:
| Magnitude | Result |
|---|---|
| Supply voltage | 5 V |
| Forward voltage | 2 V |
| Target current | 20 mA |
| Ideal resistance | 150 Ω |
| Recommendation E24, ±5% | 160 Ω |
| Nominal current | 18.75 mA |
| Maximum current from tolerance | 19.736842 mA |
| Rated power per resistor | 56.25 mW |
| Recommended nominal power | 1/8 W |
The recommended power leaves at least double the maximum dissipation calculated. This is a conservative margin for selecting the component, not a replacement for the manufacturer’s thermal curves.
LEDs in series
LEDs on the same branch carry the same current and their forward voltages add
up. Three 2 V LEDs need about 6 V; with a 12 V supply, the remaining
6 V is dropped across the resistor.
The supply must strictly exceed the sum of Vf. With a supply of 6 V
and three 2 V LEDs there is no room for current limiting with this model;
the calculator will display an error instead of suggesting 0 Ω.
Branches in parallel: one resistor per branch
The “Equal branches in parallel” field repeats the entire string and its resistor. Two branches with three LEDs in series require six LEDs and two resistors, not a common resistor.
Texas Instruments documents that even LEDs from the same batch can have different current-voltage curves. Without balancing resistors, parallel LEDs may not share current equally. A resistor in series with each branch reduces that imbalance.
The resistor value does not change when adding equal branches; the total source current and total dissipated power do. Check that the source, tracks, and any transistors can supply that sum.
Use forward voltage from the datasheet
Vf is not determined by color alone. It depends on the model, current,
temperature and manufacturing bin. A real Cree LED datasheet, for example,
gives a forward-voltage range at a specific current and temperature.
Consult your component’s tables and curves. To estimate the circuit’s maximum
current, check the minimum forward voltage and maximum supply voltage instead of
using only typical values. This version accepts one supply value and one Vf;
it does not automatically analyze every system tolerance.
E12 and E24 values
Resistors are sold in preferred values that are repeated for decades. IEC 60063 defines these series for resistors and capacitors.
- E12 offers 12 steps per decade and is often sufficient for components with wide tolerance.
- E24 offers 24 steps and allows you to get closer to the calculated result.
The tool chooses the first standard value equal to or greater than the minimum that keeps current within the target at the selected negative tolerance. That is why the recommendation can jump above the ideal value.
Resistor current and power
After choosing the standard value, the nominal current is calculated again with Ohm’s law:
I = voltage across resistor / preferred resistor
P = voltage across resistor × I
The minimum current uses the resistor at its positive tolerance limit and the maximum uses the negative limit. Maximum power is also calculated with the minimum resistance. The recommended power rating is the first common value that provides a twofold margin.
A resistor may need more margin due to ambient temperature, ventilation, encapsulation, mounting, pulses or reliability. Check the datasheet if the dissipation is not small compared to its nominal power.
If the LED is controlled from a GPIO
The calculator assumes that the entered voltage reaches the resistor-and-LED
circuit. A microcontroller pin can have a different output voltage under load,
as well as per-pin, per-port and device-wide limits. The
Texas Instruments material on LED indicators
includes the control circuit’s output drop and checks the worst case for Vf
and tolerance.
If there is a transistor, MOSFET, buffer, long wire or series protection, its drop is also part of the voltage budget. Do not increase GPIO current just because the LED supports it.
When to use a current controller
A resistor is suitable for simple indicators powered by a reasonably stable DC supply. For power LEDs, lighting, high currents, batteries with a wide voltage range, strings close to the supply voltage or precise brightness control, a constant-current driver is usually more appropriate.
The resistor converts excess voltage into heat. If the result requires several
watts, the circuit may be inefficient even when the arithmetic is correct. This
tool limits inputs to 60 V and 100 mA; it must not be used to design mains
connections.
Common errors
- Using an approximate
Vfby color instead of the datasheet. - Confusing milliamperes with amperes.
- Forgetting to add the forward voltages of LEDs in series.
- Putting several LEDs in parallel behind a single resistor.
- Choosing the closest standard value even when it lowers resistance too much.
- Ignoring tolerance and dissipated power.
- Assuming that a GPIO output maintains its ideal voltage under any load.
- Using a resistor for a power LED that needs current control and thermal management.
Result limits
The calculation assumes identical LEDs, an ideal DC supply and one resistor per
branch. It does not include supply variation, the minimum and maximum Vf range,
junction temperature, transistor or wire dropout, PWM, perceptual brightness,
RGB LEDs, matrices or different branches.
The E12 and E24 values are generated locally and shown as a purchasing recommendation, but resistor availability and technology must be confirmed for the real circuit.
To review the complete process—Vf, voltage range, commercial value,
tolerance and power—see how to calculate an LED
resistor.
Frequently asked questions
Is the current per LED or total?
It is the current of a branch. All series LEDs on that branch drive the same current. If there are multiple branches, the approximate total current is current of each branch multiplied by their number.
Can I use a single resistor for multiple LEDs in parallel?
The tool does not model that circuit. Use one resistor per branch so differences
in Vf do not leave current sharing entirely to the LED curves. The
Texas Instruments report on parallel LEDs
explains the problem and the trade-off between balancing and dissipation.
Why do you recommend more ohms than the ideal formula?
Because it accounts for negative tolerance before moving up to the next E12 or E24 value. The lowest resistance limit therefore does not exceed the target current because of that tolerance alone. Nominal current is usually a little lower.
Does 1/8W or 1/4W power guarantee that it won’t get hot?
No. It is the first common value that doubles the maximum calculated power. The ambient temperature, packaging and mounting may require more leeway.
Are the entered values sent?
No. The entries and result remain in this tab. The calculation uses no backend or storage and makes no processing requests. Aggregate page-view measurement is separate and never receives the entered values.