Electrical Trade & Electronics Electronics Design & RF Ideal op-amp model with finite gain-bandwidth product

Op-Amp Gain Calculator

Pick a topology, enter the two resistors, and this calculator returns the closed-loop gain in volts per volt and in decibels, the output voltage for the input you supply, and the small-signal bandwidth that the op-amp's gain-bandwidth product allows. It also solves the other way: give it the gain you want and it returns the feedback resistor that produces it. The bandwidth figure uses noise gain rather than signal gain, which is why an inverting stage at a gain of 10 gets only GBW/11 of bandwidth, not GBW/10 — a distinction most quick calculations miss.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Amplifier topologyInverting flips the signal's polarity; non-inverting keeps it and cannot go below unity gain; difference amplifies the gap between two inputs.Inverting — Av = −Rf/Rin
Input resistor (Rin / Rg / R1)The resistor from the source to the inverting node, or from the inverting node to ground in a non-inverting stage.10000 Ω
Feedback resistor RfThe resistor from the output back to the inverting input. Set it to zero for a unity-gain buffer in non-inverting mode.100000 Ω
Input voltage (V1 in difference mode)The signal amplitude at the input, used only to work out the output voltage.0.1 V
Second input voltage V2The voltage on the non-inverting side of a difference amplifier; the stage amplifies V2 − V1.0.2 V
Target closed-loop gainThe gain magnitude you want; the calculator returns the Rf that produces it with your Rin unchanged.20 V/V
Op-amp gain-bandwidth productFrom the op-amp datasheet — 1 MHz for an LM358 or TL071 class part, hundreds of MHz for a video amplifier.1 MHz
Output swing limitThe largest output the op-amp can reach on your supply — the rail for a rail-to-rail part, roughly 1.5 V short of it for a classic bipolar one.13.5 V

It returns

  • Closed-loop voltage gain — Negative for an inverting stage, because the output moves opposite to the input.
  • Gain in decibels — 20·log10 of the gain magnitude. Decibels carry no sign, so an inverting stage and its non-inverting twin read alike.
  • Output voltage
  • Noise gain — The gain the feedback loop applies to the op-amp's own input offset and noise: 1 + Rf/Rin. It sets the bandwidth and the stability margin.
  • Small-signal bandwidth — Gain-bandwidth product divided by noise gain — the −3 dB point of the closed-loop response.
  • Rf for the target gain

The formula

Av=RfRin
Av=1+RfRg
Vout=RfR1(V2V1)
f3dB=GBW1+RfRin

In plain text: Av = −Rf / Rin (inverting) | Av = 1 + Rf / Rg (non-inverting)

  • AvClosed-loop voltage gain (V/V)
  • RfFeedback resistor, output back to the inverting input (Ω)
  • RinInput resistor of an inverting stage (Ω)
  • RgGround-leg resistor of a non-inverting stage (Ω)
  • NGNoise gain, 1 + Rf/Rin, which sets bandwidth and stability (V/V)
  • GBWGain-bandwidth product of the op-amp (Hz)

These expressions assume an ideal op-amp: infinite open-loop gain, no input current and no offset. They hold to better than a per cent whenever the open-loop gain at the signal frequency is at least a hundred times the noise gain.

Updated Category Electronics Design & RF Verified against published test cases Reading time 13 min

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.

  1. 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.
  2. Solve for Rf. |Av| = Rf/Rin = 10, so Rf = 10 × 10,000 = 100,000 Ω.
  3. Gain. Av = −100,000 ÷ 10,000 = −10 V/V.
  4. In decibels. 20 × log10(10) = 20.00 dB. The sign disappears; decibels describe magnitude only.
  5. Output. Vout = −10 × 0.1 = −1.000 V, comfortably inside the ±13.5 V the part can swing.
  6. Noise gain. NG = 1 + 100,000 ÷ 10,000 = 11.
  7. 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

Bandwidth is GBW divided by noise gain. The two right-hand columns show why an inverting stage is always a little slower than a non-inverting stage of the same gain magnitude.
GainGain (dB)Inverting noise gainInverting bandwidthNon-inverting noise gainNon-inverting bandwidth
10.00 dB2500,000 Hz11,000,000 Hz
26.02 dB3333,333 Hz2500,000 Hz
513.98 dB6166,667 Hz5200,000 Hz
1020.00 dB1190,909 Hz10100,000 Hz
2026.02 dB2147,619 Hz2050,000 Hz
5033.98 dB5119,608 Hz5020,000 Hz
10040.00 dB1019,901 Hz10010,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.

