The fundamental gain in dB calculator relies on two core logarithmic equations depending on what you are measuring. For power gain, the formula is 10 × log10(Pout / Pin). For voltage or current gain (assuming input and output impedances are identical), the formula is 20 × log10(Vout / Vin). A positive result indicates amplification, while a negative result indicates attenuation (loss). Getting these right on the bench requires strict attention to unit tracking and impedance matching, otherwise your calculated gain will be physically meaningless.
The Core Decibel Formulas and Symbol Definitions
The decibel (dB) is not an absolute unit like volts or watts; it is a dimensionless ratio. The reason we use two different multipliers (10 and 20) comes down to the physics of power. Power is proportional to the square of voltage or current (P = V² / R). When you take the logarithm of a squared term, the exponent moves to the front: log(x²) = 2 × log(x). Therefore, 10 × 2 becomes 20. According to the foundational texts at All About Circuits, mixing up the 10 and 20 multipliers is the most common error in RF and audio engineering.
| Symbol | Definition | Standard Units | Notes |
|---|---|---|---|
| dB | Gain or Loss in Decibels | dB (dimensionless) | Positive = gain, Negative = loss |
| Pout | Output Power | Watts (W) or milliwatts (mW) | Must match Pin units exactly |
| Pin | Input Power | Watts (W) or milliwatts (mW) | Must match Pout units exactly |
| Vout | Output Voltage (RMS or Peak) | Volts (V) or millivolts (mV) | Must match Vin units and type (RMS vs Peak) |
| Vin | Input Voltage (RMS or Peak) | Volts (V) or millivolts (mV) | Must match Vout units and type |
| log10 | Base-10 Logarithm | N/A | Do not use natural log (ln) |
Rearranged Forms: Solving for the Missing Variable
When you are designing a circuit or selecting an amplifier, you rarely start with both input and output. Usually, you know your required gain in dB and your input signal, and you need to find the output. Here are the algebraic rearrangements for every variable in both formulas, utilizing the inverse log (base-10 exponential) function.
Power Gain Rearrangements (10 × log10)
- Solve for Pout: Pout = Pin × 10(dB / 10)
- Solve for Pin: Pin = Pout / 10(dB / 10)
- Solve for dB: dB = 10 × log10(Pout / Pin)
Voltage Gain Rearrangements (20 × log10)
- Solve for Vout: Vout = Vin × 10(dB / 20)
- Solve for Vin: Vin = Vout / 10(dB / 20)
- Solve for dB: dB = 20 × log10(Vout / Vin)
Bench Worked Examples with Unit Tracking
Let us move from algebra to the workbench. When calculating these on the fly, tracking your units through the ratio ensures you do not accidentally divide Watts by milliwatts, which would skew your result by 30 dB.
Problem 1: Power Gain of an RF Amplifier
Scenario: You are testing a Mini-Circuits ZFL-500LN+ low noise amplifier. Your signal generator feeds 0.5 mW into the input. A spectrum analyzer at the output reads 50 mW. What is the power gain in dB?
- Identify the formula: We are dealing with power, so we use dB = 10 × log10(Pout / Pin).
- Calculate the ratio with unit tracking: 50 mW / 0.5 mW = 100. (The 'mW' units cancel out, leaving a dimensionless ratio of 100).
- Apply the base-10 logarithm: log10(100) = 2.
- Multiply by 10: 10 × 2 = 20 dB.
Result: The amplifier provides 20 dB of power gain.
Problem 2: Voltage Attenuation of a Passive Filter
Scenario: You inject a 2.0 VRMS sine wave into a passive RC low-pass filter. At the cutoff frequency, your oscilloscope measures the output at 1.414 VRMS. What is the voltage gain?
- Identify the formula: We are measuring voltage across matched high-impedance scope inputs, so we use dB = 20 × log10(Vout / Vin).
- Calculate the ratio: 1.414 V / 2.0 V = 0.707. (This is the classic 1/√2 voltage drop at the -3dB cutoff point).
- Apply the base-10 logarithm: log10(0.707) ≈ -0.1505.
- Multiply by 20: 20 × -0.1505 = -3.01 dB.
Result: The filter introduces a 3 dB attenuation (loss) at the cutoff frequency.
Real-World Scenario: The Impedance Mismatch Trap
Formulas on paper are clean; bench measurements are messy. Here is a narrative walkthrough of a classic mistake that happens when engineers blindly trust a gain in dB calculator without checking the physical setup.
The Setup: An audio engineer is characterizing a custom microphone preamplifier. The preamp has a specified output impedance of 150 Ω. The engineer connects the preamp output directly to a digital oscilloscope with a standard 1 MΩ input impedance. They inject a 10 mVRMS test tone into the preamp input.
The Numbers: The oscilloscope reads 1.0 VRMS at the output. The engineer plugs these numbers into the voltage gain formula: 20 × log10(1.0 V / 0.01 V) = 20 × log10(100) = 40 dB voltage gain. They record this in the spec sheet.
The Outcome: When the preamp is later deployed in the field, connected to a standard 600 Ω audio mixer input, the mixer clips horribly, and the actual delivered power is vastly lower than the 40 dB spec suggested. The system fails the noise-floor requirements.
What Went Wrong: The 20 × log10(Vout/Vin) formula for calculating power-equivalent gain strictly assumes that the input and output impedances are equal. Because the scope's 1 MΩ impedance drew almost zero current, it measured the open-circuit voltage of the preamp. When connected to the 600 Ω mixer, a massive voltage divider effect occurred, dropping the actual voltage delivered to the load. Furthermore, comparing the power delivered to the 150 Ω source versus the power absorbed by the 1 MΩ scope using the voltage formula yields a physically meaningless number. To measure true power gain, the engineer should have terminated the preamp with a matched 150 Ω dummy load and measured the voltage across that load, or used a dedicated RF/audio power meter. As detailed in RF Cafe's decibel references, voltage gain in dB only equals power gain in dB when Zin = Zout.
Assumptions, Unit Traps, and Realistic Magnitudes
To use a gain in dB calculator effectively, you must understand the boundaries of the math and develop an intuition for what the numbers actually mean in hardware.
When the Formula Applies (and Its Assumptions)
The 10 × log10 power formula is universally true for any two power measurements, regardless of impedance. However, the 20 × log10 voltage/current formula only accurately reflects power gain if the impedance at the input and output are identical. If you are measuring voltage gain across different impedances (like a transformer or a mismatched transmission line), the 20x formula gives you the voltage ratio in dB, but it will not tell you the actual power gain of the system. Always state whether your spec sheet lists "Voltage Gain (dB)" or "Power Gain (dB)" if impedances differ.
Which Unit Mistakes Break the Calculator
- Mixing Watts and Milliwatts: If Pout is 1 W and Pin is 10 mW, calculating 1 / 10 yields a ratio of 0.1 (-10 dB). The correct calculation requires converting both to the same unit: 1000 mW / 10 mW = 100 (+20 dB).
- Confusing dB with dBm: dB is a ratio (gain). dBm is an absolute power level referenced to 1 milliwatt. You can add dB to dBm (e.g., 10 dBm signal + 20 dB amplifier gain = 30 dBm output), but you cannot plug dBm directly into the Pout/Pin ratio formula without converting back to linear milliwatts first.
- Mixing RMS and Peak Voltages: If Vin is measured in Peak-to-Peak and Vout is measured in RMS by an autoranging multimeter, the ratio is corrupted by a factor of 2√2. Always ensure both AC measurements use the same mathematical definition.
What a Realistic Answer Magnitude Looks Like
Memorizing a few anchor points saves you from trusting a calculator when you accidentally hit the natural log (ln) button instead of log10. According to standard engineering heuristics, keep these benchmarks in mind:
- +3 dB: Exactly 2× the power. (Or roughly 1.414× the voltage).
- +6 dB: Exactly 2× the voltage. (Or 4× the power).
- +10 dB: Exactly 10× the power.
- +20 dB: Exactly 10× the voltage (and 100× the power).
- -3 dB: Half the power (the standard cutoff point for filters).
If you calculate a voltage ratio of 100 (which should be 40 dB) and your calculator spits out 2.3, you have accidentally calculated the natural logarithm. Reset, verify your impedance assumptions, and ensure your units match before committing the number to your design documentation.






