Op-Amp Gain Calculator: Inverting, Non-Inverting, Summing, Difference and In-Amp
By FindMySum · Last reviewed
An operational amplifier on its own has an enormous, unpredictable gain. Add two resistors of negative feedback and the gain becomes a simple ratio that depends only on the resistors. This op-amp gain calculator covers the six circuits you meet most: the inverting and non-inverting amplifiers, the voltage follower, the summing amplifier, the difference amplifier and the three-op-amp instrumentation amplifier. It gives the gain in V/V and decibels, the output voltage for your input with clipping at the supply rails, the noise gain and bandwidth from the op-amp's gain-bandwidth product, and, for the circuits with one gain-setting resistor, the resistor you need for a target gain with the nearest standard value.
The two rules behind every formula
With negative feedback, an ideal op-amp drives its output so that its two inputs sit at the same voltage, and its inputs draw no current. Apply those two rules and Ohm's law to any circuit below and the gain formula falls out.
Non-inverting amplifier
The signal goes to the + input. Rf runs from the output to the − input and Rg from the − input to ground, forming a divider that feeds back Rg ÷ (Rf + Rg) of the output. For the inputs to match, the output must be
G = 1 + Rf ÷ Rg
The calculator opens with Rf = 47 kΩ and Rg = 10 kΩ, so G = 5.7, which is 20 × log₁₀ 5.7 = 15.12 dB. An input of 0.5 V gives 2.85 V out. The input resistance is the op-amp's own, very high, so the circuit doesn't load the source.
Inverting amplifier
The signal feeds the − input through Rin, and the + input is grounded. The − input sits at 0 V (a "virtual ground"), so the input current V ÷ Rin all flows through Rf:
G = −Rf ÷ Rin
The output is inverted. The source sees Rin as the load. With 100 kΩ and 10 kΩ the gain is −10, or 20 dB.
Voltage follower
Connect the output straight to the − input: the gain is exactly 1. It is used as a buffer, to drive a load from a source that can't supply current, such as a high-resistance divider or a sensor.
Summing amplifier
Several inputs, each through its own resistor, meet at the inverting input:
Vout = −Rf × (V1/R1 + V2/R2 + V3/R3)
With equal resistors it adds the inputs (and inverts the sum); with different resistors it weights them. Leave an input's resistor at 0 in the calculator to switch it off.
Difference amplifier
One op-amp and four resistors subtract two voltages. With matched pairs (R1 = R3 = Rin, R2 = R4 = Rf),
Vout = (Rf ÷ Rin) × (V2 − V1)
It is used to measure current through a shunt resistor or to remove a common offset. The resistor matching sets how well it ignores the voltage common to both inputs.
Instrumentation amplifier
Two non-inverting buffers feeding a difference amplifier give very high input resistance on both inputs and a gain set by one resistor:
Vout = (1 + 2R ÷ Rg) × (V2 − V1)
for the classic three-op-amp circuit with a unity-gain difference stage. Integrated in-amps print their own version of this equation (the internal R varies), so use the datasheet's for a specific part.
Gain in decibels
Voltage gain in dB is 20 × log₁₀ |G|, because power is proportional to voltage squared. A gain of 10 is 20 dB, 100 is 40 dB, and 1 is 0 dB. An inverting amplifier's minus sign is a phase shift of 180°, not a negative dB value.
Output clipping
No op-amp can drive its output past its supply rails, and older bipolar parts stop 1 to 2 V short of each. The calculator takes your supply voltages and a headroom per rail (1.5 V by default; set 0 for a rail-to-rail part), works out the swing limits, and clips the output at them. The transfer chart shows the output rising with the input at the set gain until it flattens at the limits.
Bandwidth and the gain-bandwidth product
An op-amp's open-loop gain falls with frequency. For most general-purpose op-amps, the product of closed-loop gain and bandwidth is roughly constant: the gain-bandwidth product, GBW, on the datasheet. The −3 dB bandwidth is
f = GBW ÷ noise gain
where the noise gain is 1 + Rf ÷ Rin for both the inverting and the non-inverting amplifier. That is why an inverting amplifier with a gain of −1 has the same bandwidth as a non-inverting one with a gain of 2. A 1 MHz op-amp at a gain of 5.7 reaches about 175 kHz. The summing amplifier's noise gain uses the parallel combination of all its input resistors, so adding inputs narrows the bandwidth.
Choosing resistors
Switch "Solve for" to the resistor and enter a target gain: the calculator returns the Rf (or the in-amp's R) for your other resistor and rounds it to the nearest E12, E24 or E96 value, with the gain that value actually gives. Keep resistors between about 1 kΩ and 1 MΩ: smaller ones load the output and waste current, larger ones add thermal noise and turn bias current into offset voltage.
What the calculator leaves out
It treats the op-amp as ideal apart from the output swing and a single-pole bandwidth. Finite open-loop gain, offset voltage, bias current, slew rate, noise, the input common-mode range and resistor tolerance all move a real circuit away from these numbers, most at high gain and high frequency.
More questions
What are the golden rules of an ideal op-amp?
With negative feedback, an ideal op-amp adjusts its output so that the voltage difference between its two inputs is zero, and its inputs draw no current. Every gain formula on this page follows from those two rules and Ohm's law. They stop being true when the output clips or the signal is faster than the op-amp can follow.
Why put a resistor on the non-inverting input of an inverting amplifier?
Bipolar op-amps draw a small bias current into each input. A resistor equal to Rin in parallel with Rf from the non-inverting input to ground makes both inputs see the same resistance, so the bias currents cause matching voltage drops that cancel. With FET-input op-amps the bias current is tiny and the resistor is usually left out.
What is common-mode rejection in a difference amplifier?
A voltage that appears on both inputs at once (common mode) should not reach the output. With perfectly matched resistors it doesn't, but a 1% mismatch lets a fraction of it through. Resistor matching, not the op-amp, usually limits a discrete difference amplifier's rejection, which is why integrated difference and instrumentation amplifiers use laser-trimmed resistors.
Can an op-amp run from a single supply?
Yes, with the negative rail at 0 V. The output then can't go below ground (or a little above it, for older parts), so AC signals are biased at mid-supply with a divider and coupling capacitors. Choose a single-supply or rail-to-rail op-amp whose input range includes ground.
What is the difference between gain-bandwidth product and slew rate?
Gain-bandwidth product limits small signals: the gain falls as frequency rises. Slew rate limits large signals: the output can only change so many volts per microsecond, so a big sine wave distorts into a triangle before the bandwidth limit is reached. The full-power bandwidth is slew rate ÷ (2π × peak output voltage).
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.