Fiber length from loss budget calculator
This fiber length from loss budget calculator finds the maximum theoretical fiber span supported by a specified allowance for distributed fiber loss.
Run — free
Enter the total allowable loss in decibels and the fiber attenuation coefficient in decibels per kilometer. The calculator divides the loss allowance by attenuation to return the maximum length in kilometers. It is useful for early optical link planning, reach comparisons, worksheet checks, and classroom calculations. Reserve losses for connectors, splices, splitters, bends, and engineering margin before entering the fiber-only allowance.
Turn an optical loss allowance into a distance limit
A fiber link budget states how much optical loss can occur between the transmitter and receiver while the receiver still obtains adequate power. Once the portion available specifically for distributed fiber attenuation is known, maximum reach follows from a direct relationship: maximum_length_km equals total_allowable_loss_db divided by attenuation_db_per_km. For example, a 7.5 dB fiber allowance and attenuation of 0.35 dB/km produce a theoretical maximum span of about 21.428571 km. The result is a distance ceiling under the assumptions represented by those two inputs, not a promise that equipment will operate at that distance. The calculator returns both inputs, the computed maximum_length_km, and the formula string so the result can be audited or passed into another design step. Decibels work naturally here because distributed loss grows linearly with distance when attenuation is treated as constant. If distance doubles, the propagation loss doubles. Reversing that familiar multiplication makes this calculator useful when the budget is fixed and route reach is the unknown quantity. The calculation is deterministic and rounds only the serialized distance to twelve decimal places for stable automated responses.
Prepare the correct fiber-only loss budget
The total_allowable_loss_db input should be the amount of loss left for the fiber itself, not automatically the entire difference between transmitter output and receiver sensitivity. Start with the available optical power budget, then subtract every loss that is not proportional to fiber distance. Typical deductions include connector insertion loss, splice loss, splitter or coupler loss, patch-panel loss, bend allowances, and an engineering margin for aging, repairs, temperature, measurement uncertainty, and future reconfiguration. The remainder is the fiber attenuation allowance to enter here. If those deductions already consume the full budget, the practical design has no positive distance allowance even though entering zero correctly returns zero kilometers. Use attenuation_db_per_km from the relevant fiber specification at the planned wavelength and operating conditions. An attenuation value at 1550 nm may differ substantially from one at 1310 nm or 850 nm. The coefficient must be positive because division by zero cannot define a finite maximum reach. Both fields accept only finite numeric values; numeric strings, unit-bearing text, negative budgets, zero attenuation, infinity, and missing fields are rejected. Keep units consistent: convert route loss to decibels and attenuation to decibels per kilometer before calculating.
Interpret maximum length conservatively in real designs
Treat maximum_length_km as a theoretical span based on a constant attenuation coefficient and the loss allocation you supplied. Installed cable length is usually longer than straight-line map distance because routes include vertical runs, bends around obstacles, slack loops, service coils, cabinet routing, and restoration reserve. Compare the calculated distance with planned cable length rather than geographic separation alone. For a route built from fiber segments with different attenuation coefficients, one division is not sufficient unless you first create a justified equivalent coefficient. A more transparent method is to allocate loss across known segments, calculate each segment's loss, and solve only for the remaining unknown segment. The result also does not include chromatic dispersion, modal bandwidth, transmitter spectral width, receiver overload, nonlinear effects, or protocol-specific reach limits; any of those can impose a shorter limit than the power budget. Equipment data sheets and applicable design standards remain authoritative. This calculator is best used for quick feasibility checks, sensitivity comparisons, and reproducible automation before detailed engineering review. Try conservative and nominal attenuation values to see how strongly fiber quality or wavelength changes reach. The same calculation runs free in the browser, while each successful automated API request costs $0.002.
What you can do with it
Estimate fiber reach during preliminary design
Convert the fiber-only portion of an optical loss budget into a theoretical maximum cable length.
Compare wavelength or fiber options
Hold the allowable loss constant and compare the reach produced by different specified attenuation coefficients.
Audit a link-budget worksheet
Independently check that a proposed maximum span equals the remaining fiber loss allowance divided by attenuation.
FAQ
What formula does the calculator use?
It uses maximum fiber length in km = total allowable fiber loss in dB ÷ attenuation in dB/km.
Should connector and splice losses be included in the input?
Subtract connector, splice, splitter, bend, and engineering-margin losses from the overall power budget first. Enter only the loss that remains available for distributed fiber attenuation.
Why must attenuation be greater than zero?
The calculation divides by attenuation. Zero attenuation would imply no finite distance limit under this simplified model, so it cannot produce a meaningful maximum length.
Does this result guarantee that the optical link will work?
No. It is a theoretical attenuation-based limit. Dispersion, bandwidth, equipment limits, route details, component losses, and operating margin can require a shorter span.
How much does an API calculation cost?
Each successful API request costs $0.002. The same deterministic calculation is free to run in the browser.
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/optics/fiber-length-from-loss-budget \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"total_allowable_loss_db":7.5,"attenuation_db_per_km":0.35}'const res = await fetch("https://api.kit.forhosting.com/optics/fiber-length-from-loss-budget", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"total_allowable_loss_db": 7.5,
"attenuation_db_per_km": 0.35
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/optics/fiber-length-from-loss-budget",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"total_allowable_loss_db": 7.5,
"attenuation_db_per_km": 0.35
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/optics/fiber-length-from-loss-budget", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"total_allowable_loss_db":7.5,"attenuation_db_per_km":0.35}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"total_allowable_loss_db":7.5,"attenuation_db_per_km":0.35}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/optics/fiber-length-from-loss-budget", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"total_allowable_loss_db": 7.5,
"attenuation_db_per_km": 0.35
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "optics.fiber_length_from_loss_budget",
"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. |