Power gain dB calculator
One watt in and two watts out is a gain of about 3 dB. Enter the input and output power in the same unit to get the gain in decibels, the linear ratio and whether the stage amplifies or loses power. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Input power magnitude
- 1
- Output power magnitude
- 2
- Ratio
- 2
- Linear gain
- 2
- Gain db
- 3.0102999566
- Power gain db
- 3.0102999566
Power gain in decibels measures how much a stage multiplies or attenuates power by taking ten times the base-ten logarithm of the output-to-input power ratio. The closed form G_dB equals ten times log ten of P_out over P_in is the universal language of amplifiers, filters, cables, mixers, and optical links because cascade gains and losses add instead of multiply, and many orders of magnitude fit on a short numeric scale. Three decibels is roughly a factor of two in power, ten decibels is exactly a factor of ten, and a negative result means the stage loses power rather than amplifies. This power gain dB calculator accepts two strictly positive powers in the same units, evaluates that formula with deterministic floating-point arithmetic, and returns the gain in dB together with the linear ratio, gain-or-loss classification, attenuation as the negated dB value, and a short printable expression. Zero and negative power on either port are rejected with a clear validation error because the real logarithm is undefined there.
How power gain in decibels is defined
A decibel for power is ten times the base-ten logarithm of a power ratio. When the two powers are the input and output of the same two-port stage, that ratio is the linear power gain G equals P_out over P_in, and the decibel form is G_dB equals ten times log ten of G. Because logarithms convert products into sums, a cascade of amplifiers, filters, and cable runs is budgeted by adding each stage's G_dB instead of multiplying linear factors that quickly become unwieldy.
Positive G_dB means the stage amplifies: twenty decibels is a linear gain of one hundred, three decibels is about two, and six decibels is about four. Negative G_dB means loss or attenuation: minus three decibels halves the power, and minus ten decibels divides it by ten. Zero decibels is unity, where output equals input.
Zero power would send the logarithm toward negative infinity when it appears in the numerator or make the ratio undefined when it appears in the denominator; negative power is non-physical for this real-valued model and fails the same way. Absolute levels in dBm or dBW, voltage gain with the twenty-log form, and free-space path loss are different search intents and belong on separate landings so this page stays focused on the pure power-ratio-to-dB conversion.
What you can do with it
Amplifier and attenuator lab drills
Convert measured Pin and Pout into G_dB so students complete gain tables and match datasheet small-signal or insertion-loss figures.
PA and filter acceptance tests
Turn bench power-meter readings at input and output into a signed dB gain or loss for DUT pass/fail against the specification.
FAQ
What formula does this power gain dB calculator use?
Both powers must be strictly positive and expressed in the same units. Positive results are gain; negative results are loss; zero is unity.
Is this the same as voltage or current gain in dB?
No. Voltage and current gains use 20 · log10 of a voltage or current ratio. This tool is power-only (10 · log10). Use a separate landing for the 20·log form.
Do Pin and Pout need the same units?
Yes. The ratio is unitless only when both magnitudes share the same unit (W with W, mW with mW). Convert both sides first if your meters disagree.
What does it cost?
The browser tool is free and runs locally.
What does a negative dB result mean?
It means the stage loses power instead of amplifying it. Minus 3 dB roughly halves the power, minus 10 dB divides it by ten, and 0 dB means the output equals the input.
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/power-gain-db \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"p_in":1,"p_out":2}'const res = await fetch("https://api.kit.forhosting.com/elec/power-gain-db", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"p_in": 1,
"p_out": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/power-gain-db",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"p_in": 1,
"p_out": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/power-gain-db", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"p_in":1,"p_out":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"p_in":1,"p_out":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/power-gain-db", 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": 1,
"p_out": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.power_gain_db",
"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 you send and what you get back
Both magnitudes must use the same physical unit—watts with watts, milliwatts with milliwatts—because the ratio is unitless only when the units match; the calculator does not convert SI prefixes for you. Numeric values and numeric strings are both accepted so form widgets and spreadsheet paste stay convenient. Classic classroom checks include one watt in and two watts out for about three point zero one zero decibels of gain, one hundred milliwatts in and ten milliwatts out for exactly minus ten decibels of loss, and equal powers for zero decibels unity. If you need watts to dBm, voltage gain in dB, or full link-budget arithmetic, treat those as separate tools rather than extending this pure power-gain calculator. Send two finite positive powers under the fields p_in and p_out. Input power is also accepted under the aliases pin, input_power, Pin, or P_in, and output power under pout, output_power, Pout, or P_out, but only one key may appear for each side of the stage. Power must be strictly greater than zero on both ports because G_dB equals ten log ten of P_out over P_in is undefined for non-positive arguments; zero and negative power fail with invalid_input and a message that non-positive power is not allowed. Missing fields, conflicting aliases, NaN, and Infinity fail the same way and are not charged. On success the response includes cleaned p_in and p_out, ratio and linear_gain as P_out over P_in, gain_db and power_gain_db as the same decibel value, attenuation_db as the negated gain so losses read as positive attenuation, kind as gain, loss, or unity, booleans is_gain, is_loss, and is_unity, a short expression string showing the formula with numbers, method power_gain_db, and the formula string G_dB equals ten log ten of P_out over P_in. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where power-gain-in-dB calculations show up in real work
Introductory RF and electronics labs constantly assign amplifier and attenuator drills so students can move between linear power ratios and datasheet decibel figures without mixing formulas. Transmitter and PA teams measure input drive and output power at the same reference plane, convert the ratio to G_dB, and compare it against the small-signal or saturated gain on the data sheet. Cable and filter vendors quote insertion loss as a negative power gain; converting bench meter readings into that figure keeps acceptance tests honest. Optical and microwave metrology reports often mix milliwatts and dB of gain or loss on the same page, so a single trusted closed form prevents sign errors when someone confuses attenuation with gain. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance. The browser tool is free for interactive use; scripted API traffic uses prepaid KIT balance at the published rate without hidden per-field surcharges.
Integration use cases
CI fixtures and answer keys
Script the same G_dB = 10·log10(Pout/Pin) product used in the browser so automated graders share one ground truth for power ratios.
Technical questions
What happens if input or output power is zero or negative?
The request fails with invalid_input. The real logarithm is undefined for a non-positive power ratio, so both p_in and p_out must be greater than zero.