Op-amp gain: the inverting and non-inverting amplifier
An op-amp on its own has a gain of a hundred thousand or more, which is useless by itself. Two resistors tame it: feed a fraction of the output back to the inverting input and the stage settles at a gain set only by their ratio, −Rf / Rin for the inverting amplifier and 1 + Rf / Rin for the non-inverting one. This calculator gives the gain in V/V and dB, the output for your input, where the supply rails clip it, how far up in frequency the gain holds, and the Rf to use for a gain you want.
How to use the op-amp gain calculator
- Pick the configuration, inverting or non-inverting, with the switch; the drawing rewires itself.
- Type the input voltage (a DC level or a signal's peak; 10m for 10 mV) and Rin and Rf as 10k, 4k7 or 100k.
- Optional: the supply rails show where the output clips (a blank V− means a single supply), the gain-bandwidth product from the data sheet gives the −3 dB frequency, and a target gain finds the Rf for your Rin with the nearest E24 value, one click to use it.
- Hover a part for its figures and click Rin, Rf or the op-amp for its own calculation; the Gain table lists what standard Rf values give; the scope on the right shows the input and the output, flipped when inverting and flattened when clipped.
The virtual short: why two resistors set the gain
With negative feedback the op-amp does one thing: it drives its output to whatever makes its two inputs equal. Because its open-loop gain is enormous, the difference it needs is microvolts, so for every calculation the − input is at the same voltage as the + input (the "virtual short"), and because the inputs draw almost no current, every milliamp that enters the − node through Rin must leave through Rf. Ohm's law on those two resistors is the whole analysis.
Inverting amplifier
A = −Rf / Rin Vout = −Vin × Rf / Rin
The + input is grounded, so the − node is a virtual ground. Vin pushes a current Vin / Rin into that node; the output pulls the same current through Rf by going to −I × Rf. The gain is the plain ratio, with a sign flip, and it can be below 1 (an attenuator) or far above. The source sees Rin to ground, so Rin is the input impedance: 10 kΩ or more for most sources.
Non-inverting amplifier
A = 1 + Rf / Rin Vout = Vin × (1 + Rf / Rin)
Vin goes straight to the + input, so the − node sits at Vin. Rin from that node to ground carries Vin / Rin, Rf carries the same current, and the output is Vin plus the drop across Rf. The gain is always at least 1 (with Rf = 0 it is the unity-gain buffer), the sign is kept, and the source sees only the op-amp's input, typically megohms to teraohms. That is why it is the usual choice after a high-impedance sensor.
Choosing the resistor values
Only the ratio sets the gain; the absolute values are a compromise. Too low (under 1 kΩ) and the output has to drive a lot of current through the feedback network; too high (over 1 MΩ) and the op-amp's bias current creates an offset, thermal noise rises, and a few picofarads across Rf roll the gain off at audio frequencies. 1 kΩ to 100 kΩ is the comfortable range. Use 1% metal-film parts for a gain you can trust, and remember that a gain of 100 also multiplies the op-amp's offset voltage by 100.
| Gain | Inverting (Rin, Rf) | Non-inverting (Rin, Rf) |
|---|---|---|
| ×2 | 10 kΩ, 20 kΩ | 10 kΩ, 10 kΩ |
| ×5 | 10 kΩ, 51 kΩ (×5.1) | 10 kΩ, 39 kΩ (×4.9) |
| ×10 | 10 kΩ, 100 kΩ | 10 kΩ, 91 kΩ (×10.1) |
| ×11 | 10 kΩ, 110 kΩ | 10 kΩ, 100 kΩ |
| ×100 | 1 kΩ, 100 kΩ | 1 kΩ, 100 kΩ (×101) |
Supply rails and bandwidth
f−3dB = GBW / (1 + Rf / Rin)
The output cannot leave the supply rails, and an ordinary op-amp stops 1–2 V short of each; a rail-to-rail type gets within tens of millivolts. With a gain of 10 on a single 5 V supply, inputs above about 0.5 V clip, and an inverting stage cannot make the negative output it wants at all. The gain-bandwidth product on the data sheet (1 MHz for an LM358, 3 MHz for a TL072, 10 MHz and up for fast parts) divided by the noise gain 1 + Rf / Rin is roughly where the closed-loop gain starts to fall: a ×100 stage on a 1 MHz op-amp is good to only 10 kHz.
Your stage, step by step
- Gain: −100 kΩ / 10 kΩ = −10 (20.0 dB).
- Current: 500 mV / 10 kΩ = 50 µA through both resistors; Rf drops 5 V.
- Output: −10 × 500 mV = −5 V, inside the rails.
Worked example: inverting ×10 with 10 kΩ and 100 kΩ
An inverting stage with Rin = 10 kΩ and Rf = 100 kΩ has a gain of −100 k / 10 k = −10, or 20.0 dB. With 0.5 V at the input the current into the virtual ground is 0.5 V / 10 kΩ = 50 µA; that current through 100 kΩ needs 5 V, so the output goes to −5 V. On ±15 V supplies there is plenty of room: inputs up to about 1.5 V stay clean (a little less for a non-rail-to-rail part). The resistors dissipate microwatts.
Questions
Why is the inverting gain −Rf/Rin but the non-inverting 1 + Rf/Rin?
Same current, different reference. In the inverting stage the − node sits at 0 V, so the output is just the drop across Rf, negative. In the non-inverting stage the node sits at Vin, so the output is Vin plus that drop: the "1 +" is Vin itself.
Can I get a gain of 0.5?
With an inverting stage, yes: Rf half of Rin gives −0.5. A non-inverting stage cannot go below 1; put a voltage divider in front of a buffer instead.
Which op-amp for a single 5 V or 3.3 V supply?
A rail-to-rail input and output part such as the MCP6002, TLV2372 or OPA2340. Classic 741 and TL072 types need ±9 V or more and cannot reach their rails. Bias the + input to half the supply for AC signals.
Does the gain depend on the op-amp?
Not at DC and low frequencies, as long as the open-loop gain is much larger than Rf/Rin, which it is for any gain under a few hundred. The op-amp sets the bandwidth, the offset, the noise and the output swing.