100nF

Op amp gain calculator

The closed-loop gain of a non-inverting, inverting or follower stage from its two resistors, or the feedback resistor a target gain needs, rounded to a value you can buy. With the output it gives for your input, whether that output clips against the rails, what the source sees as input impedance, and the bandwidth the op amp's gain-bandwidth product leaves.

−+V_OUT2.75 VR_F 47.0 kΩR_G4.70 kΩV_IN 250 mVG = 11.0 V/V · 20.8 dBV_INV_OUTV+ 3.30 VV− 0.00 V2.75 V
Fig 1 — Non-inverting amplifier, G = 11.0 V/V (20.8 dB): 250 mV in gives 2.75 V out, inside the 50.0 mV to 3.25 V the output can swing.
Closed-loop gain, 1 + R_F/R_G
11.0 V/V · 20.83 dB
Output for 250 mV in
2.75 V
Output swing, V_OL to V_OH
50.0 mV to 3.25 V
Input range before the output clips
4.55 mV to 295 mV
Input impedance
very high · the op amp's own input, raised by the loop gain
Op amp inputs sit at
250 mV · V_IN: check the common-mode range
Noise gain · bandwidth at 1.00 MHz GBW
11.0 · 90.9 kHz
Gain with 100 dB open-loop gain
10.9988 V/V (−0.0110 %) · loop gain 79.2 dB

How this is calculated

Standard: TI SBOA092 — Handbook of Operational Amplifier Applications (Carter, Brown); TI SLOA011 — Understanding Operational Amplifier Specifications; TI SBOA626 — Operational Amplifier Stability Theory and Compensation Methods

G=VOUTVIN=1+RFRGG = \frac{V_{OUT}}{V_{IN}} = 1 + \frac{R_F}{R_G}
Non-inverting stage, SBOA092 figure 14, written there as E_O = (1 + R_O/R_I)·E_I. R_F and R_G form a divider because no current flows into the inverting input, and its tap must equal V_IN. The gain "can be any desired value above unity"; the voltage follower is the R_F = 0 case, gain 1.
G=VOUTVIN=−RFRIN,ZIN=RING = \frac{V_{OUT}}{V_{IN}} = -\frac{R_F}{R_{IN}}, \qquad Z_{IN} = R_{IN}
Inverting stage, SBOA092 figure 17 (E_O/E_I = −R_O/R_I). The inverting input is a virtual ground, so "the driving source effectively 'sees' R_I as the input impedance". The non-inverting stage's input impedance SBOA092 idealises as infinite.
β=RGRG+RF,1β=1+RFRG\beta = \frac{R_G}{R_G + R_F}, \qquad \frac{1}{\beta} = 1 + \frac{R_F}{R_G}
Feedback factor, SLOA011 eq 13 and 26 and SBOA626 eq 9, the same for both stages. Its reciprocal is the noise gain, "the gain seen by a signal source at the noninverting input" (SBOA626 §4.4). For the inverting stage it is 1 + |G|, not |G|.
f−3 dB≈GBW1+RF/RGf_{-3\,dB} \approx \frac{GBW}{1 + R_F/R_G}
Constant gain-bandwidth approximation, SBOA092 figures 33 and 34 and SLOA011 eq 37 (GBW = A_VD × f): the closed-loop gain is limited to the open-loop gain wherever the latter is smaller. The noise gain, not the signal gain, sets it. SBOA092: the unity-gain inverter's bandwidth "is decreased by one octave (50%) from that of the voltage follower".
Greal=G⋅11+1AOL βG_{real} = G \cdot \frac{1}{1 + \dfrac{1}{A_{OL}\,\beta}}
Finite open-loop gain, SLOA011 eq 16 and 25, for both stages. SBOA092's fuller µ (p. 27–28) adds the op amp's input and output impedance and reduces to this when they are ideal; its own ×10 example gives −9.987, "accurate to within 0.13%".
VOUT=min⁡ ⁣(VOH, max⁡ ⁣(VOL, G VIN)),VOH=V+−h+,VOL=V−+h−V_{OUT} = \min\!\left(V_{OH},\, \max\!\left(V_{OL},\, G\,V_{IN}\right)\right), \quad V_{OH} = V_{+} - h_{+}, \quad V_{OL} = V_{-} + h_{-}
Clipping. SBOA092: "voltage levels above the saturation voltage cannot be achieved". SLOA011 §5.6 names the swing limits V_OH and V_OL and notes they depend on the load; h₊ and h₋ are the datasheet's headroom to each rail.
GdB=20log⁡10∣G∣G_{dB} = 20 \log_{10} |G|
SBOA092 p. 31: "a gain of 10 is 20 dB, a gain of 100 is 40 dB". The sign of an inverting gain is phase and does not appear in dB.

