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.
How to use the op-amp gain calculator
- 1Choose inverting, non-inverting or a unity-gain buffer.
- 2Enter the feedback resistor and the input or ground resistor, both in kilohms — only their ratio matters to the gain.
- 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).
- 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?
What is noise gain and why does it differ from the gain I set?
Can I just use enormous resistors to get a big gain?
Why does my output stop short of the supply rails?
The gain is fine at low frequency but the signal is distorted. Why?
Related tools
Voltage Divider Calculator
Calculators
Find the output of a two-resistor divider, or the resistor that hits a target voltage.
Decibel Calculator
Calculators
Convert between ratios and decibels, and between dBm, dBW, dBV and dBu.
Ohm's Law Calculator
Calculators
Enter any two of voltage, current, resistance and power to get the other two.
AC BTU Calculator
Calculators
Size an air conditioner for a room, with the adjustments for sun, ceiling height, occupants and kitchens.