If you are wondering how to calculate gain of an op amp, the direct answer is that closed-loop voltage gain is determined almost entirely by your external feedback resistor network. For a standard non-inverting configuration, the gain is Av = 1 + (Rf / Rin). For an inverting configuration, it is Av = -(Rf / Rin). The op amp's internal open-loop gain is so massive (often >100,000 V/V) that it effectively forces the circuit to obey these external resistor ratios, provided you stay within the silicon's voltage and current limits.
Below, we break down the exact formulas, derive them from first principles, and walk through bench-tested scenarios where the math meets physical silicon limitations.
The Core Gain Formulas and Symbol Definitions
Operational amplifiers are rarely used in open-loop mode for linear amplification because their internal gain is too high and unstable. Instead, we use negative feedback to set a precise, predictable closed-loop gain. Here are the two foundational equations you will use on the bench.
| Symbol | Parameter | Standard Unit | Typical Bench Range | Notes |
|---|---|---|---|---|
Av |
Closed-Loop Voltage Gain | V/V (or dB) | 1 to 100 (Audio), up to 1000 (DC Sensors) | Dimensionless ratio. Often converted to dB via 20 * log10(Av). |
Vout |
Output Voltage | Volts (V) | -12V to +12V (Dual), 0V to 5V (Single) | Cannot exceed the supply rails (minus headroom losses). |
Vin |
Input Voltage | Volts (V) | mV to low V | Must stay within the op amp's common-mode input range. |
Rf |
Feedback Resistor | Ohms (Ω) | 1kΩ to 100kΩ | Connects output to the inverting input. Keep <100kΩ to minimize thermal noise. |
Rin |
Input/Ground Resistor | Ohms (Ω) | 1kΩ to 100kΩ | Connects the inverting input to ground (non-inverting) or signal source (inverting). |
Deriving the Non-Inverting Gain from First Principles
To truly understand how to calculate gain of an op amp, you need to know where the formula comes from. We derive the non-inverting gain using two ideal op amp assumptions:
- Infinite Input Impedance: No current flows into the inverting (-) or non-inverting (+) input pins.
- Virtual Short: Because the open-loop gain is practically infinite, negative feedback forces the voltage at the inverting pin to exactly match the non-inverting pin (
V- = V+).
Step-by-step derivation:
- Apply the input signal to the non-inverting pin:
V+ = Vin. - By the virtual short rule, the inverting pin is also at
Vin:V- = Vin. - The resistors
RfandRinform a voltage divider betweenVoutand Ground. The voltage at the midpoint (which isV-) is calculated as:V- = Vout * [ Rin / (Rin + Rf) ] - Substitute
VinforV-:Vin = Vout * [ Rin / (Rin + Rf) ] - Rearrange to solve for the gain ratio (
Vout / Vin):Vout / Vin = (Rin + Rf) / Rin - Split the fraction to get the final standard form:
Av = 1 + (Rf / Rin)
Rearranged Forms: Solving for Resistors and Voltages
On the bench, you rarely know all variables upfront. Usually, you have a target gain and a fixed input signal, and you need to select standard E24 resistor values. Here are the rearranged forms for the non-inverting configuration:
- Solve for Feedback Resistor:
Rf = Rin * (Av - 1) - Solve for Input Resistor:
Rin = Rf / (Av - 1) - Solve for Output Voltage:
Vout = Vin * [1 + (Rf / Rin)] - Solve for Input Voltage:
Vin = Vout / [1 + (Rf / Rin)]
Rin first from standard E24 values (e.g., 1kΩ, 2.2kΩ, 10kΩ), then calculate Rf. If the calculated Rf isn't a standard value, use two series resistors or a potentiometer to dial it in.
Solved Problems with Strict Unit Tracking
The most common reason breadboard circuits fail to match theoretical calculations is sloppy unit tracking. Let's walk through two problems, explicitly tracking units to ensure they cancel correctly.
Problem 1: Non-Inverting Sensor Amplifier
Scenario: You have a pressure sensor outputting a maximum of 15 mV. You need to scale this to 3.3 V to feed a 3.3V microcontroller ADC. You have a 1 kΩ resistor for Rin. What value do you need for Rf?
- Calculate Required Gain:
Av = Vout / Vin
Av = 3.3 V / 0.015 V(Converted 15 mV to 0.015 V)
Av = 220 V/V - Apply Rearranged Formula:
Rf = Rin * (Av - 1)
Rf = 1,000 Ω * (220 - 1)
Rf = 1,000 Ω * 219
Rf = 219,000 Ω(or219 kΩ)
Bench Execution: 219 kΩ is not a standard 1% resistor. You can achieve this by placing a 200 kΩ and a 20 kΩ standard resistor in series (220 kΩ total), which yields a gain of 221, resulting in a max output of 3.315 V—well within the ADC's tolerance.
Problem 2: Inverting Audio Stage
Scenario: An inverting amplifier is built with Rf = 47 kΩ and Rin = 10 kΩ. The input signal is 0.5 VRMS. What is the output voltage?
- Calculate Gain (Inverting Formula):
Av = -(Rf / Rin)
Av = -(47 kΩ / 10 kΩ)(The 'k' prefixes cancel out, leaving a dimensionless ratio)
Av = -4.7 - Calculate Output:
Vout = Av * Vin
Vout = -4.7 * 0.5 V
Vout = -2.35 VRMS
The output is an inverted signal with an amplitude of 2.35 VRMS.
Real-World Bench Scenario: When Math Meets Silicon
Formulas assume an 'ideal' op amp. Silicon is not ideal. Here is a real-world scenario demonstrating what happens when you trust the math but ignore the datasheet.
Scenario: Thermocouple Amplification on a Single 5V Supply
- Setup: Amplifying a 0-100 mV thermocouple signal by 50x using a standard LM358 op amp powered by a single 5V supply (VCC = 5V, GND = 0V).
- The Math:
Av = 50. At max input (100 mV), expectedVout = 0.1 V * 50 = 5.0 V. - The Outcome: You measure the output with a multimeter. As the temperature rises, the output climbs to 3.5V and completely flatlines (clips), refusing to go higher even as the input increases.
- What Went Wrong: The LM358 is a legacy bipolar op amp. While it is 'single-supply' and can pull its output down to true 0V, its high-level output voltage (
VOH) cannot reach the positive rail. According to the Texas Instruments application report on basic op-amp circuits, the LM358 output drops at least 1.5V below VCC. On a 5V supply, the absolute maximum output is5V - 1.5V = 3.5V. The math assumed rail-to-rail capability; the silicon hit its headroom limit. - The Fix: Swap the LM358 for a true Rail-to-Rail Output (RRO) op amp like the MCP6002 (costs roughly $0.40 in single quantities), which can swing within 20mV of the 5V rail, or increase the LM358's VCC to 9V to give it enough headroom to output 5V.
Assumptions, Boundaries, and Common Unit Mistakes
To use these gain formulas reliably, you must understand the boundaries of the physical components you are working with.
When the Formula Applies (and When It Doesn't)
The closed-loop gain formulas only apply under three strict conditions:
- Negative Feedback is Present: The output must be routed back to the inverting (-) input. If routed to the non-inverting (+) input, you have built a comparator with positive feedback (a Schmitt trigger), and the linear gain formula is void.
- Linear Region Operation: The calculated
Voutmust not exceed the op amp's supply rails (minus headroom). If the math saysVout = 15Vbut your supply is±5V, the op amp will saturate (clip) at roughly 3.5V to 4V. - Frequency is Below the Gain-Bandwidth Product (GBWP): As documented in Analog Devices Tutorial MT-043, op amp gain rolls off at higher frequencies. If your op amp has a GBWP of 1 MHz, you cannot achieve a gain of 100 at 20 kHz (100 * 20,000 = 2 MHz, which exceeds the 1 MHz limit). The actual gain will be significantly lower than the resistor ratio dictates.
Realistic Answer Magnitudes
If you calculate a closed-loop gain of 50,000 V/V, you have made a mistake. While the open-loop gain of a typical op amp is 100 dB to 120 dB (100,000 to 1,000,000 V/V), closed-loop gains are almost always kept between 1 and 100 for audio and general signal conditioning, and rarely exceed 1,000 even for sensitive DC sensor interfaces. If your math yields a closed-loop gain of 5,000, you should cascade two op amp stages (e.g., two stages of gain = 70) to maintain bandwidth and stability.
Unit Mistakes That Break the Math
- The Ratio Trap: When calculating
Rf / Rin, both resistors must be in the same unit. IfRf = 47 kΩandRin = 100 Ω, the ratio is47,000 / 100 = 470, not47 / 100 = 0.47. Always convert both to base Ohms before dividing if you are unsure. - The Millivolt Multiplier: When calculating
Vout = Av * Vin, the gain (Av) is a dimensionless multiplier. IfAv = 50andVin = 20 mV, the output is50 * 20 mV = 1000 mV(or 1 V). A common bench mistake is treating 'm' as a variable rather than a prefix, resulting in wildly incorrect voltage expectations.






