Skip to content
ToolBoxGeniehome

Op-Amp Gain Calculator

Calculators · Added

Two resistors set an op-amp's gain, and the formula is short enough to do in your head. What is not short is everything that decides whether the circuit delivers that gain: how far the output can swing before it hits the rails, how much bandwidth is left once the gain is taken out of the gain-bandwidth product, and whether the slew rate gives up before the bandwidth does. This does all four at once.

Configuration

Signal straight into the + input, Rf and Rg divide the output back. Gain is 1 + Rf/Rg.

V

The signal level at the input, not the supply.

V
V

0 for single supply.

V

0 for rail-to-rail, ~1.5 for a 741.

MHz

Optional. 1 MHz for a 741, 10 MHz for a TL072.

V/µs

Optional. Sets the large-signal limit.

How to use the op-amp gain calculator

  1. 1Choose inverting, non-inverting or a unity-gain buffer.
  2. 2Enter the feedback resistor and the input or ground resistor, both in kilohms — only their ratio matters to the gain.
  3. 3Enter the input signal level and the supply rails, with the headroom your op-amp needs (about 1.5 V for a 741, 0 for a rail-to-rail part).
  4. 4Add the gain-bandwidth product and slew rate from the datasheet if you want the frequency limits as well as the gain.

Examples

A microphone preamp stage

Input
Non-inverting, Rf = 100 kΩ, Rg = 10 kΩ, 10 mV in
Result
Gain +11 V/V (20.8 dB), output 110 mV

Non-inverting gain is 1 + Rf/Rg, so it can never be less than one. The 1 is the signal reaching the output directly.

Clipping caught before it is built

Input
Inverting, Rf = 100 kΩ, Rin = 10 kΩ, 1.5 V in, ±12 V rails
Result
Ideal output -15 V, clipped to -10.5 V

The arithmetic says 15 V; the circuit cannot produce it. Anything past the rail comes out as a flat top.

Where the bandwidth went

Input
Inverting gain of 1, Rf = Rin = 10 kΩ, 1 MHz GBW part
Result
Bandwidth 500 kHz, not 1 MHz

Bandwidth divides by the noise gain of 2, not the signal gain of 1 — the difference an inverting stage always carries.

About the op-amp gain calculator

Two assumptions, and everything else follows

The gain formulas come from two idealisations. First, no current flows into either input, because the input impedance is enormous. Second, the feedback loop drives the voltage difference between the two inputs to zero, because the open-loop gain is enormous and any difference would saturate the output. Together they are usually called the virtual short.

Apply them to the inverting configuration and the minus input sits at ground potential without being connected to ground — the virtual earth. The input current is then Vin/Rin, all of it has to flow on through Rf because none enters the op-amp, and the output has to be at -Vin x Rf/Rin to make that happen. Apply them to the non-inverting configuration and the minus input must sit at Vin, which makes Rf and Rg a divider from the output down to that value, giving 1 + Rf/Rg.

Notice what does not appear in either result: the op-amp's own open-loop gain. It is a hundred thousand or more, varies by a factor of three between two parts from the same tube, and moves with temperature — and none of that reaches the answer, because feedback trades it away for a gain set by two resistors instead. That trade is the whole reason the circuit is built this way.

Input impedance is the real difference between the two

Gain magnitude and sign are the obvious differences, but the one that decides most designs is impedance. In the inverting configuration the source drives Rin into a virtual earth, so the input impedance is exactly Rin — a 10 kΩ input resistor loads the source with 10 kΩ, and a high-impedance source such as a piezo pickup or a pH probe is simply swamped by it.

In the non-inverting configuration the signal goes straight to the op-amp's own input, so the source sees the input impedance of the part itself: megohms for a bipolar input, and effectively an open circuit for a FET one. That is why sensor front-ends are almost always non-inverting, and why the unity-gain buffer, which has no gain at all, is one of the most-used circuits there is.

What is left out

This models an ideal op-amp with three real limits bolted on: output swing, gain-bandwidth and slew rate. It does not model input offset voltage, input bias and offset currents, common-mode rejection, power-supply rejection, noise density or temperature drift — all of which are on the datasheet and all of which start to matter at high gain, at low signal levels, or over a wide temperature range.

Nor does it model stability. A capacitive load, a large feedback resistor working against stray capacitance, or a long lead on the input can each produce a phase shift that turns the loop into an oscillator. If a stage rings or sings at a frequency nothing in the design accounts for, that is where to look — no gain formula predicts it.

Frequently asked questions

Why is the inverting gain negative?
The minus sign is a statement about phase, not about size. In the inverting configuration the signal arrives at the terminal that the op-amp subtracts, so a rising input produces a falling output — the two are 180 degrees apart. For audio that is usually invisible, since a single inversion is inaudible on its own; for a control loop it matters enormously, because feeding an inverted signal back where a non-inverted one was expected turns negative feedback into positive feedback and the circuit latches or oscillates.
What is noise gain and why does it differ from the gain I set?
Noise gain is what the feedback network multiplies the op-amp's own internal errors by — its input offset voltage, its drift, its noise — as opposed to what it does to your signal. For both configurations it is 1 + Rf/Rin. A non-inverting stage's two gains are the same number, but an inverting stage set for a gain of -10 has a noise gain of 11, and one set for -1 has a noise gain of 2. That matters twice over: it is the figure that divides into the gain-bandwidth product, and it is the figure that amplifies the offset voltage into a DC error at the output.
Can I just use enormous resistors to get a big gain?
Only up to a point, and the point arrives sooner than the arithmetic suggests. A large feedback resistor works against the op-amp's input bias current to produce an offset voltage, and against the input capacitance to produce a pole that can make the stage ring or oscillate. Values into the megohms also pick up noise and leak across a dirty board. Keeping the feedback resistor in the tens of kilohms and splitting a large gain across two stages is more stable, quieter, and gives each stage more bandwidth than one stage doing all the work.
Why does my output stop short of the supply rails?
Because the transistors in the output stage need some voltage across them to work. A classic bipolar output loses a volt or more at each rail, which is why a 741 on ±12 V swings to about ±10.5 V rather than ±12. Parts advertised as rail-to-rail get much closer but not exactly there, and they get closer at light loads than at heavy ones — the specification is usually quoted with a stated load resistance for that reason. The headroom field here is where that figure goes.
The gain is fine at low frequency but the signal is distorted. Why?
Check the slew rate before suspecting the bandwidth. Bandwidth is a small-signal property: it says how the gain falls off, and inside it a small signal is reproduced faithfully. Slew rate caps how fast the output can move in volts per microsecond regardless of gain, so a large-amplitude signal runs into it first and the output turns into a triangle wave while the frequency is still well inside the stated bandwidth. The full-power bandwidth figure in the results is that limit expressed as a frequency for the output amplitude you entered.