Tech & Digital
Op-Amp Gain Calculator (Inverting, Non-Inverting, Difference)
Operational amplifiers, or op-amps, are the building blocks of analogue electronics. On their own they have enormous gain, but with negative feedback through a pair of resistors they become precise amplifiers whose gain depends only on the resistor values. In the inverting configuration the signal goes through an input resistor to the inverting input, and a feedback resistor connects the output back to that input; the gain is minus the feedback resistance divided by the input resistance, so the output is an amplified, upside-down copy of the input. In the non-inverting configuration the signal goes straight to the non-inverting input and the resistors form a divider from the output to ground; the gain is one plus the feedback resistance divided by the ground resistance, and the input impedance is very high. The voltage follower, or buffer, is the special case with no resistors and a gain of exactly one, used to isolate a high-impedance source from a load. The difference amplifier subtracts two signals, multiplying their difference by the resistor ratio when both pairs of resistors are matched, which makes it useful for sensors and for rejecting noise common to both inputs. Gains are often given in decibels, twenty times the base-ten logarithm of the gain. This calculator assumes an ideal op-amp and returns the gain, the gain in decibels, the output voltage and whether that output would exceed the supply rails and clip, plus the input impedance of the inverting stage.
How to use this calculator
- Choose the amplifier configuration.
- Enter the feedback resistor and the input or ground resistor in kilohms.
- Enter the input voltage; for a difference amplifier enter V₂ − V₁.
- Optionally enter the supply rail voltage to check for clipping.
- Read the gain, the gain in dB and the output voltage.
Choosing resistor values
Resistors between about 1 kΩ and 100 kΩ are common. Very small values draw a lot of current from the source and output, while very large values add noise and are sensitive to the op-amp's input bias current.
For accurate gain, use 1 % or better resistors. In a difference amplifier, resistor matching sets how well common-mode noise is rejected, so precision networks are often used.
Real op-amp limits
Real op-amps have finite gain-bandwidth product, so the closed-loop gain falls at high frequencies. A part with a 1 MHz gain-bandwidth product gives a gain of 10 only up to about 100 kHz.
Slew rate, output current limits, input offset voltage and the output swing near the rails also restrict performance. Datasheets list these values for each device.
Formula & method
Inverting: G = −Rf ÷ RinNon-inverting: G = 1 + Rf ÷ Rg; follower: G = 1Difference (Rf/Rin matched on both inputs): Vout = (Rf ÷ Rin) × (V₂ − V₁)Gain (dB) = 20 × log₁₀|G|; ideal op-amp, output limited by the supply railsInverting G = −Rf/Rin, non-inverting G = 1 + Rf/Rg, follower G = 1, difference Vout = (Rf/Rin)(V₂ − V₁), and gain in dB = 20 log₁₀|G|.
Worked example
An inverting amplifier with Rf = 100 kΩ, Rin = 10 kΩ and 0.5 V input
- G = −100 ÷ 10 = −10
- Gain in dB = 20 × log₁₀(10) = 20 dB
- Vout = −10 × 0.5 = −5 V, within ±15 V rails
Answer: The output is a 5 V signal inverted relative to the input.
Frequently asked questions
What is the difference between inverting and non-inverting gain?
Inverting gain is −Rf/Rin and flips the signal; non-inverting gain is 1 + Rf/Rg and keeps its polarity. A non-inverting stage can never have a gain below 1.
Why use a voltage follower if its gain is 1?
It has very high input impedance and low output impedance, so it can drive loads from a weak source without loading it. This is called buffering.
How do I convert gain to decibels?
Multiply the base-10 logarithm of the voltage gain by 20. A gain of 10 is 20 dB, 100 is 40 dB and 1,000 is 60 dB.
What does clipping mean?
If the calculated output exceeds what the op-amp can swing to, the output flattens at the limit, distorting the signal. Reduce the gain or input, or use higher supply rails.
What is the input impedance of a non-inverting amplifier?
It is very high, essentially that of the op-amp's input, often megohms to teraohms. The inverting stage's input impedance equals Rin.
Does the calculator work for AC signals?
Yes, for frequencies well below the op-amp's bandwidth limit. Enter the peak or RMS input voltage and the output will be in the same terms.