How to calculate op amp gain
For an inverting amplifier, G = −Rf ÷ Rin; for a non-inverting amplifier, G = 1 + Rf ÷ Rg. With Rf = 100 kΩ and 10 kΩ the gain is −10 inverting or 11 non-inverting (20.8 dB). The bandwidth is the op amp’s gain-bandwidth product divided by the noise gain, 1 + Rf ÷ Rin, so an LM358 (0.7 MHz typical) gives about 63.6 kHz in either case.
Op amp gain formula for each circuit
With negative feedback, an op amp drives its output until both inputs sit at the same voltage. The resistors then fix the ratio of output to input. These are the ideal-op-amp results; they hold while the open-loop gain at your frequency is much larger than the noise gain.
Inverting amplifier
G = −Rf ÷ Rin noise gain = 1 + Rf ÷ Rin
- Rin
- input resistor, from the signal to the inverting input (the input resistance)
- Rf
- feedback resistor, from the output to the inverting input
Non-inverting amplifier
G = 1 + Rf ÷ Rg noise gain = G
- Rg
- resistor from the inverting input to ground
Difference amplifier (four resistors)
Vout = (V2 − V1) × R2 ÷ R1 CMR = 20 log10[(1 + R2/R1) ÷ Kr]
- R1, R3
- input resistors to the inverting and non-inverting inputs (R3 = R1)
- R2, R4
- feedback resistor and the resistor from the non-inverting input to ground (R4 = R2)
- Kr
- net fractional mismatch of R2/R1 against R4/R3
With four discrete resistors of tolerance t, the worst-case mismatch is Kr = 4t. V1 sees an input resistance of R1; V2 sees R3 + R4.
Inverting summing amplifier
Vout = −Rf × (V1/R1 + V2/R2 + V3/R3) noise gain = 1 + Rf ÷ (R1 ∥ R2 ∥ R3)
Bandwidth
f−3dB = GBW ÷ noise gain
- GBW
- gain-bandwidth product (unity-gain bandwidth) of a voltage-feedback op amp
Op amp gain calculation examples
Example 1: a ×11 non-inverting stage on an LM358
Rf = 100 kΩ and Rg = 10 kΩ give G = 1 + 100 ÷ 10 = 11 (20.8 dB), so 0.2 V in becomes 2.2 V. The noise gain is also 11, and with the LM358’s 0.7 MHz typical GBW the closed-loop bandwidth is 0.7 MHz ÷ 11 = 63.6 kHz.
Example 2: Rf for an inverting gain of −4.7
With Rin = 10 kΩ, Rf = 4.7 × 10 kΩ = 47 kΩ, which is not an E96 value. The nearest E96 resistor is 47.5 kΩ, giving G = −4.75, 1.06% high. The noise gain is 1 + 4.75 = 5.75, so the same LM358 reaches 122 kHz.
Example 3: a ×20 difference amplifier on a current-sense shunt
R1 = R3 = 1 kΩ and R2 = R4 = 20 kΩ turn a 50 mV shunt drop into 1 V. The common-mode rejection is set by the resistors: worst case 54.4 dB with 1% parts and 74.4 dB with 0.1% parts. On a high-side shunt the inputs sit near the supply, so the input divider R3/R4 must bring them inside the op amp’s common-mode range.
Op amp resistor values for standard gains (E96)
Rf for common gains with Rg (non-inverting) or Rin (inverting) fixed at 10 kΩ, rounded to the nearest E96 value, and the gain it actually gives. For any other gain, the calculator solves for Rf.
| Gain | Non-inverting Rf | Actual gain | Inverting Rf | Actual gain |
|---|
| 2 | 10 kΩ | 2 | 20 kΩ | −2 |
| 3 | 20 kΩ | 3 | 30.1 kΩ | −3.01 |
| 5 | 40.2 kΩ | 5.02 | 49.9 kΩ | −4.99 |
| 10 | 90.9 kΩ | 10.09 | 100 kΩ | −10 |
| 20 | 191 kΩ | 20.1 | 200 kΩ | −20 |
| 50 | 487 kΩ | 49.7 | 499 kΩ | −49.9 |
| 100 | 1 MΩ | 101 | 1 MΩ | −100 |
Noise gain and bandwidth by gain
Closed-loop −3 dB bandwidth for an op amp with a 1 MHz gain-bandwidth product. Scale the bandwidth columns by your op amp’s GBW ÷ 1 MHz.
| |Gain| | Non-inverting noise gain | Bandwidth | Inverting noise gain | Bandwidth |
|---|
| 1 | 1 | 1 MHz (follower) | 2 | 500 kHz |
| 2 | 2 | 500 kHz | 3 | 333 kHz |
| 5 | 5 | 200 kHz | 6 | 167 kHz |
| 10 | 10 | 100 kHz | 11 | 90.9 kHz |
| 20 | 20 | 50 kHz | 21 | 47.6 kHz |
| 50 | 50 | 20 kHz | 51 | 19.6 kHz |
| 100 | 100 | 10 kHz | 101 | 9.9 kHz |
What the ideal formulas leave out
The gain formulas assume infinite open-loop gain. In practice the closed-loop gain is the ideal gain divided by (1 + noise gain ÷ open-loop gain), so at frequencies where the open-loop gain has fallen toward the noise gain the gain drops and the phase shifts; keep the signal well below the closed-loop bandwidth if the gain must be accurate. Large output swings are also limited by slew rate, not just bandwidth. A summing amplifier of three equal 10 kΩ inputs and a 10 kΩ feedback resistor turns 0.5 V, 0.3 V and −0.2 V into -600 mV, but each extra input raises the noise gain (to 4 here) and cuts the bandwidth. Capacitance at the inverting input, including the op amp’s own few pF, makes the noise gain rise at high frequency and eats into the phase margin: with large feedback resistors a small capacitor across Rf keeps the stage stable. Finally, the output cannot swing past the rails, and most op amps stop well short of them, so enter your supplies to see the usable input range.
Glossary
- Signal gain
- Vout ÷ Vin for the signal you apply: −Rf/Rin inverting, 1 + Rf/Rg non-inverting.
- Noise gain
- 1 + Rf ÷ (everything from the inverting input to a source or ground). It sets bandwidth, offset at the output and stability.
- Gain-bandwidth product (GBW)
- For a voltage-feedback op amp, the frequency where the open-loop gain falls to 1. Closed-loop bandwidth is GBW ÷ noise gain.
- Virtual ground
- In an inverting stage with the non-inverting input grounded, feedback holds the inverting input at 0 V, so each input resistor sees ground at its far end.
- Common-mode rejection (CMR)
- How strongly a differential stage ignores a voltage common to both inputs, in dB.
- Rail-to-rail output
- An output stage that swings to within tens of millivolts of each supply rail.
Frequently asked questions
What is the op amp gain equation?
Inverting amplifier: G = −Rf / Rin. Non-inverting amplifier: G = 1 + Rf / Rg, where Rg runs from the inverting input to ground. Both assume an ideal op amp, which is accurate when the open-loop gain at your signal frequency is much larger than the noise gain.
How do you calculate the gain of an inverting amplifier?
Divide the feedback resistor by the input resistor and make it negative: G = −Rf / Rin. With Rin = 10 kΩ, the E96 value 47.5 kΩ gives −4.75. The calculator above also solves for Rf from a target gain.
What is the non-inverting amplifier gain formula?
G = 1 + Rf / Rg, with Rg from the inverting input to ground. Rf = 100 kΩ and Rg = 10 kΩ give 11 (20.8 dB), and the noise gain equals the signal gain, so the bandwidth is GBW ÷ G.
What is the summing amplifier formula?
Vout = −Rf × (V1/R1 + V2/R2 + V3/R3). Three equal 10 kΩ inputs with a 10 kΩ feedback resistor turn 0.5 V, 0.3 V and −0.2 V into -600 mV, and the noise gain rises to 4.
What gain do 100 kΩ and 10 kΩ give?
As a non-inverting amplifier, 1 + 100 kΩ / 10 kΩ = 11 (20.8 dB). As an inverting amplifier, −100 kΩ / 10 kΩ = −10 (20.0 dB), with a 10 kΩ input resistance.
Why does an inverting amplifier have less bandwidth than a non-inverting one of the same gain?
Bandwidth is set by the noise gain, 1 + Rf / Rin, not the signal gain. An inverting gain of −1 has a noise gain of 2, so on a 1 MHz GBW op amp it reaches 500 kHz, while a follower reaches the full 1 MHz.
How do I choose the resistor values?
The ratio sets the gain; the absolute value is a trade-off. Values from about 1 kΩ to 100 kΩ suit most op amps: much lower and the feedback network loads the output, much higher and bias current, leakage and stray capacitance across Rf start to matter. Use 1% (E96) resistors when the gain needs to be within a couple of percent.
What is noise gain?
The gain the op amp applies to its own input offset and noise voltage, 1 + Rf divided by everything connected from the inverting input to a source or ground. It sets the closed-loop bandwidth (GBW ÷ noise gain) and the stability margin, so it is the number to use with the gain-bandwidth product.
How well do difference amplifier resistors need to match?
Resistor matching, not the op amp, sets the common-mode rejection. With four 1% resistors at unity gain the worst case is only 34 dB; 0.1% parts give 54 dB. For more, use a matched resistor network or an instrumentation amplifier.
Can an op amp gain be less than 1?
An inverting amplifier can: make Rf smaller than Rin (Rf = 10 kΩ with Rin = 22 kΩ gives −0.45). A non-inverting amplifier cannot go below 1, so attenuate with a divider first and buffer it with a follower.
Can the output swing all the way to the supply rails?
Only with a rail-to-rail output op amp, and even then it stops tens of millivolts short under load. A TL072 on ±15 V swings to ±13.5 V typical (±12 V minimum) into 10 kΩ. Enter the supplies in the op amp calculator to see the input range that keeps the output inside them.
More free PCB tools
See all free electronics tools →
- RC high pass filter calculatorCutoff frequency of an RC high-pass filter, or R or C for a cutoff, with the Bode plot and standard values.
- RLC circuit calculatorResonant frequency, Q, bandwidth and damping of series or parallel RLC circuits, with the impedance curve.
- Sallen-Key filter calculatorComponent values for a unity-gain Sallen-Key low-pass or high-pass filter with Butterworth, Bessel or Chebyshev response.
- RC filter calculator (low pass)Cutoff frequency of an RC low-pass filter, or R or C for a cutoff, with the Bode plot and standard part values.
- Online KiCad design checkerUpload a KiCad project to run KiCad 10 DRC, ERC and schematic parity, plus JLCPCB or PCBWay rules. Every finding links to its fix.
- AI circuit diagram makerDescribe a circuit in plain English and get a clean schematic with standard symbols and a checked netlist. Export SVG, PNG, PDF, KiCad or SPICE.
Design the whole board, not one number
ProtoFlow is free AI PCB design software: describe a circuit and get a schematic with real parts, PCB layout with an autorouter, SPICE simulation and Gerber files. Native KiCad, Altium and EAGLE import and export. Free on macOS, Windows and Linux.