Frequently asked questions

What resistors give a gain of 10?

For an inverting stage, any pair whose ratio is 10 to 1 — 10 kΩ input with 100 kΩ feedback is the standard choice. For a non-inverting stage you need Rf/Rg = 9, so 10 kΩ and 90 kΩ, or the more available 11 kΩ and 100 kΩ, which gives 10.09. Keep both values between about 1 kΩ and 100 kΩ: lower loads the output, higher lets bias current and stray capacitance matter.

Why is my op-amp's bandwidth lower than gain-bandwidth divided by gain?

Because bandwidth is set by noise gain, which for an inverting stage is one greater than the signal-gain magnitude. An inverting gain of −10 has a noise gain of 11, so a 1 MHz part gives 90.9 kHz rather than 100 kHz. For a non-inverting stage the two gains are equal and the simple division is correct. The discrepancy is largest at low gains: an inverting unity-gain stage gets half the bandwidth of a unity-gain buffer.

Can a non-inverting amplifier have a gain less than 1?

No. Its gain is 1 + Rf/Rg, and since neither resistor can be negative the smallest possible value is exactly 1, reached when Rf is zero — the unity-gain buffer. To attenuate, either put a resistive divider in front of the buffer, or use an inverting stage, where a feedback resistor smaller than the input resistor gives any gain magnitude below one you like.

How do I convert op-amp gain to decibels?

Take 20 times the base-10 logarithm of the gain magnitude. A gain of 10 is 20 dB, 100 is 40 dB, 2 is 6.02 dB and 0.5 is −6.02 dB. The factor is 20 rather than 10 because decibels are defined on power and voltage enters power squared. Decibels have no sign information, so an inverting stage at −10 V/V and a non-inverting stage at +10 V/V both read 20 dB.

What is the input impedance of each topology?

An inverting stage's input impedance is simply Rin, because the summing node is a virtual ground and the source drives that resistor into what looks like a short. A non-inverting stage's input impedance is the op-amp's own differential impedance multiplied by the loop gain, which puts it in the megohms to hundreds of megohms for a bipolar part and higher still for a FET-input one, where input bias current rather than resistance becomes the practical limit. A difference stage sits in between and differs between its two inputs, which is one reason instrumentation amplifiers exist.

Does the resistor tolerance matter more than the op-amp?

For gain accuracy, yes, in almost every circuit. The closed-loop gain is a resistor ratio, so two 1% resistors give up to about 2% gain error while the op-amp contributes a small fraction of a per cent as long as its open-loop gain is far above the noise gain. For a difference amplifier the matching matters even more: with four 1% parts the worst-case common-mode rejection is (1 + Rf/R1) ÷ 0.04, which comes to about 34 dB at unity gain and roughly 49 dB at a gain of 10 — often the dominant error in the whole measurement.

Why does my output clip below the supply rails?

Classic bipolar op-amps cannot drive their outputs all the way to the rails; the output stage keeps roughly 1 to 2 V in hand at each end, so a ±15 V supply yields about ±13.5 V of usable swing. Rail-to-rail output parts get within tens of millivolts at light loads, but their swing shrinks as the load current rises. Enter the real limit in the swing field and the calculator flags the combinations of gain and input that would clip.

Can I use one op-amp for a very high gain instead of two stages?

You can, but you usually should not. A single stage at a gain of 1,000 with a 1 MHz part leaves about 1 kHz of bandwidth and multiplies the op-amp's input offset by 1,001. Two cascaded stages of about 32 each give roughly 30 kHz of bandwidth apiece and multiply the first stage's offset by only 33. The cascade also keeps each feedback resistor in the sensible range instead of forcing a megohm.

What does the difference amplifier formula assume about the other two resistors?

It assumes the divider on the non-inverting input has the same ratio as the feedback pair: R3/R2 must equal Rf/R1. When that holds, the output depends only on V2 − V1 and the common-mode component cancels. When it does not, part of the common-mode voltage leaks through to the output, and the mismatch — not the op-amp — sets the common-mode rejection ratio.

References

  • Design with Operational Amplifiers and Analog Integrated Circuits, 4th edition — Sergio Franco, McGraw-Hill
  • Op Amps for Everyone — Texas Instruments (ed. Ron Mancini)
  • The Art of Electronics, 3rd edition — Horowitz and Hill, Cambridge University Press