Voltage gain dB calculator
An amplifier that turns 1 V into 10 V has a gain of 20 dB: enter the input and output voltage and get the ratio and the decibel figure, using twenty times the base-10 logarithm of output over input. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- V in
- 1
- V out
- 10
- Ratio
- 10
- Gain db
- 20
Voltage gain in decibels tells you how much an amplifier or stage multiplies signal amplitude on a logarithmic scale that matches hearing and instrumentation practice. Given an input voltage Vin and an output voltage Vout, the standard voltage gain is twenty times the base-ten logarithm of the ratio Vout over Vin, so a tenfold amplitude increase is plus twenty decibels and a half-amplitude loss is about minus six decibels. Use it for op-amp stages, RF front ends, audio preamps and lab exercises when voltages are expressed as consistent amplitude or RMS figures of the same kind.
What voltage gain in decibels means and which voltages to send
Voltage gain compares how large the output signal is relative to the input. On a linear scale the gain is simply the ratio Vout divided by Vin; on the decibel scale used in electronics datasheets and measurement reports that same ratio becomes twenty times log base ten of Vout over Vin. Positive decibels mean amplification, zero means unity gain, and negative decibels mean attenuation.
Both values must use the same amplitude convention—peak, peak-to-peak or RMS—so the ratio is meaningful; the engine does not convert between conventions. Missing fields, non-finite numbers and out-of-range magnitudes fail with invalid input and are not charged.
What you can do with it
Amplifier and op-amp stage checks
Designers enter measured or simulated Vin and Vout to recover voltage gain in decibels for schematics, datasheet tables and bench notes.
Audio and sensor front-end attenuation
Audio techs and IoT builders convert amplitude ratios into dB so gain stages and pad networks match target headroom and noise budgets.
FAQ
What happens if the input voltage is zero?
Zero Vin makes Vout/Vin undefined (division by zero); the error is not charged.
Can Vin or Vout be negative?
Yes if both share the same sign so the ratio is positive.
Is the voltage gain dB calculator free?
The browser tool runs free on your device.
Is this power gain or voltage gain?
Power gain uses 10·log10(Pout/Pin) and is a different intent.
Do both voltages have to be RMS values?
No, but they must be the same kind: peak with peak, peak-to-peak with peak-to-peak, or RMS with RMS. The calculator does not convert between them, so mixing kinds gives a wrong ratio.
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/voltage-gain-db \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"v_in":1,"v_out":10}'const res = await fetch("https://api.kit.forhosting.com/elec/voltage-gain-db", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"v_in": 1,
"v_out": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/voltage-gain-db",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"v_in": 1,
"v_out": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/voltage-gain-db", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"v_in":1,"v_out":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"v_in":1,"v_out":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/voltage-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
{
"v_in": 1,
"v_out": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.voltage_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 voltage gain in decibels means and which voltages to send
Send the required fields v_in and v_out as finite JSON numbers or numeric strings representing voltages in volts; aliases such as vin, input_voltage and Vin for the input, and vout, output_voltage and Vout for the output, are accepted when you prefer textbook symbols. Magnitudes must stay within the published finite bounds so Worker isolates stay stable. Identical inputs always produce identical JSON because the path is pure arithmetic with no network, no random seed and no wall clock.
Formula, zero input voltage, ratio sign and reading the response
The ratio must also be strictly positive and finite for a real-valued decibel result, which means Vin and Vout must share the same sign and Vout must be non-zero; opposite signs or a zero output yield invalid input rather than complex or infinite dB. Unity gain (equal voltages of the same sign) yields zero decibels. A ratio of ten yields plus twenty decibels; a ratio of one half yields about minus six point zero two decibels. The engine computes the linear ratio Vout over Vin, then multiplies twenty by the base-ten logarithm of that ratio to obtain gain_db. Every successful response echoes v_in and v_out after stable rounding, returns ratio and gain_db, and labels formula as Av_dB equals twenty times log ten of Vout over Vin with method twenty_log10_vout_over_vin so downstream code can branch without sniffing shapes. Input voltage must never be zero: a zero Vin makes the ratio undefined (division by zero), so the request fails with invalid input and a message that names the zero input voltage. Use gain_db for datasheet-style reporting and ratio when a pipeline still needs the linear multiplier.
API usage, pricing, amplifiers, education and practical limits
Call the free in-browser voltage gain dB calculator for quick checks on op-amp stages, sensor front ends, audio chains and homework without installing a spreadsheet. Send a JSON body with required v_in and v_out. Use the prepaid API when a lab notebook tool, RF design worksheet, automated test harness or classroom grading pipeline 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 power and current calculators when you also need watts or amps, and with unit converters when inputs arrive in millivolts. This product does not compute power gain in decibels, which uses ten times log ten of a power ratio, nor does it cascade multi-stage gains for you—sum stage dB values yourself when stages are linear and matched. Authors shipping SDKs can map gain_db and formula directly into UI copy that matches what engineers write on a workbench.
Integration use cases
Classroom and lab grading oracles
Electronics courses pin deterministic JSON fixtures for 20·log10(Vout/Vin) drills, including zero-input cases that must fail with invalid_input.
Technical questions
How do I calculate voltage gain in dB?
Send JSON with v_in and v_out in volts. The response includes ratio (Vout/Vin) and gain_db = 20·log10(ratio), plus the formula string for display.