A decibel (dB) calculator is not a single universal equation; it is an application of logarithmic ratios used to compress massive dynamic ranges into manageable numbers. Whether you are calculating the gain of an RF power amplifier or the signal loss across a 50-ohm coaxial cable, the direct answer depends entirely on whether you are measuring power or amplitude (voltage/current).
For power, the formula is dB = 10 × log10(P2 / P1). For voltage or current, the formula is dB = 20 × log10(V2 / V1). Using the wrong multiplier (10 vs. 20) or failing to normalize your units before dividing will instantly invalidate your results. Below is the complete derivation, algebraic rearrangements, and worked examples with strict unit tracking to ensure your bench calculations match reality.
The Core Decibel Formulas and Symbol Definitions
The decibel is a dimensionless unit. It does not measure an absolute quantity like volts or watts; it expresses a ratio between two values. We use base-10 logarithms because human perception of sound and signal degradation is logarithmic, and because cascading system gains/losses can be calculated via simple addition rather than complex multiplication.
| Symbol | Definition | Standard Unit / Domain |
|---|---|---|
| dB | Decibel ratio (Gain if positive, Loss/Attenuation if negative) | Dimensionless (Logarithmic ratio) |
| P1 | Reference or Input Power | Watts (W) or milliwatts (mW) |
| P2 | Measured or Output Power | Watts (W) or milliwatts (mW) |
| V1 | Reference or Input Voltage (or Current I1) | Volts (V), RMS or Peak (consistent) |
| V2 | Measured or Output Voltage (or Current I2) | Volts (V), RMS or Peak (consistent) |
| log10 | Base-10 logarithm function | N/A |
Power Formula: dB = 10 * log10(P2 / P1)
Amplitude Formula: dB = 20 * log10(V2 / V1)
Rearranged Forms: Solving for Unknown Variables
On the bench, you rarely just need the dB value. More often, you know the dB specification of a component (like a +20 dB low-noise amplifier) and your input signal, and you need to find the output. Here are the algebraic inversions for every variable in both domains.
Power Domain Rearrangements
- Solve for Output Power (P2):
P2 = P1 * 10^(dB / 10) - Solve for Input Power (P1):
P1 = P2 / 10^(dB / 10)
Voltage/Current Domain Rearrangements
- Solve for Output Voltage (V2):
V2 = V1 * 10^(dB / 20) - Solve for Input Voltage (V1):
V1 = V2 / 10^(dB / 20)
Worked Examples with Strict Unit Tracking
The most common point of failure in decibel math is unit mismatch. The ratio inside the logarithm must be dimensionless, meaning the numerator and denominator must share the exact same unit prefix before you divide.
Problem 1: RF Power Amplifier Gain (Power Domain)
Scenario: You are testing a 2.4 GHz WiFi RF power amplifier. The signal generator feeds an input power of 25 mW. The spectrum analyzer at the output reads 4.0 Watts. What is the gain in dB?
- Identify the domain: We are dealing with power, so we use the
10 * log10formula. - Normalize units: P1 = 25 mW. P2 = 4.0 W. Convert P2 to milliwatts: 4.0 W = 4000 mW.
- Set up the ratio: P2 / P1 = 4000 mW / 25 mW = 160. (Notice the 'mW' cancels out, leaving a pure number).
- Apply the logarithm: log10(160) ≈ 2.20412
- Multiply by the domain constant: 10 * 2.20412 = 22.04 dB
Result: The amplifier provides 22.04 dB of power gain.
Problem 2: Audio Line Attenuator (Voltage Domain)
Scenario: An audio DAC outputs a 2.0 VRMS line-level signal, but the input stage of your mixer clips above 1.2 VRMS. You insert a passive resistive pad. What is the required attenuation in dB?
- Identify the domain: We are dealing with voltage, so we use the
20 * log10formula. - Normalize units: V1 = 2.0 VRMS, V2 = 1.2 VRMS. Both are in Volts RMS. No conversion needed.
- Set up the ratio: V2 / V1 = 1.2 / 2.0 = 0.6.
- Apply the logarithm: log10(0.6) ≈ -0.22185
- Multiply by the domain constant: 20 * -0.22185 = -4.44 dB
Result: You need a pad that provides at least -4.44 dB of voltage attenuation.
Boundary Conditions, Assumptions, and Fatal Unit Mistakes
To use a dB calculator correctly, you must understand the physical assumptions baked into the math. According to the NTIA Manual of Regulations and Procedures for Federal Radio Frequency Management, misapplying these formulas is a primary source of link-budget errors in telecommunications.
The Impedance Matching Assumption
Why does the voltage formula use 20 while power uses 10? Because Power = Voltage2 / Resistance. If we substitute this into the power formula:
dB = 10 * log10( (V2^2 / R2) / (V1^2 / R1) )
If, and only if, the input and output impedances are identical (R1 = R2), the resistances cancel out. The exponent of 2 on the voltages is then pulled out of the logarithm, multiplying the 10 by 2 to become 20.
The Trap: If you are measuring voltage gain across a device with a 10 kΩ input impedance and a 50 Ω output impedance (like many audio interfaces driving an RF stage), the 20 * log10(V2/V1) formula calculates voltage gain, but it does not equal the power gain. Always verify if your system impedance is matched before assuming voltage dB equals power dB.
Fatal Unit Mistakes
- Mixing Prefixes: Dividing 5 Watts by 100 milliwatts directly (5/100 = 0.05) instead of converting to 5000 mW / 100 mW = 50. This yields a completely false negative dB value for a gain stage.
- Mixing Peak and RMS: Comparing a Peak voltage to an RMS voltage. You must convert both to the same metric (e.g., Vpeak * 0.707 = VRMS) before calculating the ratio.
- Using 10 log for Voltage: A common mental slip that results in an answer exactly half of what it should be.
What a Realistic Answer Magnitude Looks Like
When you punch numbers into a dB calculator, you should immediately know if the output makes physical sense. Memorize these anchor points to sanity-check your math:
| dB Value | Power Ratio (Multiplier) | Voltage Ratio (Multiplier) |
|---|---|---|
| +3 dB | 2x (Double) | 1.414x (√2) |
| +6 dB | 4x | 2x (Double) |
| +10 dB | 10x | 3.162x (√10) |
| +20 dB | 100x | 10x |
| -3 dB | 0.5x (Half) | 0.707x (1/√2) |
If your voltage ratio is 2:1, but your dB calculator outputs +3 dB instead of +6 dB, you used the wrong formula.
dB Calculator FAQ
How do I calculate dB loss for a long coaxial cable run?
Coaxial cable attenuation is specified by manufacturers in dB per unit length at a specific frequency (e.g., 5.2 dB per 100 feet at 1 GHz for RG-6). To calculate total loss, multiply the cable length by the attenuation rate. For example, 150 feet of cable with a 5.2 dB/100ft spec yields a total loss of 1.5 * 5.2 = -7.8 dB. You then use the rearranged power formula P2 = P1 * 10^(-7.8 / 10) to find the exact wattage reaching the antenna. As noted in All About Circuits' guide to decibels, cable loss scales non-linearly with frequency due to the skin effect, so always use the datasheet value for your exact operating frequency.
Why does my dB calculator use 20 log for voltage but 10 log for power?
This stems from the physical relationship between power, voltage, and resistance (P = V2/R). When calculating the ratio of two powers, the logarithm of the squared voltage term brings the exponent '2' down to the front of the equation. Multiplying the base constant of 10 by this exponent of 2 results in 20. Therefore, 20 log is simply the power formula mathematically adapted for amplitude measurements, assuming the impedance remains constant across the measurement points.
What is the difference between dB, dBm, and dBu in audio and RF?
"dB" is strictly a dimensionless ratio between two arbitrary values. "dBm" and "dBu" are absolute measurements because they lock the denominator (P1 or V1) to a fixed reference.
dBm references exactly 1 milliwatt (0 dBm = 1 mW). It is used heavily in RF and WiFi link budgets.
dBu references 0.775 Volts RMS (historically derived from 1 mW across a 600 Ω telephone line). It is the standard for professional analog audio line levels. You cannot calculate a ratio between a dB value and a dBm value directly; you must convert the dBm value back to absolute Watts or Volts first.
Can I just add dB values together in a cascade?
Yes, and this is the primary advantage of the decibel system. If you have an amplifier with +15 dB gain, followed by a cable with -4 dB loss, followed by an antenna with +6 dBi gain, the total system gain is simply 15 - 4 + 6 = +17 dB. This only works because logarithms convert multiplication into addition. However, ensure all values are in standard dB (or all in dBm). You cannot add a dB ratio directly to a dBm absolute power level without treating the dBm as the starting reference point.