Assumptions

What sets an op amp's closed-loop gain

Two resistors, and nothing else, as long as the op amp is close enough to ideal. TI's Handbook of Operational Amplifier Applications(SBOA092) derives both basic stages from two rules it calls the summing point restraints: "No current flows into either input terminal of the ideal operational amplifier", and "When negative feedback is applied around the ideal operational amplifier, the differential input voltage approaches zero." Everything on this page follows from those two sentences, applied to two ways of wiring the same pair of resistors.

Non-inverting. The signal drives the + input. The output returns to the − input through RF, and RGgoes from the − input to ground. SBOA092's reasoning: "Since no current flows into the inverting input, RO and RI form a simple voltage divider" (the handbook's names for RF and RG), and the − input must sit at the same voltage as the + input. The output therefore settles wherever the divider hands VINback to the − input, which is G = 1 + RF/RG. The gain "can be any desired value above unity", never below it, and the stage never inverts.

Inverting. The + input is grounded, and the signal arrives at the − input through RIN. Because the − input is held at ground potential by the feedback, the current through RIN is VIN/RIN. None of it can enter the op amp, so all of it flows on through RF, and the output has to go to −VIN·RF/RIN to carry it. The gain is G = −RF/RIN: any magnitude, including less than one, always with the sign flipped.

Follower. Short RF and remove RG, and the non-inverting stage has a gain of exactly 1. SBOA092 redraws the non-inverting stage to make the point that "the voltage follower is simply a special case of the non-inverting amplifier". It adds that "any arbitrary (but finite) resistance may be placed in the feedback loop without changing the properties of the ideal circuit", since no current flows through it. That is true of a voltage-feedback op amp. A current-feedback part is the exception: the handbook warns that its stability "is dependent entirely on the value of feedback resistor selected", and the datasheet value is the one to use.

The two stages differ most in what the source sees. In the non-inverting stage it drives an op amp input, which SBOA092 idealises as infinite impedance. In the inverting stage, "the driving source effectively 'sees' RI as the input impedance", because RIN is connected to a virtual ground. So an inverting stage with a 1 kΩ RIN loads its source with 1 kΩ, whatever the op amp.

Both stages also share one number that does not appear in either gain formula. The divider from the output back to the − input is the same RF and RG in both, so both have the same feedback factor β = RG/(RG + RF), "the portion of the output that is fed back to the input" in the words of TI's SLOA011. Its reciprocal, 1 + RF/RG, is the noise gain, which SBOA626 defines as "the gain seen by a signal source at the noninverting input". For a non-inverting stage it equals the signal gain. For an inverting stage it is one more than the signal gain's magnitude. The bandwidth, the finite-gain error and every DC error depend on the noise gain, not the signal gain. The calculator reports both.

Op amp gain resistor chart

Common gains, each built from a pair of E24 values. For every one, a search in the calculator's own code tries all 24 values of RG (or RIN) from 1 kΩ to 9.1 kΩ, rounds RF to the nearest E24 value for each, and keeps the pair with the smallest gain error. A ratio repeats every decade, so multiply both resistors by 10 to move the pair up a decade. The gain does not change, and the inverting stage's input impedance rises with RIN.

