Ohmforge LED Resistor Calculator
Series resistor for LEDs, rounded to a standard value and checked with a real diode model.
Try an example: Red LED on 9 V at 20 mA · Three white LEDs on 12 V at 15 mA
How it works
Calculates the series resistor for one or more LEDs in series: R = (Vs − n·Vf) / I, rounds up to the next E6/E12/E24 value, and then verifies the actual current, LED voltage and resistor dissipation by simulating the circuit with Ohmforge's diode model. Suggests a power rating with 2× margin.
- Exact value R = (Vs − n·Vf) / I with the typical forward voltage of the chosen colour at 20 mA.
- Rounded UP to the next preferred value of the chosen E-series so the current never exceeds the target.
- The circuit (supply, resistor, n LEDs) is then simulated with Ohmforge's LED diode model (n = 2, Rs = 4 Ω, fitted to Vf at 20 mA) to report the real current, which is slightly different because Vf depends on current.
- Resistor rating: next of 0.125/0.25/0.5/1/2/5 W at or above twice the dissipation.
Forward voltages vary by LED type and batch (±0.2 V is common); check the datasheet of your LED. Mains-powered LED circuits need proper isolation – do not build them from this calculation.
Sources
For scripts and AI agents
- JSON API:
POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ohmforgeledresistor.usefulweb.site/mcp· tool nameohmforge_led_resistor
Example request
curl -s -X POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"supply":9,"colour":"red","current":20,"count":1,"series":"E12"}'Related tools
- Ohmforge DC Operating Point – SPICE netlist in, node voltages, branch currents, power and overload warnings out.