{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"led-resistor"},"result":{"entity_type":"calculator","id":"led-resistor","calculator_id":"led-resistor","canonical_url":"https://tttkmbb.com/engineering/led-resistor","name":"LED Resistor Calculator","title":"LED Series Resistor Calculator – Resistor Value, E12/E24 Standard Value and Power Rating","category":"engineering","category_name":"Engineering & Automotive","tool_name":"calculate_led_series_resistor","featured_mcp_tool":false,"description":"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.","use_when":"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).","inputs":[{"name":"supply_voltage_v","label":"Supply voltage","type":"number","unit":"V","required":true,"max":1000,"exclusive_min":0,"description":"DC supply voltage in volts (e.g. 5, 9, 12, 24).","example":12},{"name":"led_forward_voltage_v","label":"LED forward voltage","type":"number","unit":"V","required":false,"default":2,"max":50,"exclusive_min":0,"description":"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.","example":2},{"name":"led_current_ma","label":"LED current","type":"number","unit":"mA","required":false,"default":20,"max":5000,"exclusive_min":0,"description":"Desired forward current in milliamperes; 20 mA is typical for 5 mm indicator LEDs.","example":20},{"name":"leds_in_series","label":"LEDs in series","type":"integer","required":false,"default":1,"min":1,"max":100,"description":"Number of LEDs connected in series in one string.","example":1}],"outputs":[{"name":"total_led_voltage_v","label":"Total LED voltage","type":"number","unit":"V","decimals":3,"description":"leds_in_series × led_forward_voltage_v."},{"name":"resistor_voltage_v","label":"Voltage across resistor","type":"number","unit":"V","decimals":3,"description":"supply_voltage_v − total_led_voltage_v."},{"name":"resistor_ohm","label":"Exact resistor value","type":"number","unit":"Ω","decimals":2,"description":"R = resistor_voltage_v / led_current_a."},{"name":"nearest_e12_ohm","label":"Nearest E12 value","type":"number","unit":"Ω","decimals":2,"description":"Closest value in the E12 (10 %) preferred-number series."},{"name":"nearest_e24_ohm","label":"Nearest E24 value","type":"number","unit":"Ω","decimals":2,"description":"Closest value in the E24 (5 %) preferred-number series."},{"name":"recommended_resistor_ohm","label":"Recommended resistor","type":"number","unit":"Ω","decimals":2,"description":"Smallest E24 value at or above the exact value, so the LED current does not exceed the target."},{"name":"current_with_recommended_ma","label":"Current with recommended resistor","type":"number","unit":"mA","decimals":2,"description":"resistor_voltage_v / recommended_resistor_ohm × 1000."},{"name":"resistor_power_w","label":"Resistor power","type":"number","unit":"W","decimals":4,"description":"Power dissipated in the resistor: resistor_voltage_v × led_current_a."},{"name":"recommended_power_rating_w","label":"Recommended power rating","type":"number","unit":"W","decimals":3,"description":"Smallest standard rating (1/8, 1/4, 1/2, 1, 2, 3, 5 W …) at or above twice the dissipated power."}],"input_schema":{"type":"object","properties":{"supply_voltage_v":{"description":"DC supply voltage in volts (e.g. 5, 9, 12, 24). Unit: V.","type":"number","maximum":1000,"exclusiveMinimum":0,"examples":[12],"x-unit":"V"},"led_forward_voltage_v":{"description":"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. Unit: V.","type":"number","maximum":50,"exclusiveMinimum":0,"default":2,"examples":[2],"x-unit":"V"},"led_current_ma":{"description":"Desired forward current in milliamperes; 20 mA is typical for 5 mm indicator LEDs. Unit: mA.","type":"number","maximum":5000,"exclusiveMinimum":0,"default":20,"examples":[20],"x-unit":"mA"},"leds_in_series":{"description":"Number of LEDs connected in series in one string.","type":"integer","minimum":1,"maximum":100,"default":1,"examples":[1]}},"additionalProperties":false,"required":["supply_voltage_v"]},"output_schema":{"type":"object","properties":{"total_led_voltage_v":{"description":"leds_in_series × led_forward_voltage_v. Unit: V.","type":"number","x-unit":"V"},"resistor_voltage_v":{"description":"supply_voltage_v − total_led_voltage_v. Unit: V.","type":"number","x-unit":"V"},"resistor_ohm":{"description":"R = resistor_voltage_v / led_current_a. Unit: Ω.","type":"number","x-unit":"Ω"},"nearest_e12_ohm":{"description":"Closest value in the E12 (10 %) preferred-number series. Unit: Ω.","type":"number","x-unit":"Ω"},"nearest_e24_ohm":{"description":"Closest value in the E24 (5 %) preferred-number series. Unit: Ω.","type":"number","x-unit":"Ω"},"recommended_resistor_ohm":{"description":"Smallest E24 value at or above the exact value, so the LED current does not exceed the target. Unit: Ω.","type":"number","x-unit":"Ω"},"current_with_recommended_ma":{"description":"resistor_voltage_v / recommended_resistor_ohm × 1000. Unit: mA.","type":"number","x-unit":"mA"},"resistor_power_w":{"description":"Power dissipated in the resistor: resistor_voltage_v × led_current_a. Unit: W.","type":"number","x-unit":"W"},"recommended_power_rating_w":{"description":"Smallest standard rating (1/8, 1/4, 1/2, 1, 2, 3, 5 W …) at or above twice the dissipated power. Unit: W.","type":"number","x-unit":"W"}}},"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","method":"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.","sources":[{"name":"Wikipedia – LED circuit","url":"https://en.wikipedia.org/wiki/LED_circuit","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – E series of preferred numbers (IEC 60063)","url":"https://en.wikipedia.org/wiki/E_series_of_preferred_numbers","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"12 V supply, 2 V LED, 20 mA","inputs":{"supply_voltage_v":12,"led_forward_voltage_v":2,"led_current_ma":20},"expected":{"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},"url":"https://tttkmbb.com/api/v1/calculate/led-resistor?supply_voltage_v=12&led_forward_voltage_v=2&led_current_ma=20"},{"name":"Three 3.2 V white LEDs in series on 12 V at 20 mA","inputs":{"supply_voltage_v":12,"led_forward_voltage_v":3.2,"led_current_ma":20,"leds_in_series":3},"expected":{"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},"url":"https://tttkmbb.com/api/v1/calculate/led-resistor?supply_voltage_v=12&led_forward_voltage_v=3.2&led_current_ma=20&leds_in_series=3"}],"faq":[{"q":"Why round the resistor up rather than to the nearest value?","a":"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."},{"q":"What if the supply voltage barely exceeds the LED voltage?","a":"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."},{"q":"How many LEDs can I put in series?","a":"Their forward voltages must sum to less than the supply voltage; the calculator returns an error otherwise."}],"tags":["led resistor","led series resistor","current limiting resistor","led calculator","forward voltage"],"related":[{"calculator_id":"ohms-law","reason":"The same V = I·R relation for any resistor."},{"calculator_id":"resistor-color-code","reason":"Read or produce the colour bands of the chosen resistor."},{"calculator_id":"voltage-divider","reason":"Derive a lower voltage with two resistors."}],"links":{"html":"https://tttkmbb.com/engineering/led-resistor","markdown":"https://tttkmbb.com/engineering/led-resistor.md","json":"https://tttkmbb.com/engineering/led-resistor.json","api":"https://tttkmbb.com/api/v1/calculate/led-resistor","schema":"https://tttkmbb.com/api/v1/calculators/led-resistor","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:59:10Z","next_actions":[{"tool":"run_calculator","calculator_id":"led-resistor","reason":"Run LED Resistor Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/engineering/led-resistor.md"}}