StageTargetRG / RINRFGain, actualErrordB
Non-inverting21 kΩ1 kΩ2.000exact6.02
Non-inverting53 kΩ12 kΩ5.000exact13.98
Non-inverting102 kΩ18 kΩ10.00exact20.00
Non-inverting204.3 kΩ82 kΩ20.07+0.35 %26.05
Non-inverting506.8 kΩ330 kΩ49.53−0.94 %33.90
Non-inverting1001 kΩ100 kΩ101.0+1.00 %40.09
Inverting−11 kΩ1 kΩ−1.000exact0.00
Inverting−21 kΩ2 kΩ−2.000exact6.02
Inverting−101 kΩ10 kΩ−10.00exact20.00
Inverting−1001 kΩ100 kΩ−100.0exact40.00

The inverting gains all come out exact, because E24 contains every ratio of 1, 2, 10 and 100. The non-inverting column is harder, because the stage needs RF/RG = G − 1. A gain of 10 wants a ratio of 9, which 2 kΩ and 18 kΩ give exactly. A gain of 100 wants 99, and no E24 pair in the decade gets closer than a ratio of 100. That is why a ×100 non-inverting stage built from 1 kΩ and 100 kΩ sits 1 % high. Rounding error is systematic, not random, so it adds straight onto the resistors' tolerance. With E96 values the misses shrink to +0.13 % for ×20 (1.13 kΩ and 21.5 kΩ), −0.14 % for ×50 (2.8 kΩ and 137 kΩ) and −0.74 % for ×100 (1.15 kΩ and 113 kΩ).

The dB column is 20·log10|G|, as SBOA092 defines it for the Bode plot: "a gain of 10 is 20 dB, a gain of 100 is 40 dB". An inverting stage and a non-inverting stage of the same magnitude have the same dB figure. The minus sign is a phase, and the dB scale does not show it.

Worked example: a 250 mV sensor into a 3.3 V ADC

These are the calculator's defaults. A sensor produces 0 V to 250 mV, and an ADC on a single 3.3 V supply wants to see most of its full scale. The op amp has a rail-to-rail output that gets within 50 mV of either rail, a 1 MHz gain-bandwidth product and 100 dB of open-loop gain. It is wired as a non-inverting stage with RF = 47 kΩ and RG = 4.7 kΩ. SLOA011 names this exact situation as the one where output swing becomes a design issue: "single supply systems where the op amp is used to drive the input of an analog-to-digital converter".

G           = 1 + 47k / 4.7k                  = 11.0 V/V      (20.83 dB)
V_OUT       = 11.0 × 250 mV                     = 2.75 V
swing       = 0 V + 50 mV  to  3.3 V − 50 mV  = 50.0 mV to 3.25 V
linear V_IN = 50.0 mV / 11.0  to  3.25 V / 11.0      = 4.55 mV to 295 mV
noise gain  = 1 + R_F/R_G                     = 11.0
bandwidth   = 1 MHz / 11.0                    = 90.9 kHz
loop gain   = 10^(100/20) / 11.0              = 9091   (79.2 dB)
real gain   = 11.0 / (1 + 1/9091)           = 10.99879   (−0.0110 %)

The full-scale 250 mV comes out at 2.75 V. That uses 83 % of the ADC's range and leaves 500 mV before the output reaches the top of its swing, which happens at an input of 295 mV. At DC the open-loop gain costs about a hundredth of a per cent, far less than a 1 % resistor.

Using more of the range. A gain of 12 would put full scale at 3.0 V. In solve mode with RG = 4.7 kΩ, the exact RF is 51.7 kΩ. The nearest E24 value is 51 kΩ, which gives G = 11.851 (−1.24 %). The nearest E96 value is 52.3 kΩ, which gives 12.128 (+1.06 %). E96 barely helps here, because 51.7 kΩ falls almost exactly between 51.1 kΩ and 52.3 kΩ. Solve instead with RG = 10 kΩ, and a gain of 12 needs exactly 110 kΩ, which is in both series. The chart's search exists for this reason: the resistor you fix first decides how well the other one can land.

Clipping. Raise VIN to 300 mV and the stage asks for 3.30 V. That is inside the 3.3 V rail but above the 3.25 V the output can actually reach, so the output stops at 3.25 V and the calculator flags it. Switch the same resistors to the inverting stage and it is much worse: −10.0 × 250 mV is −2.50 V, the output has no negative rail to go to, and it sits at 50.0 mV. An inverting stage on a single supply needs a negative input, or its + input lifted to a reference voltage, before it can produce anything at all.

Where the ideal-op-amp gain stops being valid

SBOA092 claims the ideal gain equations are "directly applicable to real circuits - to within a few tenths of a percent in most cases", and backs it with an example. A ×10 inverting stage (10 kΩ and 100 kΩ) uses an op amp with an open-loop gain of 10,000, 50 kΩ of input impedance and 100 Ω of output impedance, driving a 10 kΩ load. Its error term comes to µ = 0.0013, and the real gain is −9.987, "accurate to within 0.13% of the idealized value". The calculator uses SLOA011's simpler form, which divides the ideal gain by 1 + 1/(AOL·β). Put ideal input and output impedances into the handbook's expression and it reduces to that form, −9.989 for the same stage. Most of the error is the open-loop gain; the rest is the op amp's finite input impedance (the ZO/Zinterm in µ) and, much less, its output impedance working against the load. The handbook calls this "a 'calibration' error" that "a slight adjustment of the feedback resistor" cancels.

The open-loop gain falls with frequency. With a constant gain-bandwidth product (SLOA011's GBW = AVD × f), the 1 MHz part in the example above has 100 dB at DC but only 40 dB at 10 kHz, and the error term 1/(AOL·β) grows as the gain falls. SBOA092's figure 34 shows the limit. "If the closed loop gain called for by the feedback configuration is greater than the open loop gain available from the operational amplifier for any particular frequency, closed loop gain will be limited to the open loop gain value." A ×100 inverting stage on an op amp with 1 MHz of open-loop bandwidth stays flat to about 10 kHz and then follows the open-loop line down. The calculator's bandwidth, GBW/(1 + RF/RG), is that corner: 1 MHz/101 = 9.90 kHz. It is a −3 dB point, where the gain is already 30 % low. For accuracy the loop needs gain to spare. SBOA092 asks for "open loop bandwidth of at least 200 MHz to provide a closed loop gain of 40 dB at 1 MHz", about twice what the corner arithmetic alone gives.

Noise gain, not signal gain, sets the bandwidth. This is where the inverting stage pays for its virtual ground. SBOA092 on the unity-gain inverter: "The bandwidth is decreased by one octave (50%) from that of the voltage follower due to the voltage division effect of the input and feedback resistors." Its signal gain is 1, but its noise gain is 2. At high gain the difference fades: for its ×1000 stages the handbook notes that the divider costs negligible bandwidth.

Large signals. The gain-bandwidth figure is a small-signal one. A full-swing output at high frequency meets the slew rate first. SLOA011 says of the maximum output-swing bandwidth that "the limiting factor for BOM is slew rate". Where the calculator's bandwidth looks comfortable but the output is volts wide, the datasheet's slew rate and maximum output-swing bandwidth are the numbers to check.

Output swing depends on the load. SLOA011: "Note that VOM± depends on the output load". A rail-to-rail output's headroom grows with the current it sources, because its output impedance "will limit how close to the rails the output can go". Use the VOH and VOL the datasheet specifies at a load like yours. The feedback pair is part of that load: RF + RG hangs across the output.

Input common-mode range. SBOA092: "For the inverting amplifier, one input terminal is grounded; hence, the common mode input voltage is zero. In the non-inverting configuration, however, an equal voltage appears at both input terminals and the common mode limit must be observed." A non-inverting stage whose input approaches a rail needs an op amp whose common-mode range includes that rail. SLOA011 lists which input structures reach which rail.

Stability at low noise gain. The follower, with a noise gain of 1, is the hardest case for the op amp's compensation. Some parts are compensated only for higher gains, and SBOA092 says such a part "cannot be used for lower gains without readjusting the compensation". A capacitive load erodes the margin further. That problem has its own calculator, linked below.

Common op amp gain mistakes

Further reading