Why two resistors set the gain, not the op-amp
An op-amp on its own has a voltage gain of a hundred thousand or more, and that number is neither accurate nor stable: it varies part to part, drifts with temperature, and falls steadily with frequency. No sensible design depends on it. What negative feedback does is trade almost all of that raw gain for a closed-loop gain set by two passive components you can buy to 0.1%.
The mechanism is one rule applied twice. Because the open-loop gain is enormous, the op-amp only settles when the voltage difference between its two inputs is essentially zero — the virtual short. And because its inputs draw essentially no current, whatever current flows into the summing node through the input resistor has to leave through the feedback resistor.
Apply both to the inverting configuration. The non-inverting input sits at ground, so the virtual short holds the inverting node at ground too: a virtual ground. The input current is therefore Vin/Rin. That same current flows on through Rf to the output, so the output sits at −(Vin/Rin)·Rf, and the gain is −Rf/Rin. The minus sign is not a convention; it says the output must go negative to pull current out of a node the input is pushing current into.
The non-inverting configuration puts the signal on the other input, and now the virtual short holds the inverting node at Vin rather than at ground. Rf and Rg form a divider from the output back to ground, so the output has to rise until that divider produces Vin. That gives Vout·Rg/(Rf+Rg) = Vin, or Av = 1 + Rf/Rg. The leading 1 is why a non-inverting stage cannot attenuate: even with Rf at zero the output must still equal the input. If you need a gain below unity, the voltage divider calculator sizes the attenuator you put in front of the buffer.
Noise gain: the number that actually sets your bandwidth
Signal gain and noise gain are different quantities, and confusing them is the most common error in op-amp bandwidth estimates. Signal gain is what the stage does to your input. Noise gain is what the feedback network does to anything appearing at the op-amp's own input pins — its offset voltage, its input noise, and the error signal the loop works against. Noise gain is always 1 + Rf/Rin, whatever the topology, because it depends only on the divider ratio the feedback network presents back to the inverting node.
For a non-inverting stage the two happen to coincide: the signal gain is 1 + Rf/Rg and so is the noise gain. For an inverting stage they differ by exactly one: a gain of −10 built from 100 kΩ and 10 kΩ has a noise gain of 11. That relationship is an identity, not a rule of thumb — write the two expressions side by side and the difference is the leading 1 that the inverting signal path does not have.
The consequence is that closed-loop bandwidth is the gain-bandwidth product divided by the noise gain. An op-amp with a 1 MHz GBW gives a non-inverting gain-of-10 stage 100 kHz, but gives the inverting gain-of-10 stage only 90.9 kHz. At low gains the gap is proportionally larger: an inverting unity-gain stage has a noise gain of 2 and therefore half the bandwidth of a unity-gain buffer built the other way. This is also why an inverting stage is the harder one to stabilise at low gain, and why datasheets specify minimum stable noise gain rather than minimum signal gain.
Offset voltage follows the same path. An op-amp with 3 mV of input offset in a noise-gain-of-11 circuit puts 33 mV of error at the output regardless of which input you fed. If that matters, lower the noise gain by splitting the gain across two stages rather than pushing one stage hard.
Worked example: an inverting stage at a gain of 10
You need to turn a ±0.1 V sensor signal into a ±1 V signal for an ADC, using a TL071-class op-amp with a 1 MHz gain-bandwidth product on ±15 V rails.
- Choose Rin. An inverting stage's input impedance is Rin, so pick 10 kΩ — light enough not to load a typical sensor buffer, low enough to keep bias-current errors small.
- Solve for Rf. |Av| = Rf/Rin = 10, so Rf = 10 × 10,000 = 100,000 Ω.
- Gain. Av = −100,000 ÷ 10,000 = −10 V/V.
- In decibels. 20 × log10(10) = 20.00 dB. The sign disappears; decibels describe magnitude only.
- Output. Vout = −10 × 0.1 = −1.000 V, comfortably inside the ±13.5 V the part can swing.
- Noise gain. NG = 1 + 100,000 ÷ 10,000 = 11.
- Bandwidth. f = 1,000,000 ÷ 11 = 90,909 Hz. Using the signal gain instead would have given 100 kHz, an optimistic answer by 10%.
Check the result against the application. If the sensor signal reaches 10 kHz, you have nine times the bandwidth you need and the gain error from finite open-loop gain is negligible. If it reached 80 kHz you would be operating close to the −3 dB corner, where the gain is already sagging, and you would move to a faster op-amp or split the gain into two stages of about 3.2 each — noise gain 4.2 apiece, so roughly 238 kHz of bandwidth per stage.
Choosing the resistor values, not just the ratio
The gain fixes only the ratio, so the absolute values are a separate decision with real consequences. Aim for the 1 kΩ to 100 kΩ band unless you have a reason to leave it.
Going too low loads the output. The op-amp has to drive Rf in parallel with whatever else hangs on the output, and a 1 kΩ feedback network at a 10 V swing demands 10 mA before the load gets any. In an inverting stage, low values also drop the input impedance the source sees, because Rin is the input impedance.
Going too high lets the op-amp's imperfections through. Input bias current flowing in Rf produces an output offset directly — 100 nA in 1 MΩ is 100 mV — and the resistors' own thermal noise rises with the square root of resistance. Stray capacitance of a few picofarads across a 1 MΩ feedback resistor also forms a pole inside the audio band, rolling off the response before you intended.
Read the bandwidth figure as a small-signal number. It tells you where the closed-loop gain has fallen by 3 dB, not the largest signal you can put through at that frequency. Large outputs are limited instead by slew rate, a separate datasheet parameter: the highest undistorted sine frequency is slew rate divided by 2π times the peak output voltage. A part with 13 V/µs producing a 10 V peak runs out at about 207 kHz however much gain-bandwidth it has. If your stage feeds a filter, size that separately with the RC filter cutoff calculator.
Gain, decibels and bandwidth with a 1 MHz gain-bandwidth product
| Gain | Gain (dB) | Inverting noise gain | Inverting bandwidth | Non-inverting noise gain | Non-inverting bandwidth |
|---|---|---|---|---|---|
| 1 | 0.00 dB | 2 | 500,000 Hz | 1 | 1,000,000 Hz |
| 2 | 6.02 dB | 3 | 333,333 Hz | 2 | 500,000 Hz |
| 5 | 13.98 dB | 6 | 166,667 Hz | 5 | 200,000 Hz |
| 10 | 20.00 dB | 11 | 90,909 Hz | 10 | 100,000 Hz |
| 20 | 26.02 dB | 21 | 47,619 Hz | 20 | 50,000 Hz |
| 50 | 33.98 dB | 51 | 19,608 Hz | 50 | 20,000 Hz |
| 100 | 40.00 dB | 101 | 9,901 Hz | 100 | 10,000 Hz |
Scale every bandwidth figure directly with your own op-amp's GBW: a 10 MHz part multiplies each entry by ten. The decibel and noise-gain columns do not depend on the op-amp at all.
Assumptions and traps in these formulas
- The ideal-op-amp result needs loop gain to spare. Closed-loop gain equals the resistor ratio only while the open-loop gain far exceeds the noise gain. Near the −3 dB corner the real gain is already about 30% below the ratio, so treat the bandwidth number as an outer limit, not a working frequency.
- Bandwidth follows noise gain, not signal gain. Dividing GBW by the signal gain overstates an inverting stage's bandwidth, and the error is worst at low gains, where it approaches a factor of two.
- A difference amplifier's rejection is a resistor-matching problem. The formula assumes the non-inverting divider matches Rf/R1 exactly. Worst-case common-mode rejection with four ordinary 1% resistors is (1 + Rf/R1) ÷ (4 × 0.01), which is only about 34 dB at unity gain and improves as the gain rises; an instrumentation amplifier with laser-trimmed internal resistors is the right part when you need better.
- The inverting input impedance is Rin, and nothing more. Non-inverting stages present the op-amp's own input impedance, which is enormous — that asymmetry is often the deciding factor between the two topologies.
- Slew rate, not bandwidth, limits large signals. A stage can be well inside its −3 dB point and still distort a large sine wave because the output cannot move fast enough.
- Single-supply circuits need a reference, not ground. Every formula here assumes the inputs can swing either side of the reference. On a single rail you must bias the reference to mid-supply and treat that as your zero.
- Stray capacitance at the inverting node erodes phase margin. Board capacitance working against Rf can cause peaking or oscillation; a small capacitor across Rf is the usual remedy, at the cost of bandwidth.
What the ideal op-amp model does and does not assume
Every expression on this page comes from the ideal op-amp model: infinite open-loop gain, infinite input impedance, zero input current, zero output impedance and zero offset. The one departure from ideality kept here is the finite gain-bandwidth product, because that is what makes the bandwidth output meaningful. Input bias current, offset voltage, common-mode rejection, slew rate and output current limits are all real and all absent from these formulas — look them up in the datasheet for your part when the design gets close to any of them.
Which topology to reach for
Choose the non-inverting stage when your source cannot tolerate loading. Its input goes straight to the op-amp pin, so it presents megohms, and it is the natural partner for high-impedance sensors, piezo elements and potentiometer wipers. Its costs are that it cannot attenuate and that the input pins see the full common-mode signal.
Choose the inverting stage when you need gains below one, when you want to sum several signals, or when you need the summing node's virtual ground — transimpedance amplifiers for photodiodes are inverting stages with Rf alone. Because the inverting input never moves, common-mode distortion disappears, which is why precision instrumentation front ends often invert.
Choose the difference stage when the signal you want is the gap between two nodes and the interference is common to both — a shunt-current measurement, a bridge output, a long cable run. Its usefulness stands or falls on resistor matching, so buy a matched network or a purpose-built difference amplifier rather than trusting four loose 1% parts.
Once the stage is designed, the surrounding arithmetic is quick: convert the gain to and from decibels with the decibel gain calculator, check the current the feedback network draws with the Ohm's law calculator, build a value you do not stock with the series resistance calculator, and if the stage drives an indicator, size its resistor with the LED series resistor calculator.
Key terms
- Closed-loop gain
- The gain of the complete amplifier with feedback in place, set by the resistor ratio rather than by the op-amp.
- Noise gain
- 1 + Rf/Rin — the gain the feedback network applies to the op-amp's own offset and noise. It sets bandwidth and stability regardless of topology.
- Gain-bandwidth product
- The frequency at which the op-amp's open-loop gain falls to unity. Dividing it by the noise gain gives the closed-loop −3 dB bandwidth.
- Virtual ground
- The inverting input of an inverting stage, held at the reference potential by feedback even though it is not physically connected to it.
- Slew rate
- The fastest rate at which the output can change, in volts per microsecond. It limits large signals independently of bandwidth.
