Home › Engineering & Automotive › LED Resistor Calculator
LED Resistor Calculator
Computes the current-limiting series resistor for one or more LEDs in series from the supply voltage, LED forward voltage and desired current, then picks the nearest E12 and E24 preferred values, a safe (rounded-up) E24 value and the resistor power rating.
When to use
You are wiring an LED (or a string of LEDs in series) to a DC supply and need the resistor value, a standard part value and its wattage.
Do not use when: LEDs are in parallel (each branch needs its own resistor), you drive high-power LEDs with a constant-current driver, or you only need Ohm's law (use ohms-law).
Formula
resistor_ohm = (supply_voltage_v − leds_in_series × led_forward_voltage_v) / (led_current_ma / 1000); resistor_power_w = (supply_voltage_v − leds_in_series × led_forward_voltage_v) × led_current_ma / 1000; rating ≥ 2 × resistor_power_w
Standard values follow IEC 60063 E12/E24 series. The 2× power margin is the usual derating rule so the resistor runs cool; LED forward voltage varies ±10 % between parts and with temperature, so the actual current differs slightly.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
supply_voltage_v | number | V | yes | DC supply voltage in volts (e.g. 5, 9, 12, 24). Range: > 0, ≤ 1000 |
led_forward_voltage_v | number | V | default 2 | Forward voltage drop of one LED at the design current: red/yellow ≈ 1.8–2.2 V, green ≈ 2.0–3.2 V, blue/white ≈ 3.0–3.6 V. Range: > 0, ≤ 50 |
led_current_ma | number | mA | default 20 | Desired forward current in milliamperes; 20 mA is typical for 5 mm indicator LEDs. Range: > 0, ≤ 5000 |
leds_in_series | integer | default 1 | Number of LEDs connected in series in one string. Range: ≥ 1, ≤ 100 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
total_led_voltage_v | number | V | leds_in_series × led_forward_voltage_v. |
resistor_voltage_v | number | V | supply_voltage_v − total_led_voltage_v. |
resistor_ohm | number | Ω | R = resistor_voltage_v / led_current_a. |
nearest_e12_ohm | number | Ω | Closest value in the E12 (10 %) preferred-number series. |
nearest_e24_ohm | number | Ω | Closest value in the E24 (5 %) preferred-number series. |
recommended_resistor_ohm | number | Ω | Smallest E24 value at or above the exact value, so the LED current does not exceed the target. |
current_with_recommended_ma | number | mA | resistor_voltage_v / recommended_resistor_ohm × 1000. |
resistor_power_w | number | W | Power dissipated in the resistor: resistor_voltage_v × led_current_a. |
recommended_power_rating_w | number | W | Smallest standard rating (1/8, 1/4, 1/2, 1, 2, 3, 5 W …) at or above twice the dissipated power. |
Example
12 V supply, 2 V LED, 20 mA: {"supply_voltage_v":12,"led_forward_voltage_v":2,"led_current_ma":20} → {"total_led_voltage_v":2,"resistor_voltage_v":10,"resistor_ohm":500,"nearest_e12_ohm":470,"nearest_e24_ohm":510,"recommended_resistor_ohm":510,"current_with_recommended_ma":19.61,"resistor_power_w":0.2,"recommended_power_rating_w":0.5}
Three 3.2 V white LEDs in series on 12 V at 20 mA: {"supply_voltage_v":12,"led_forward_voltage_v":3.2,"led_current_ma":20,"leds_in_series":3} → {"total_led_voltage_v":9.6,"resistor_ohm":120,"nearest_e12_ohm":120,"recommended_resistor_ohm":120,"current_with_recommended_ma":20,"resistor_power_w":0.048,"recommended_power_rating_w":0.125}
GET https://tttkmbb.com/api/v1/calculate/led-resistor?supply_voltage_v=12&led_forward_voltage_v=2&led_current_ma=20
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/led-resistor(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/led-resistor · Markdown: https://tttkmbb.com/engineering/led-resistor.md · JSON definition: https://tttkmbb.com/engineering/led-resistor.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="led-resistor" - OpenAPI operationId:
calculate_led_series_resistor - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – LED circuit (reference)
- Wikipedia – E series of preferred numbers (IEC 60063) (reference)
FAQ
Why round the resistor up rather than to the nearest value?
A larger resistor lowers the current slightly (dimmer but safe); a smaller one raises it above the LED rating. The nearest values are reported for reference, the recommended value is the next E24 value at or above the exact result.
What if the supply voltage barely exceeds the LED voltage?
The resistor becomes very small and the current very sensitive to voltage tolerance. Keep at least 2–3 V across the resistor, or use a constant-current driver.
How many LEDs can I put in series?
Their forward voltages must sum to less than the supply voltage; the calculator returns an error otherwise.
Related calculators
- Ohm's Law Calculator — The same V = I·R relation for any resistor.
- Resistor Color Code Calculator — Read or produce the colour bands of the chosen resistor.
- Voltage Divider Calculator — Derive a lower voltage with two resistors.