ForHosting KIT · Science

dB gain calculator

A voltage that rises from 1 to 10 is a gain of 20 dB, while the same tenfold step in power is 10 dB. Choose voltage or power, enter the input and output levels, and get the gain in decibels with the linear ratio. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Calculation mode
Voltage
Input level
1
Output level
10
You get
Ratio
10
Gain db
20
Multiplier
20

Decibel gain is the standard way engineers compare how much a circuit, transducer, or radio chain raises or lowers a signal. A voltage or current ratio is converted with twenty times the base-ten logarithm of the output over the input; a power ratio uses ten times the same logarithm. This dB gain calculator accepts a mode of voltage or power together with strictly positive input and output levels, applies the matching formula, and returns the gain in decibels plus the linear ratio.

What dB gain means and why voltage uses 20·log10 while power uses 10·log10

Decibel gain is a logarithmic statement of how much larger or smaller an output is than an input. Electronics, radio, audio, and photonics all quote gain in decibels because a product of linear ratios becomes a sum of dB values, which is how cascaded stages, pads, cables, and antennas are budgeted on a single line. Two conventions exist, and mixing them is the most common source of a three-decibel versus six-decibel argument at the bench.

When the two numbers are amplitudes of the same kind — voltages, currents, or field strengths measured in consistent units — the gain is twenty times the base-ten logarithm of the output-to-input ratio: G_dB equals 20 times log10 of Vout over Vin. A factor of ten in voltage is therefore twenty decibels, a factor of two is about 6.02 dB, and unity is 0 dB.

When the two numbers are power levels in the same unit — watts, milliwatts, or any other power unit shared by both ports — the multiplier is ten, not twenty: G_dB equals 10 times log10 of Pout over Pin. A factor of ten in power is ten decibels and a factor of two is about 3.01 dB. This calculator does not guess the convention from the field names: you send mode as voltage or power, plus the two strictly positive levels, and the matching multiplier is applied.

Negative gain is a loss: an output smaller than the input yields a negative dB value, which is still a well-defined real logarithm so long as both levels stay positive. The linear ratio is returned alongside the dB figure so you can check the conversion without a second tool, and the formula string restates which identity was used so a report can quote it next to the number.

Amplifier and preamp bench checks

Enter Vin and Vout in the same unit with mode voltage to confirm a 20 dB step, or Pin and Pout with mode power to confirm a 3 dB doubling, before signing off a board.

Why are zero and negative levels rejected?

A real-valued logarithm is undefined for a non-positive argument, and a zero input would divide by zero.

Why is twice the voltage about 6 dB but twice the power about 3 dB?

Amplitude ratios use the 20·log10 convention, so a factor of two is 20·log10(2) ≈ 6.02 dB. Power ratios use 10·log10, so a factor of two is 10·log10(2) ≈ 3.01 dB. Choose mode explicitly; the calculator does not infer it.

Do the two levels need the same units?

Yes. The ratio is dimensionless only when both ports share one unit. Mixing volts with millivolts, or watts with milliwatts, shifts the answer by 60 dB or 30 dB. Convert first, then submit.

What does a negative dB gain mean?

It means a loss: the output is smaller than the input, as happens with a cable or a pad. The figure is still valid, as long as both levels are above zero.

How do I add up the gain of several stages in a chain?

Work out each stage in decibels and add the results. Multiplying linear ratios turns into adding dB values, which is why amplifiers, cables and antennas can be budgeted on a single line.

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.

POSThttps://api.kit.forhosting.com/phys/db-gain

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.

curl -X POST https://api.kit.forhosting.com/phys/db-gain \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"voltage","input_level":1,"output_level":10}'
{
  "mode": "voltage",
  "input_level": 1,
  "output_level": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "phys.db_gain",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Zero and negative levels are rejected with invalid_input because the real logarithm is undefined for a non-positive argument.

Input contract, zero and negative rejection, and the exact payload this calculator returns

Missing fields, empty strings, NaN, Infinity, and non-numeric text fail immediately, naming the field, and failed validation is not charged. Zero is rejected because dividing by a zero input is undefined and because log10 of a non-positive ratio is not a real number. There is no unit conversion inside the solver: if you mix millivolts with volts, or milliwatts with watts, the ratio is physically wrong and the dB figure will be wrong by 60 dB or 30 dB respectively. Convert both ports to one unit first, then call the calculator. POST a JSON body with three required fields. mode must be the closed set voltage or power; any other string, including empty, is invalid_input. input_level is the input amplitude in voltage mode or the input power in power mode. output_level is the matching output. Both levels must be finite and strictly greater than zero; they may arrive as JSON numbers or as numeric strings so forms and CSV-style pipelines can skip an extra cast. Negative levels are rejected for the same logarithmic reason: a signed voltage can appear in a circuit, but this endpoint treats a level as a positive magnitude, which is the usual lab contract for a combined voltage-and-power dB gain calculator. The success payload echoes mode, input_level, and output_level, and adds ratio, gain_db, multiplier, and a formula string you can display next to the result. Example: mode voltage, input_level 1, output_level 10 returns gain_db of 20 and ratio 10. Example: mode power, input_level 1, output_level 2 returns about 3.0103 dB.

Where a combined dB gain calculator earns its keep, and what a call costs

Audio engineers often want voltage gain because mixer and microphone specs are quoted in volts; radio and optical-link budgets more often want power gain because the quantity that adds along a cascade is power in dBm. Either way, this capability is one contract instead of two separate tools, which is the search intent behind a generic dB gain calculator rather than a voltage-only or power-only page. Keep both levels in one physical unit, pick voltage or power explicitly, and you get a reproducible decibel figure you can publish next to a schematic or a test report. Use the API when a test stand, calibration script, or datasheet generator must stamp the same number into JSON for thousands of input and output pairs. Pair the result with your own noise-figure or intercept-point arithmetic if you are closing a cascade: this endpoint only converts two positive levels into a dB gain and does not model frequency response, impedance mismatch, or transducer constants. Each successful request is one billable item at $0.002; failed validation does not consume balance. Results are fully deterministic: the same mode and the same two positive levels always yield the same gain_db, the same ratio, the same multiplier, and the same formula string, which makes the capability safe to pin in continuous-integration checks and reproducible lab notebooks.

RF cascade and link-budget scripts

Call the API from a cascade worksheet so every stage records a stable gain_db from measured input and output power without a handwritten 10·log10 cell.

Audio and transducer datasheets

Stamp voltage gain in dB from sensitivity voltages, or power gain from acoustic or electrical watts, into JSON for a catalog that must match the lab notebook.

How do I compute voltage or power gain in dB?

Send mode as voltage or power, plus strictly positive input_level and output_level in the same unit. Voltage uses G_dB = 20·log10(out/in); power uses G_dB = 10·log10(out/in). The response includes gain_db, the linear ratio, and the formula.

What does the dB gain calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →