Op-amp gain calculator
Gain is the easy part. This page also gives you the three numbers that decide whether the circuit works: the noise gain, which sets the bandwidth and the offset and is not the same as your signal gain; the bandwidth that gain leaves you out of the part's gain–bandwidth product; and the slew rate ceiling, which limits a large output long before the small-signal bandwidth does.
Part figures are round typical datasheet numbers — enough to size a circuit, not a substitute for the datasheet of the part you are actually buying. Choose Custom to enter your own.
| Frequency | Loop gain | Gain error | Max undistorted output |
|---|
Loop gain is the correction the op-amp still has to spend on accuracy at that frequency; the gain error is what it fails to correct. The last column is the largest output the slew rate allows there, Vpk = SR / (2πf) — when it falls below the amplitude you want, the output goes triangular no matter what the gain plot promises. A figure far above your supply rail simply means slew rate is nowhere near the limit at that frequency. The highlighted row is your test frequency.
How this is calculated
An op-amp on its own has enormous gain and no useful accuracy. Feedback trades one for the other: you give away most of the gain and get back precision, bandwidth flatness and a defined input and output impedance. Every number on this page falls out of how much gain you gave away.
The three resistive configurations are:
non-inverting: Av = 1 + Rf / Rg
inverting: Av = − Rf / Rin
difference: Av = Rf / R1, with both pairs matched
The buffer is the non-inverting case with Rf = 0 and Rg absent, so its gain is exactly 1.
Noise gain is the number that matters, and it is not your gain
The feedback network divides the output back to the inverting input by a factor β = Rg / (Rf + Rg). The reciprocal of that, 1/β = 1 + Rf/Rg, is the noise gain: the gain the circuit applies to anything that appears at the op-amp's own input — its offset voltage, its input noise, its errors.
For a non-inverting stage the noise gain and the signal gain happen to be the same number, which is why so many calculators never mention the distinction. For every other configuration they differ:
- An inverting stage of gain −1 built from two 10 kΩ resistors has a noise gain of 2. It has half the bandwidth of a non-inverting buffer made from the same op-amp, and it amplifies that op-amp's offset and noise twice as hard.
- An inverting attenuator of gain −0.1 still has a noise gain of 1.1. You cannot buy back bandwidth by asking for less than unity.
- A summing amplifier is the sharpest case. Four 10 kΩ inputs into a 10 kΩ feedback resistor give each input a gain of −1, but the four input resistors sit in parallel as far as the feedback divider is concerned, so the noise gain is 1 + 10k/2.5k = 5. A four-input mixer has a fifth of the bandwidth of the one-input stage it looks like, and five times the noise. Add inputs and it gets worse.
So the rule is: signal gain tells you the output level, noise gain tells you everything else. Bandwidth, DC offset, output noise and stability all follow the noise gain.
Where the bandwidth goes
Almost every general-purpose op-amp is deliberately built with a single dominant pole, so its open-loop gain falls at a constant 20 dB per decade (6 dB per octave) over the whole useful range. That makes the product of gain and frequency a constant — the gain–bandwidth product — and the closed-loop bandwidth is simply:
f−3dB = GBW / noise gain
A TL072 has a GBW of about 3 MHz. In a ×11 non-inverting stage that leaves 273 kHz, which is plenty for audio. Ask the same part for ×101 and you have 29.7 kHz — the top octave is already sagging. A ×101 microphone preamp needs an NE5532 (10 MHz, so 99 kHz) or something faster, and this is the entire reason fast op-amps exist in circuits that only handle 20 kHz signals.
The graph above shows why this is a hard limit rather than a rule of thumb. The closed-loop gain can only follow the flat line you asked for while the open-loop curve is still above it. Where the two meet, there is no feedback left to enforce anything, and from there the closed-loop gain has no choice but to follow the open-loop curve down.
The vertical distance between the two lines is the loop gain, and it is the currency the whole circuit runs on. Accuracy, distortion reduction, output impedance and power-supply rejection all improve in proportion to it, and all of them therefore get worse at 20 dB per decade as frequency rises. An amplifier with 100 dB of loop gain at DC and 20 dB at 20 kHz is not the same amplifier at both ends of the band, which is one honest explanation of why two circuits with identical measured frequency response can sound different.
The gain error column in the table is that idea as a number. With a loop gain T, the gain you get is short of the ideal by roughly 1/T: 60 dB of loop gain is a 0.1 % error, 40 dB is 1 %, 20 dB is 9 %.
Slew rate: the limit that catches people out
Bandwidth is a small-signal property. It is measured with an output so small that nothing inside the op-amp is working hard. Ask for a big output and a different limit arrives first.
Inside the part, a fixed bias current charges a fixed compensation capacitor, and the output simply cannot move faster than that current allows. That maximum rate is the slew rate, and a sine wave of amplitude V and frequency f needs a peak rate of 2πfV. Setting the two equal gives the largest undistorted sine the part can produce:
ffull-power = SR / (2π · Vpk)
A 741 has a slew rate of 0.5 V/µs. Asked for 10 V peak, it runs out at 7.96 kHz — inside the audio band, with a small-signal bandwidth still nominally a megahertz. The failure is not subtle: the sine turns into a triangle wave, and it happens well before the calculated bandwidth suggests any trouble at all. To get 10 V peak at 20 kHz you need at least 1.26 V/µs, which is why the 741 was never a good audio part and why a TL072 at 13 V/µs is.
Slew limiting also has an insidious middle ground. As the signal approaches the slew limit the op-amp spends part of each cycle with its input stage fully unbalanced and no feedback operating at all, which produces distortion that rises rapidly with frequency and level. The usual advice is to keep the full-power bandwidth at least a factor of three or four above the highest frequency you intend to reproduce at full level, not merely equal to it.
Offset: why your output is not at zero
Two DC errors reach the output, and the noise gain multiplies the first of them.
Vout(offset) ≈ noise gain · Vos + Ib · Rf
The input offset voltage is the small mismatch between the two input transistors, a few millivolts on a jellybean part and tens of microvolts on a precision one. A TL072 at 3 mV in a ×11 stage puts 33 mV at the output. In an AC-coupled audio circuit that is harmless. In a DC-coupled stage driving a converter, it is an error you have to trim or design out — and if the stage after it has gain, it gets multiplied again.
The bias current is the small current each input needs to operate, and it has to flow through whatever resistance it sees. A bipolar NE5532 draws about 200 nA; through a 100 kΩ feedback resistor that is another 20 mV. A JFET-input part such as the TL072 draws tens of picoamps and the term effectively vanishes — which is exactly why JFET-input op-amps are the default anywhere the surrounding resistors are large.
If you are using a bipolar part with large resistors, the classic fix costs one component: put a resistor equal to Rf ∥ Rg in series with the non-inverting input. Both inputs then see the same resistance, both bias currents produce the same error, and the difference amplifier inside the op-amp cancels most of it — leaving only the offset current, typically a quarter of the bias current or less. The calculator names that resistor for you. Note that it adds its own thermal noise, so it is a DC-precision fix, not a free one, and with a JFET part it is usually not worth fitting.
A difference amplifier is only as good as its resistors
The four-resistor difference amplifier is the standard way to receive a balanced signal, and its common-mode rejection is almost never set by the op-amp. It is set by how well the two dividers match. The worst case, with all four resistors at opposite ends of their tolerance band, is:
CMRR ≈ (1 + Rf/R1) / (4 · tolerance)
At unity gain with 1 % resistors that is 34 dB, from an op-amp whose own CMRR is likely 100 dB or better. Going to 0.1 % buys 54 dB; 0.01 % buys 74 dB. This is why balanced line receivers use matched resistor networks or dedicated difference-amplifier chips, where the four resistors are trimmed together on one die and track each other with temperature — the absolute values do not matter, only the matching does.
Two more things this configuration will not do for you. Its input impedance is unequal and low: the inverting side presents roughly R1, and the non-inverting side R1 + Rf, so any source impedance imbalance upsets the matching you just paid for. And the impedance seen by one input depends on the signal at the other. When you need high, equal, signal-independent input impedance — from a microphone, a bridge sensor, or anything with a long cable — the answer is an instrumentation amplifier, which is this circuit with two buffers in front of it.
Choosing the resistor values
The gain fixes only the ratio, so the absolute values are a separate decision with real consequences at both ends.
Too large and the resistors become noise sources in their own right. Johnson noise is √(4kTR): about 4 nV/√Hz for 1 kΩ, but 40 nV/√Hz for 100 kΩ, which is more noise than most op-amps generate at their own inputs. Large resistors also work with the op-amp's input capacitance and the stray capacitance of the board to form a pole in the feedback path, which erodes phase margin and can make the stage peak or ring. Above about 100 kΩ this needs thinking about; a few picofarads across Rf is the usual remedy.
Too small and the feedback network becomes a load on the output. A non-inverting stage puts Rf + Rg across the output; an inverting stage puts Rf from the output to a virtual ground, which is a load of Rf. Pick 100 Ω and 1 kΩ for a gain of 11 and the op-amp is driving 1.1 kΩ before it sees your actual load — fine for most parts, but the current adds to the output stage's dissipation and the distortion rises with it. Below a few hundred ohms it is a genuine constraint.
For most small-signal work, a feedback network in the 1 kΩ to 100 kΩ range is the right neighbourhood, biased toward the lower end for low-noise circuits and the upper end for low-power ones. The calculator flags values outside that range and says which problem you are buying.
Stability, briefly
Everything above assumes the op-amp is stable at the noise gain you chose. Two common ways that fails:
A capacitive load. The output impedance of the op-amp and the load capacitance form an extra pole inside the feedback loop. A few hundred picofarads — a length of coaxial cable, the input of an ADC, a piezo element — is enough to cost you phase margin and produce ringing on a square wave or outright oscillation. The standard fix is a small series resistor, 10 to 100 Ω, between the output and the load, outside the feedback loop.
A decompensated part. Some op-amps are deliberately not unity-gain stable: they are compensated for a minimum noise gain of 3, 5 or 10 in exchange for a much higher GBW at that gain. Building a buffer from one of those oscillates. The datasheet states the minimum stable gain — and it is a noise gain, so an inverting stage of gain −4 satisfies a minimum of 5 while a non-inverting stage of +4 does not.
Note also that the unity-gain buffer, the configuration that looks safest, is the one with the most feedback and the least phase margin. If a part is going to be marginal, it will be marginal there first.
FAQ
Why does my inverting amplifier load the source so much?
Because its input impedance is exactly Rin, and nothing else. The inverting input is a virtual ground, so your source drives one resistor to ground. A gain of −10 built from 1 kΩ and 10 kΩ presents 1 kΩ, which most sources will not like. Scale both up to 10 kΩ and 100 kΩ, or put a buffer in front, or use the non-inverting configuration, whose input impedance is the op-amp's own and is effectively infinite until your bias network says otherwise.
Can a non-inverting amplifier have a gain below 1?
No. The input signal reaches the output through the op-amp itself, so the gain starts at 1 and the resistors can only add to it. This calculator refuses the request rather than returning a negative resistor. To attenuate, use a plain resistive divider ahead of a buffer, or an inverting stage with Rf smaller than Rin — remembering that the inverting version still carries a noise gain above 1.
What is the difference between GBW and unity-gain bandwidth?
For a normally compensated op-amp with a single dominant pole, they are the same number, because gain × frequency is constant right down to a gain of 1. For a decompensated part they are not: the constant-slope region stops above unity gain, so the datasheet quotes a GBW measured at a higher gain and a lower unity-gain frequency, and using GBW/noise-gain near unity gain would flatter it.
Why does my circuit measure less gain than the formula at high frequency?
That is finite loop gain, and the table above quantifies it. At a tenth of your −3 dB bandwidth the error is already around 0.5 %; at half of it, 11 %. If the shortfall is at low frequency instead, look for a resistor tolerance problem, or a source impedance forming a divider with an inverting stage's input resistor.
Does the gain–bandwidth product apply to the difference amplifier too?
Yes, through its noise gain of 1 + Rf/R1 — so a unity-gain difference amplifier runs at half the GBW, exactly like the inverting stage it is built from. Its CMRR also degrades with frequency, faster than the gain does, because the two paths stop matching once stray capacitance matters.
How do I get a gain of 1000 from one stage?
Usually you do not. A GBW of 10 MHz gives you 10 kHz of bandwidth at ×1000, the offset is multiplied a thousand times, and the resistor ratio is awkward. Two stages of ×32 give the same gain with 313 kHz of bandwidth and far less DC error, and the noise penalty is small because the first stage's noise dominates anyway. Cascading is the normal answer whenever the gain-bandwidth product says one stage cannot do it.
My single-supply circuit sits at 0 V and clips instantly.
A single-supply op-amp still needs its output to sit somewhere it can swing both ways, which means biasing the non-inverting input to half the supply and AC-coupling the signal in and out. Nothing on this page changes — the gains, bandwidths and offsets are all the same — but the DC operating point has to be arranged separately. An LM358 will also not swing to its positive rail; a rail-to-rail part such as the MCP6002 will get within millivolts of both, which is the reason to pick one.
How does this relate to the other filter pages?
Add a capacitor to the feedback network and this becomes an active filter: the gain expression turns into a frequency-dependent one, and the corner is set the same way as on the RC and RL filter page. The op-amp's own bandwidth still applies on top of whatever filter you build, which is the part people forget — an active filter whose corner is near the closed-loop bandwidth of the stage does not do what the filter maths says. For the passive equivalents, see the first-order and resonant pages.