# LED resistor calculator > Which resistor does your LED need? The series resistor for one or more LEDs, rounded to a standard value, with its current and power rating. Find the series resistor for an LED or a string of LEDs from the supply, forward voltage and current, with the standard E12 value and power rating. - Page: https://how.box/led-resistor/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/led-resistor/?v={v}&vf={vf}&i={i}&n={n}&e={e} - `v` (number 0.1 to 1000): Supply voltage, volts. Example: `5`. - `vf` (number 0.5 to 50): Forward voltage of one LED, volts. Example: `2`. - `i` (number 0.01 to 10000): LED current, milliamperes. Example: `20`. - `n` (whole number 1 to 100): LEDs in series. Example: `1`. - `e` (E6, E12, E24 or E96): E6, E12, E24 or E96. Example: `E12`. Example answer: https://how.box/led-resistor/?v=5&vf=2&i=20&n=1&e=E12 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `led_resistor_calculate`: Series resistor for LEDs: R = (supply − count × forward_voltage) / current, then the next standard value at or above it (so the current stays at or below the target). - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"led_resistor_calculate","arguments":{"supply":5,"forward_voltage":2,"current":20,"count":1,"series":"E12"}}}` - GET: https://how.box/mcp/run/led_resistor_calculate?supply=5&forward_voltage=2¤t=20&count=1&series=E12 ## How it works An LED holds a nearly fixed voltage across itself and lets through as much current as the circuit allows, so connected straight to a supply it burns out. A resistor in series sets the current: it takes up the voltage the LED leaves over, and Ohm's law turns that voltage and the wanted current into a resistance. The resistor is R = (Vs − n × Vf) ÷ I, where Vs is the supply voltage, Vf the forward voltage of one LED, n the number of LEDs in series and I the current. A red LED (2 V) at 20 mA from 5 V needs (5 − 2) ÷ 0.020 = 150 Ω. Three white LEDs (3.2 V) in series on 12 V need (12 − 9.6) ÷ 0.020 = 120 Ω. The resistor turns P = I² × R into heat, here 60 mW and 48 mW, so a 1/8 W or 1/4 W resistor is plenty. Standard resistors come in fixed series, so the calculator picks the next value up, which keeps the current at or below your target. Forward voltage varies between LEDs and with temperature, so the real current can differ a little; with a supply only slightly above the LED voltage, it varies a lot. Sources: OpenStax University Physics, volume 2, section 9.4, and the IEC 60063 E series. ## FAQ **Can several LEDs share one resistor?** A series string can share one resistor because the same current passes through every LED. Parallel branches should each have their own current-limiting resistor. **Where should I place the resistor?** It can go before or after the LED in the same series path. The current is the same in either position. **Must I run every LED at 20 mA?** No. Use the datasheet’s operating current for your LED and the brightness you need; many indicator LEDs are useful at much lower currents. **Can I use a higher wattage resistor?** Yes, if the resistance is correct. A higher power rating increases the heat the resistor can tolerate; it does not force more current through the LED. **Does this handle a flashing LED driven by PWM?** It calculates the current while the supply is on. It does not model PWM duty cycle, switching behaviour or pulse-current limits. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)