Attenuation in dB
Going from 100 W in to 1 W out is a loss of exactly 20 dB, and halving the power costs about 3 dB. Enter the input and output power in the same unit to get the attenuation in decibels and the plain ratio. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- P in
- 100
- P out
- 1
- Ratio
- 100
- Attenuation db
- 20
Attenuation in decibels expresses how much power a signal loses as it passes through a cable, fiber, filter, pad network or any passive or active stage. Given an input power Pin and an output power Pout measured in the same unit, the standard loss figure is ten times the base-ten logarithm of the ratio Pin over Pout, so halving the power is about three decibels of loss and a hundredfold drop is exactly twenty decibels. Use it for RF link budgets, optical fiber spans, audio chains, sensor cabling and lab exercises whenever you know the power at both ends of a stage.
What attenuation in decibels means and which powers to send
Attenuation compares the power delivered to a stage with the power that comes out of it. On a linear scale the loss is the ratio Pin divided by Pout; on the decibel scale used in datasheets, link budgets and measurement reports that same ratio becomes ten times log base ten of Pin over Pout. Positive decibels mean a loss, zero means the stage is transparent, and negative decibels mean the stage actually amplified the signal.
Both values must be strictly positive and finite: zero, negative or non-finite powers fail with invalid input and are never charged.
Formula, validation rules and reading the response
A power ratio of two yields about three point zero one decibels of loss, a ratio of ten yields exactly ten decibels, and a ratio of one hundred yields twenty decibels. Equal powers yield zero decibels, and an output larger than the input yields a negative attenuation that you can read as insertion gain.
Power levels must never be zero or negative: a zero Pin makes the ratio zero and the logarithm diverges, a zero Pout divides by zero, and negative powers have no physical meaning on this scale—each case fails with invalid input and a message that names the offending field. Non-finite values such as NaN or Infinity fail the same way.
What you can do with it
RF and telecom link budgets
Engineers enter transmit and receive power levels to recover path loss in dB for coax, waveguide and free-space links, then budget margins against sensitivity.
Optical fiber and audio chain checks
Technicians compare launch and received optical or audio power to certify spans, splices and pad networks against loss specifications in decibels.
FAQ
What happens if a power level is zero or negative?
Attenuation in dB is only defined for strictly positive powers; the error names the offending field and is not charged.
Is the attenuation calculator free?
The browser tool runs free on your device.
Is this the same as voltage gain in dB?
No. Power attenuation uses 10·log10(Pin/Pout). Voltage gain uses 20·log10(Vout/Vin) and is a different intent served by a different capability.
How many decibels is half the power?
About 3 dB, or 3.01 dB more precisely. A drop to a tenth of the power is exactly 10 dB and a drop to a hundredth is exactly 20 dB, because each factor of ten adds 10 dB.
What does a negative attenuation mean?
That the output power is larger than the input, so the stage amplified the signal instead of losing it. You can read a negative figure as insertion gain; 0 dB means the stage is transparent.
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/phys/attenuation \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"p_in":100,"p_out":1}'const res = await fetch("https://api.kit.forhosting.com/phys/attenuation", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"p_in": 100,
"p_out": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/attenuation",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"p_in": 100,
"p_out": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/attenuation", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"p_in":100,"p_out":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"p_in":100,"p_out":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/attenuation", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"p_in": 100,
"p_out": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.attenuation",
"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
What attenuation in decibels means and which powers to send
Send the required fields p_in and p_out as finite JSON numbers or numeric strings representing power levels in any consistent unit—watts, milliwatts or dBm-converted linear values—because only the ratio matters; aliases such as pin, input_power and Pin for the input, and pout, output_power and Pout for the output, are accepted when you prefer textbook symbols. Magnitudes must stay within the published finite bounds so Worker isolates stay stable.
Formula, validation rules and reading the response
The engine computes the linear ratio Pin over Pout, then multiplies ten by the base-ten logarithm of that ratio to obtain attenuation_db. Every successful response echoes p_in and p_out after stable rounding, returns ratio and attenuation_db, and labels formula as L_dB equals ten times log ten of Pin over Pout with method ten_log10_pin_over_pout so downstream code can branch without sniffing shapes. Use attenuation_db for datasheet-style reporting and ratio when a pipeline still needs the linear multiplier.
API usage, pricing, link budgets, education and practical limits
Call the free in-browser attenuation calculator for quick checks on coax runs, fiber spans, pad networks, audio chains and homework without installing a spreadsheet. Source inputs follow the same retention rules as other KIT parse items, and results are safe to cache indefinitely because the algorithm is fully deterministic. Send a JSON body with required p_in and p_out. Use the prepaid API when a link-budget tool, network monitoring pipeline, automated test harness or classroom grading system needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. For multi-hop paths, compute the attenuation of each hop and sum the decibel values yourself—decibels add where linear ratios multiply—which keeps each call simple and auditable. This product does not compute voltage gain in decibels, which uses twenty times log ten of a voltage ratio, nor does it convert between dB and linear units or convert dBm to watts; pair it with the dedicated converter and voltage-gain capabilities when you need those intents. Authors shipping SDKs can map attenuation_db and formula directly into UI copy that matches what engineers write on a workbench.
Integration use cases
Classroom and lab grading oracles
Physics and electronics courses pin deterministic JSON fixtures for 10·log10(Pin/Pout) drills, including zero-power cases that must fail with invalid_input.
Technical questions
How do I calculate attenuation in dB?
Send JSON with p_in and p_out in the same power unit. The response includes ratio (Pin/Pout) and attenuation_db = 10·log10(ratio), plus the formula string for display.
Can attenuation_db be negative?
Yes. When Pout exceeds Pin the result is negative, which you can read as gain. Positive values are loss, zero means the stage is transparent.