Op-Amp Gain Calculator
An operational amplifier with two external resistors sets a precise closed-loop voltage gain. The configuration decides the sign: a non-inverting amplifier gives 1 + Rf/Rin and keeps the signal in phase, while an inverting amplifier gives minus Rf/Rin and flips the phase. This calculator takes the feedback resistor and the input resistor and returns both the non-inverting and inverting gains, plus the gain in decibels. Enter resistor values in ohms (or any consistent unit, since only their ratio matters) to size a gain stage for amplifiers, filters, and signal conditioning.
Op-amp gain formula
non-inverting gain = 1 + (Rf / Rin)
inverting gain = - (Rf / Rin)
gain in dB = 20 * log10(|gain|)
ideal op-amp assumed (infinite open-loop gain)
Rf is the feedback resistor and Rin the input resistor. Only the ratio Rf / Rin matters, so any consistent resistance unit works. The decibel value uses the magnitude of the gain.
Design notes
- The non-inverting gain is always at least 1; the inverting gain can be below 1 in magnitude.
- The inverting gain is negative because the output is 180 degrees out of phase.
- A gain of 10 is 20 dB; a gain of 100 is 40 dB.
- Real op-amps have finite gain-bandwidth that limits gain at high frequencies.
- The input resistor must be greater than zero.
Op-amp gain: frequently asked questions
What is the non-inverting op-amp gain formula?
For an ideal non-inverting amplifier the voltage gain is 1 + (Rf / Rin), where Rf is the feedback resistor and Rin is the resistor from the inverting input to ground. The gain is always at least 1 and the output is in phase with the input.
What is the inverting op-amp gain formula?
For an ideal inverting amplifier the voltage gain is minus (Rf / Rin), where Rf is the feedback resistor and Rin is the input resistor. The minus sign means the output is inverted (180 degrees out of phase) relative to the input.
How do I convert gain to decibels?
Voltage gain in decibels is 20 times the base-10 logarithm of the absolute gain magnitude: gain in dB = 20 * log10(|gain|). A gain of 10 is 20 dB, a gain of 100 is 40 dB, and a gain of 1 is 0 dB.
Why is the gain ideal and not exact?
These formulas assume an ideal op-amp with infinite open-loop gain, infinite input impedance, and zero output impedance. Real op-amps have finite gain-bandwidth, offset, and other limits, so the actual closed-loop gain is very close to but not exactly the ideal value.
Can the input resistor be zero?
No. Both gain formulas divide by Rin, so Rin must be greater than zero. A zero input resistor would give an undefined (infinite) gain. The calculator returns n/a if the input resistor is zero or negative.
Official sources
- NIST: SI units (volt, ohm, decibel reference).
- NASA Glenn Research Center: Amplifier and feedback fundamentals.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.