LED series string calculator
On a 12 V rail, three 3.2 V LEDs at 20 mA fit in one string with a 120 Ω resistor: enter supply, LED voltage and current to get the maximum count, the resistor and the wattage to buy. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Supply voltage
- 12
- Forward voltage
- 3.2
- Forward current
- 0.02
- Max leds
- 3
- Led count
- 3
- Total forward voltage
- 9.6
- Voltage drop
- 2.4
Wiring several LEDs in one series string on a fixed DC rail is a classic hobby and panel design problem: you need to know how many diodes fit before the remaining headroom collapses, and what dropping resistor still limits current at the datasheet forward voltage. Packing too many LEDs leaves no voltage for the resistor, so current runs away or the string never lights; packing too few wastes supply headroom and forces a hotter, larger resistor. This LED series string calculator accepts supply voltage, per-LED forward voltage and desired forward current, computes the maximum integer count with strictly positive resistor headroom, optionally sizes a shorter chosen count, and returns resistance, dissipation and a two-times commercial wattage recommendation.
What a series LED string is and how max count is defined
A series LED string places several identical light-emitting diodes end to end on one current path so the same forward current flows through every die while the forward voltages add. The supply must exceed the sum of those forward voltages; the leftover volts appear across a single series dropping resistor that sets the operating current by Ohm’s law. Supply voltage is the DC rail that feeds the branch—five volts from USB, nine or twelve volts from a wall adapter, twenty-four volts on industrial panels, or other fixed rails.
Forward current is the steady string current in amperes—twenty milliamps is sent as zero point zero two, not as the integer twenty. This calculator defines maximum LEDs as the largest positive integer n such that n times forward voltage is still strictly less than supply voltage, guaranteeing a positive voltage drop for the resistor. When supply is an exact multiple of forward voltage, the engine steps the count down so resistance never collapses to zero.
What you can do with it
12 V panel indicator strings
Industrial designers enter a twelve-volt rail, a three-point-two-volt LED and twenty milliamps to learn max series count and the dropping resistor wattage for a single branch.
FAQ
Is the LED series string calculator free?
The browser tool runs free on your device.
How many LEDs can I put in series on 12 V?
With 3.2 V LEDs at 20 mA, three. Together they take 9.6 V and leave 2.4 V for a 120 Ω resistor. A fourth LED would need more than the 12 V available, so the string would not light properly.
What happens if the supply is an exact multiple of the LED voltage?
The count drops by one. If the LEDs used up the whole supply, no voltage would be left for the resistor and nothing would limit the current, so the calculator always keeps a positive drop across it.
Can I put fewer LEDs in the string than the maximum?
Yes. Choose a shorter count and the resistor is recalculated for it. Fewer LEDs leave more voltage across the resistor, so expect a larger value and more heat in it for the same current.
What wattage resistor should I buy for an LED string?
The calculator doubles the power the resistor actually dissipates and rounds up to a common rating. In the 12 V example the resistor dissipates 0.048 W, so it recommends a 0.125 W part.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/elec/led-series-string \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"supply_voltage":12,"forward_voltage":3.2,"forward_current":0.02}'const res = await fetch("https://api.kit.forhosting.com/elec/led-series-string", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"supply_voltage": 12,
"forward_voltage": 3.2,
"forward_current": 0.02
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/led-series-string",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"supply_voltage": 12,
"forward_voltage": 3.2,
"forward_current": 0.02
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/led-series-string", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"supply_voltage":12,"forward_voltage":3.2,"forward_current":0.02}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"supply_voltage":12,"forward_voltage":3.2,"forward_current":0.02}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/led-series-string", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"supply_voltage": 12,
"forward_voltage": 3.2,
"forward_current": 0.02
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.led_series_string",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The free browser path and the prepaid API share the same pure arithmetic module, so breadboard sketches and manufacturing tools never disagree on max_leds or ohms. API success items use prepaid KIT balance at $0.002; invalid inputs are not charged.
What a series LED string is and how max count is defined
Forward voltage is the per-LED conducting drop at the chosen current: red emitters often sit near two volts, white and blue closer to three volts, always taken from the datasheet at the intended milliamp level rather than a colour guess. Optional led_count lets you force a shorter string within that maximum when layout, colour mix or spare inventory dictates fewer diodes. Missing fields, non-positive voltages or current, non-finite numbers, and counts above max_leds all fail with invalid_input and are not billed. Identical JSON inputs always produce identical outputs because the path uses no network, no random seed and no wall clock.
Formulas, power rating, headroom errors and reading the response
Parallel multi-string ballast networks, constant-current LED drivers and PWM average-current models are outside scope—use a dedicated driver topology for those designs. After n is chosen—either the computed maximum or your explicit led_count—the engine multiplies n by per-LED forward voltage to obtain total_forward_voltage, subtracts that sum from supply voltage to obtain voltage_drop across the resistor, divides the drop by forward current to obtain resistance_ohms, and multiplies drop by current to obtain power_watts. The formula field restates n_max as the largest n with n times Vf less than Vs, R equals open parenthesis Vs minus n times Vf close parenthesis over If, and P equals If times that same drop, so UI copy can show the identities students write by hand. Recommended power watts is the smallest common commercial rating at or above twice the calculated dissipation, covering one sixteenth through fifty watt steps with a deterministic ceiling above the catalog, and power_margin is always two. When a single LED already meets or exceeds the supply, the request fails with invalid_input naming both voltages, because no series resistor can create headroom. When led_count exceeds max_leds, the message cites both integers so configurators can clamp or prompt the user. Successful responses echo the three primary inputs after stable rounding, plus max_leds, led_count, total_forward_voltage, voltage_drop, resistance_ohms, power_watts, recommended_power_watts, power_margin, formula and method led_series_string so downstream code can branch without sniffing shapes. Use resistance_ohms to pick the nearest E-series part on your own; this product returns the exact ohmic need, not a preferred-value table.
API usage, pricing, panels, education and practical limits
Call the free in-browser LED series string calculator for Christmas-light style indicator chains, Arduino multi-LED status bars, twelve-volt automotive accent strips and lab exercises without opening a spreadsheet. Keep requests small, document that current is in amperes, and treat the two-times wattage margin as a continuous-load rule of thumb rather than a full thermal model for high-power emitters. Send a JSON body with supply_voltage, forward_voltage and forward_current in volts and amperes; add led_count only when you already know how many diodes the layout will mount. Use the prepaid API when a parts configurator, IoT manufacturing tool, electronics homework oracle or CAD plugin needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with unit converters when datasheets list milliamps or millivolts, and with the single-LED resistor calculator when your search intent is only one diode rather than packing a string. Authors shipping SDKs can map max_leds, resistance_ohms and recommended_power_watts directly into BOM lines and form defaults that match what technicians stock in drawers.
Integration use cases
Arduino and maker multi-LED bars
Makers size how many status LEDs fit on a five-volt or nine-volt rail before ordering resistors, optionally forcing a shorter led_count for PCB silkscreen layout.
Classroom and homework oracles
Electronics courses pin deterministic JSON for n_max and R equals (Vs minus n Vf) over If drills, including intentional over-count cases that must fail with invalid_input.
Technical questions
How many LEDs can I put in series on a given supply?
Send supply_voltage (Vs), forward_voltage (Vf per LED) and forward_current (If in amperes). The response max_leds is the largest integer n with n·Vf < Vs so the dropping resistor still sees positive headroom.
How is the series dropping resistor calculated?
For chosen led_count n (default max_leds), resistance_ohms is (Vs − n·Vf) / If and power_watts is If · (Vs − n·Vf). recommended_power_watts is the next common rating at or above twice that dissipation.
What if I request more LEDs than fit?
The request fails with invalid_input. The message names your led_count and the computed max_leds for the given Vs and Vf so you can reduce the string length.
Should I enter current in milliamps or amps?
Enter amperes. For a typical 20 mA indicator LED use forward_current: 0.02. Aliases If, current, led_current, i_f and amps are accepted.