Engineering · Electronics · Electronics
Op-Amp Gain Calculator
Calculates the closed-loop voltage gain of inverting and non-inverting op-amp amplifier configurations using feedback resistor values.
Calculator
Formula
A_v is the closed-loop voltage gain (dimensionless). R_f is the feedback resistor (ohms) connected between the output and the inverting input. R_in is the input resistor (ohms). For the inverting configuration, the negative sign indicates a 180° phase inversion. For the non-inverting configuration, the signal is applied to the non-inverting (+) terminal and gain is always ≥ 1.
Source: Sedra, A. S. & Smith, K. C. — Microelectronic Circuits, 7th Edition, Oxford University Press.
How it works
An operational amplifier (op-amp) is a high-gain differential amplifier IC that, when combined with external resistors, produces a precisely controlled closed-loop gain. The gain is set entirely by the ratio of the feedback resistor R_f to the input resistor R_in, making it largely independent of the op-amp's internal open-loop gain (typically 100,000 or more). This negative feedback principle is what makes op-amp circuits stable, predictable, and widely used in precision analog design.
In the inverting configuration, the input signal is applied through R_in to the inverting (−) terminal, while the non-inverting (+) terminal is grounded. The feedback resistor R_f connects the output back to the inverting terminal. The closed-loop gain is A_v = −R_f / R_in. The negative sign reflects a 180° phase shift between input and output — a positive input voltage produces a negative output swing. In the non-inverting configuration, the signal enters the non-inverting (+) terminal directly, and the feedback network (R_f and R_in) connects from output to the inverting (−) terminal. The gain here is A_v = 1 + R_f / R_in, which is always greater than or equal to unity, and the output is in phase with the input.
These configurations are ubiquitous in real-world electronics: audio pre-amplifiers, instrumentation amplifiers, active filters, analog-to-digital converter front ends, and transducer signal conditioning circuits all rely on precisely calculated op-amp gain stages. Understanding gain also enables engineers to calculate bandwidth trade-offs using the gain-bandwidth product (GBW) specification of the chosen op-amp device.
Worked example
Example 1 — Inverting Amplifier:
Suppose you need an inverting amplifier with a gain magnitude of 10. Choose R_in = 10 kΩ and R_f = 100 kΩ.
A_v = −R_f / R_in = −100 kΩ / 10 kΩ = −10 V/V
In decibels: 20 × log₁₀(|−10|) = 20 × 1 = 20 dB
A 1 V peak input will produce a −10 V peak output, phase-inverted by 180°.
Example 2 — Non-Inverting Amplifier:
For a non-inverting amplifier with a gain of 11, use R_in = 10 kΩ and R_f = 100 kΩ.
A_v = 1 + R_f / R_in = 1 + 100 kΩ / 10 kΩ = 1 + 10 = 11 V/V
In decibels: 20 × log₁₀(11) ≈ 20.83 dB
A 0.5 V peak input produces a 5.5 V peak output, with no phase inversion. Note that identical resistor values produce different gains in the two configurations — this is an important distinction when selecting a topology for your design.
Limitations & notes
This calculator assumes an ideal op-amp with infinite open-loop gain, infinite input impedance, zero output impedance, and infinite bandwidth. In practice, real op-amps have a finite gain-bandwidth product (GBW): as closed-loop gain increases, the usable bandwidth decreases proportionally (f_−3dB ≈ GBW / |A_v|). At very high gains or frequencies, phase margin degrades and stability can become an issue. Additionally, op-amp output voltage is limited to the supply rails (and often a few volts below them for non-rail-to-rail devices), so output clipping must be considered. Input offset voltage and bias currents introduce DC errors that become significant at very high gains. Resistor tolerances directly affect gain accuracy — 1% resistors are recommended for precision applications. The calculator also does not account for input or output loading effects, which can alter effective gain in real circuits.
Frequently asked questions
What is the difference between inverting and non-inverting op-amp configurations?
In the inverting configuration, the input signal is applied to the inverting (−) terminal through R_in, producing a phase-inverted output with gain −R_f/R_in. In the non-inverting configuration, the signal enters the (+) terminal directly, giving an in-phase output with gain 1 + R_f/R_in. The choice depends on whether phase inversion is acceptable and on the required gain range.
Can the gain of a non-inverting op-amp be less than 1?
No — the non-inverting configuration always has a gain of 1 + R_f/R_in, which is ≥ 1. For unity gain (voltage follower/buffer), set R_f = 0 and R_in = open, giving A_v = 1. If attenuation is needed, a voltage divider before the input or an inverting topology with R_f < R_in should be used instead.
How do I convert voltage gain to decibels (dB)?
The decibel gain is calculated as A_dB = 20 × log₁₀(|A_v|). For example, a gain of 10 V/V equals 20 dB, and a gain of 100 V/V equals 40 dB. Note that negative gain (phase inversion in inverting amplifiers) does not affect the dB magnitude — only the absolute value of A_v is used.
Does resistor value affect op-amp gain accuracy?
Yes — since gain is determined purely by the ratio R_f/R_in, both resistor tolerance and temperature coefficient matter. Using 1% tolerance resistors instead of 5% significantly improves gain accuracy. For precision designs, matched resistor pairs or resistor networks with tight tracking specifications are recommended to minimise gain error and drift.
What is the gain-bandwidth product and how does it affect my design?
The gain-bandwidth product (GBW or GBP) is a fixed parameter for a given op-amp, specified in the datasheet. It means that the product of closed-loop gain and usable bandwidth is approximately constant: f_−3dB ≈ GBW / A_v. For example, an op-amp with GBW = 1 MHz set to a gain of 100 will only pass signals up to about 10 kHz. Choosing a higher-GBW op-amp allows higher gains at wider bandwidths.
Last updated: 2025-01-15 · Formula verified against primary sources.