# Ohmforge LED Resistor Calculator > Series resistor for LEDs, rounded to a standard value and checked with a real diode model. 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. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://ohmforgeledresistor.usefulweb.site/ (interactive tool at https://ohmforgeledresistor.usefulweb.site/tool) - JSON API: POST https://ohmforgeledresistor.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://ohmforgeledresistor.usefulweb.site/api/v1/tool) - OpenAPI: https://ohmforgeledresistor.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://ohmforgeledresistor.usefulweb.site/mcp - tool `ohmforge_led_resistor` ## Inputs - supply (number, required): Supply voltage - colour (select): LED colour - vf (number): Forward voltage (custom) - Only used for "Custom". - current (number, required): LED current - count (integer): LEDs in series - series (select): Resistor series ## Method - 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. ## Limits - 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.