What this calculator does
The decibel (dB) is a logarithmic way of expressing the ratio between two amplitudes — an output relative to an input. This universal physics and electronics tool converts an input value and an output value into a gain in decibels, automatically applying the correct coefficient depending on whether your quantities represent power or voltage (amplitude). It is handy in acoustics, RF design, audio engineering, and general circuit analysis.
How to use it
Pick the Input/Output type: choose Power if In and Out are powers (watts, milliwatts), or Voltage if they are amplitudes (volts, current, sound pressure). Enter the input value In and the output value Out. Keep both in the same unit — only their ratio matters, so no unit conversion is needed. The calculator returns the gain in dB and the plain linear ratio Out/In.
The formula explained
The decibel gain is $$\text{Gain (dB)} = k \cdot \log_{10}\!\left(\frac{\text{Output Out}}{\text{Input In}}\right)$$ where the coefficient \(k\) is 10 for power and 20 for voltage. Voltage uses 20 because power is proportional to the square of voltage, and \(\log(x^2) = 2 \cdot \log(x)\). A ratio of 1 gives 0 dB. A ratio greater than 1 is a positive gain; a ratio less than 1 (Out smaller than In) gives a negative dB value, which represents attenuation or loss.
Worked example
Using the voltage default: In = 1, Out = 100, so the ratio is 100. With \(k = 20\), the gain is $$20 \cdot \log_{10}(100) = 20 \cdot 2 = 40 \text{ dB}$$ For a power example with In = 2 and Out = 200, the ratio is again 100, and with \(k = 10\) the gain is \(10 \cdot 2 = 20 \text{ dB}\).
FAQ
Why does voltage use 20 and power use 10? Power scales as voltage squared, so doubling the coefficient from 10 to 20 accounts for the square inside the logarithm.
What if Out is smaller than In? The ratio is below 1 and the dB value is negative, meaning the signal was attenuated.
Why must the input be positive and non-zero? The logarithm is only defined for positive arguments, and dividing by zero is undefined — so In must be non-zero and the ratio Out/In must be greater than zero.