Learn · Analog electronics

Op-Amp Gain Explained: Inverting, Non-Inverting, and Negative Feedback

An operational amplifier uses the voltage difference between its two inputs to control its output. With negative feedback, a few external resistors set a predictable closed-loop gain.

This guide explains why the common inverting and non-inverting formulas work, what “virtual short” and “virtual ground” mean, and where the ideal model stops matching a real circuit.

Need the result first? Use the Op-Amp Gain Calculator

What is an op-amp?

An operational amplifier, or op-amp, produces an output based on the difference between its two input voltages. The V+ input is the non-inverting input, V− is the inverting input, and Vout is the output.

A real op-amp has a very large but finite open-loop gain: a small difference between V+ and V− can cause a large output change. In practical amplifier circuits, external negative feedback makes that behavior controllable. This guide uses the ideal model first, then points out the limits that matter in a real design.

The ideal op-amp model

Ideal analysis makes a few deliberately simplified assumptions:

  • Open-loop gain is infinite, or at least extremely large.
  • Input current is zero.
  • Under stable negative feedback and linear operation, V+ and V− are approximately equal.
V+ ≈ V−

This relationship is not caused by a wire between the inputs. It is the result of high open-loop gain acting with negative feedback. Real op-amps have small input bias currents and finite gain, so the approximation is useful only while the circuit remains in its intended linear operating region.

Why negative feedback matters

Negative feedback returns part of Vout to the inverting input. If V+ becomes slightly higher than V−, the output tends to rise. The feedback network then raises V−, making the input difference smaller and opposing the original change.

V+ > V− → Vout tends to rise → feedback raises V− → V+ − V− becomes smaller

The opposite direction works the same way. If Vout falls, feedback tends to lower V−. Under stable, linear negative feedback, only a very small input difference is needed to create the output required by the resistor network. That is why the ideal model can use V+ ≈ V− without claiming that the op-amp “forces” the inputs equal under every condition.

What is a virtual short?

A virtual short means that V+ and V− are approximately equal in voltage under the ideal negative-feedback conditions. It does not mean that they are physically connected.

Inverting amplifier

In an inverting amplifier, Vin reaches V− through Rin. The feedback resistor Rf connects Vout back to the same node, while V+ is connected to a ground or reference voltage.

Op-amp feedback schematicAn inverting amplifier with resistor feedback, input, and ideal output labels.Rin 10 kΩRf 50 kΩ+Vin0.2 VGain −5 V/VVout −1 VV+ reference / groundRf 50 kΩRg 10 kΩ+Vin0.2 VGain −5 V/VVout −1 V

The input signal enters V− through Rin. Rf returns output information to V−, establishing negative feedback; V+ is the reference input.

Av = Vout / Vin = −Rf / RinVout = Av × Vin

Using the calculator’s default values, Vin = 0.2 V, Rin = 10 kΩ, and Rf = 50 kΩ:

Gain−5 V/V
PolarityInverted
Ideal Vout−1 V

The minus sign means the output polarity is reversed. A positive input produces a negative ideal output, and a negative input produces a positive ideal output, provided the op-amp has suitable supply rails and remains in linear operation.

Why the inverting formula works

With V+ at 0 V and stable negative feedback, the ideal model treats V− as approximately 0 V. The ideal op-amp input current is approximately zero, so current entering the V− node through Rin cannot enter the op-amp input. It must continue through Rf.

(Vin − V−) / Rin = (V− − Vout) / Rf

For this grounded-reference configuration, V− ≈ 0 V. Substituting that condition gives:

Vin / Rin = −Vout / RfVout / Vin = −Rf / Rin

The negative sign follows directly from the voltage direction across Rf. It is not an optional label added after the calculation.

What is virtual ground?

In the inverting configuration above, V+ is connected to ground. Negative feedback then makes V− approximately 0 V, so V− is often called a virtual ground.

It is not an actual ground node. V− has no physical ground connection and cannot act as an unrestricted current source or sink. It is a voltage relationship that depends on the feedback loop being stable and the op-amp staying in its linear operating range.

Non-inverting amplifier

In a non-inverting amplifier, Vin connects directly to V+. A divider made from Rf and Rg sends a fraction of Vout back to V−. The output therefore has the same polarity as the input.

Op-amp feedback schematicA non-inverting amplifier with resistor feedback, input, and ideal output labels.Rin 10 kΩRf 40 kΩ+Vin0.2 VGain 5 V/VVout 1 VV+ reference / groundRf 40 kΩRg 10 kΩ+Vin0.2 VGain 5 V/VVout 1 V

Vin enters only V+. Rf returns Vout to V−, while Rg connects V− to the reference node; the two inputs are not electrically connected.

Av = Vout / Vin = 1 + Rf / RgVout = Av × Vin

With Vin = 0.2 V, Rg = 10 kΩ, and Rf = 40 kΩ, the gain is 5 V/V and the ideal output is 1 V.

Why the non-inverting formula works

The Rf/Rg network is a voltage divider from Vout to the reference node. At V−, it produces:

V− = Vout × Rg / (Rf + Rg)

Under stable negative feedback and linear operation, the ideal condition is V− ≈ V+ = Vin. Substitute Vin for V− and solve for gain:

Vin = Vout × Rg / (Rf + Rg)Vout / Vin = (Rf + Rg) / RgAv = 1 + Rf / Rg

Why this gain cannot be below 1

For this basic non-inverting configuration, Rg is greater than 0 and Rf is non-negative. Therefore 1 + Rf / Rg is at least 1. A voltage follower is the limiting case where feedback connects directly from output to V− and the closed-loop gain is approximately 1; it is not a separate gain below one.

Inverting vs. non-inverting

Ideal closed-loop behavior for the two basic op-amp configurations
CharacteristicInvertingNon-inverting
Input connectionV− through RinV+
Gain−Rf / Rin1 + Rf / Rg
PolarityInvertedNon-inverted
Ideal input behaviorDefined by RinVery high input impedance

Both circuits rely on negative feedback. Their different resistor connections determine whether the signal goes to V− or V+, and therefore whether the output reverses polarity.

Ideal output vs. real output

The calculator reports an ideal output voltage. A real op-amp cannot generate any voltage the formula requests. If the ideal calculation gives Vout = 20 V but the device has limited supply rails, it cannot simply produce 20 V.

Actual behavior also depends on output swing under load, input common-mode range, gain-bandwidth product, slew rate, input offset voltage, input bias current, and stability. These limits vary by device and circuit conditions, so verify the relevant datasheet specifications before treating an ideal result as achievable.

Common mistakes

  • Treating V+ ≈ V− as a physical short.
  • Assuming current flows between the two op-amp inputs.
  • Forgetting the minus sign in the inverting gain formula.
  • Confusing Rin with Rf, or Rg with Rf.
  • Using an ideal output without checking supply rails and output swing.
  • Assuming negative feedback always keeps an op-amp in linear operation.
  • Using an amplifier formula for a comparator, which intentionally operates without linear negative feedback.

Calculate → Understand → Apply

Try it yourself

Switch between Inverting and Non-inverting, change Vin and the feedback resistor, then observe gain, output polarity, and the schematic. Compare the ideal result with the supply and device limits your real circuit needs.

Open the Op-Amp Gain Calculator