Converting gain to dB means translating a linear ratio of output-to-input power or voltage into a logarithmic scale that compresses massive ranges into manageable, additive numbers. Whether you are reading the open-loop gain of a TL072 op-amp or setting the stage gain on an RF low-noise amplifier (LNA), understanding this conversion prevents cascaded stage miscalculations that lead to clipped signals or buried noise floors.
The Core Math: Converting Linear Gain to dB
The decibel (dB) is not an absolute unit like volts or watts; it is a dimensionless ratio. When you convert a linear gain figure to dB, you are applying a base-10 logarithmic function to that ratio. The exact formula you use depends entirely on whether you are measuring power or voltage/current.
Power Gain Formula
For power ratios, the multiplier is 10:
Gain (dB) = 10 × log10(Pout / Pin)
Voltage and Current Gain Formulas
For voltage or current ratios, the multiplier is 20 (assuming the input and output impedances are identical):
Gain (dB) = 20 × log10(Vout / Vin)
Gain (dB) = 20 × log10(Iout / Iin)
You are testing an audio preamplifier stage on the bench. You inject a 15 mV RMS sine wave at the input and measure 1.2 V RMS at the output.
1. Calculate linear gain: 1.2 V / 0.015 V = 80.
2. Convert to dB: 20 × log10(80) = 20 × 1.903 = 38.06 dB.
If this were a power amplifier delivering 80 mW out for 1 mW in, the power gain would be 10 × log10(80) = 19.03 dB. Using the wrong multiplier is the most common math error in RF and audio design.
What This Changes in a Real Circuit (And Common Confusions)
Translating linear gain to dB fundamentally changes how you calculate signal chains. In a linear domain, cascaded stages require multiplication. If Stage 1 has a voltage gain of 20, Stage 2 has a gain of 50, and Stage 3 is a passive filter with an attenuation factor of 0.5, your total linear gain is 20 × 50 × 0.5 = 500. Doing this in your head for a 6-stage receiver chain is a recipe for errors.
By converting gain to dB, multiplication becomes addition.
Stage 1: 20 × log10(20) = 26.02 dB
Stage 2: 20 × log10(50) = 33.98 dB
Stage 3: 20 × log10(0.5) = -6.02 dB
Total Chain Gain: 26.02 + 33.98 - 6.02 = 53.98 dB.
You can instantly see that the chain provides roughly 54 dB of gain, and you can easily swap components to adjust the total without pulling out a calculator.
The Impedance Trap
What people commonly confuse is the assumption behind the 20× multiplier. The formula 20 × log10(Vout / Vin) only equals the true power gain in dB if the input and output impedances are exactly the same. If you are measuring a voltage gain of 10 (20 dB) across a high-impedance op-amp input, but driving a 50-ohm RF load, the actual power transferred is vastly different. In mismatched RF systems, always calculate the actual power in milliwatts first, then use the 10× power formula. For a deeper dive into this impedance dependency, refer to the Electronics Tutorials guide on decibels.
dB vs. dBm vs. dBV
Gain is strictly expressed in dB. It is a ratio. You cannot have a 'gain of 10 dBm'. dBm is an absolute power measurement referenced to 1 milliwatt. dBV is an absolute voltage referenced to 1 V RMS. If an amplifier has a gain of 20 dB, and you feed it a 0 dBm (1 mW) signal, the output is 20 dBm (100 mW). The gain (dB) is added to the absolute input level (dBm) to find the absolute output level (dBm).
Where You Meet Gain to dB in Practice
You will encounter dB conversions constantly across different electrical disciplines. Recognizing the context tells you which formula the manufacturer used.
- Op-Amp Datasheets: The open-loop gain (AOL) of a standard LM741 is typically listed as 100 dB. This means the linear voltage gain is 100,000 V/V. Modern precision op-amps like the ADA4891 might list 120 dB (1,000,000 V/V). Datasheets use dB because plotting 100,000 on a linear graph makes the lower-frequency roll-off impossible to read; a Bode plot uses a logarithmic dB scale to show gain and phase clearly.
- RF and Microwave S-Parameters: When you look at a vector network analyzer (VNA) trace or an S-parameter (.s2p) file, forward transmission gain is S21. S21 is always expressed in dB. A low-noise amplifier (LNA) like the Mini-Circuits GALI-74+ will specify an S21 of roughly 21 dB at 1 GHz.
- Audio Mixing and DSP: In digital signal processing (like an ESP32 running an I2S audio codec), a digital gain block of +6 dB means the binary sample values are multiplied by roughly 2 (since 20 × log10(2) ≈ 6.02 dB). Audio engineers use the '6 dB per bit' rule of thumb: every additional bit of resolution in an ADC yields roughly 6 dB of dynamic range.
- Passive Filters: A first-order RC low-pass filter attenuates the signal at a rate of -20 dB per decade (which translates to a voltage ratio drop of 10x for every 10x increase in frequency past the cutoff).
Quick-Reference Linear to dB Conversion Table
Memorizing a few key anchor points saves immense time on the bench. You can interpolate most other values from these baseline ratios. Note how the voltage/current dB values are exactly double the power dB values for the same linear ratio.
| Linear Ratio (Out/In) | Voltage / Current Gain (dB) | Power Gain (dB) | Common Bench Context |
|---|---|---|---|
| 1 | 0 dB | 0 dB | Unity gain buffer, 0 dBm reference |
| 1.414 (√2) | +3.01 dB | +1.5 dB | Half-power point (-3dB) inverted |
| 2 | +6.02 dB | +3.01 dB | Doubling voltage / 1 extra ADC bit |
| 3.162 (√10) | +10 dB | +5 dB | Standard 10dB pad attenuator inverse |
| 10 | +20 dB | +10 dB | Standard oscilloscope probe (10x) inverse |
| 100 | +40 dB | +20 dB | Typical instrumentation amp gain stage |
| 1,000 | +60 dB | +30 dB | Microphone preamp maximum gain |
| 100,000 | +100 dB | +50 dB | Classic LM741 open-loop gain |
For comprehensive standard reference tables and derivations used in telecommunications, the Analog Devices Rarely Asked Questions (RAQ) column on decibels provides excellent engineering context on why these specific logarithmic anchors matter in mixed-signal design.
Frequently Asked Questions
How do I convert a negative gain (attenuation) to dB?
A negative linear gain simply means the output is smaller than the input (a ratio less than 1). The math works exactly the same. If a passive voltage divider outputs 0.5 V for a 1.0 V input, the linear ratio is 0.5. Using the voltage formula: 20 × log10(0.5) = -6.02 dB. In RF engineering, we often flip the sign and call this an 'insertion loss of 6 dB', but mathematically, it is a gain of -6 dB.
Why is voltage gain multiplied by 20 but power by 10?
This comes directly from Joule's law and the definition of power. Power is proportional to the square of voltage (P = V² / R). When you take the logarithm of a squared value, the exponent drops down as a multiplier: log(x²) = 2 × log(x). Therefore, 10 × log(V²) becomes 10 × 2 × log(V), which simplifies to 20 × log(V). The 20 is simply the 10 from the power formula multiplied by the 2 from the voltage square.
Can I use the 20×log(V) formula if the input and output impedances are different?
No. If your circuit has a high-impedance input (e.g., 1 MΩ) and a low-impedance output (e.g., 50 Ω), the voltage ratio does not accurately represent the power ratio. In this scenario, you must calculate the actual input power (Vin² / Rin) and output power (Vout² / Rout), then apply the 10 × log10(Pout / Pin) formula to find the true power gain in dB.
What is the difference between gain in dB and dBm?
Gain in dB is strictly a dimensionless ratio comparing two points in a circuit (Output / Input). dBm is an absolute unit of power referenced to exactly 1 milliwatt. You use dB to describe the behavior of a component (like an amplifier's gain), and you use dBm to describe the actual signal level at a specific test point (like the output of a signal generator). You add dB to dBm to find your resulting signal level (e.g., -10 dBm input + 20 dB gain = +10 dBm output).






