The Standard Gain of Differential Amplifier Formula
When you need to measure the voltage difference between two nodes while rejecting any voltage common to both, you use a differential amplifier. Assuming a perfectly balanced resistor network, the direct answer for the output voltage is:
Vout = (R2 / R1) × (V2 - V1)
In this configuration, the differential gain (Ad) is simply the ratio of the feedback resistor to the input resistor: Ad = R2 / R1. Below is the complete spec-sheet definition for every symbol in the equation.
| Symbol | Parameter Name | Standard Unit | Circuit Location |
|---|---|---|---|
| Vout | Output Voltage | Volts (V) | Op-amp output pin |
| V1 | Inverting Input Voltage | Volts (V) | Applied to R1 (inverting side) |
| V2 | Non-Inverting Input Voltage | Volts (V) | Applied to R4 (non-inverting side) |
| R1 | Inverting Input Resistor | Ohms (Ω) | Between V1 and inverting input |
| R2 | Feedback Resistor | Ohms (Ω) | Between output and inverting input |
| R3 | Non-Inverting Ground Resistor | Ohms (Ω) | Between non-inverting input and GND |
| R4 | Non-Inverting Input Resistor | Ohms (Ω) | Between V2 and non-inverting input |
When the Formula Applies and Its Assumptions
This simplified formula only holds true under two strict conditions. First, the operational amplifier must be treated as ideal (infinite open-loop gain, infinite input impedance, and zero output impedance). Second, and most critically for bench work, the resistor network must be perfectly balanced. This means R1 must exactly equal R3, and R2 must exactly equal R4. If your resistors are mismatched, the circuit will amplify the common-mode voltage (the average of V1 and V2), introducing errors that this basic formula cannot predict. For a deeper look at the unbalanced equations, refer to the All About Circuits semiconductor guide.
Rearranged Forms for Component Selection
On the workbench, you rarely just calculate Vout. Usually, you know your target output swing and your input signal, and you need to pick resistors. Here are the algebraically rearranged forms solving for each variable, assuming the balanced condition (R1=R3, R2=R4):
- Solving for Feedback Resistor (R2): R2 = (Vout × R1) / (V2 - V1)
- Solving for Input Resistor (R1): R1 = (R2 × (V2 - V1)) / Vout
- Solving for Non-Inverting Input (V2): V2 = ((Vout × R1) / R2) + V1
- Solving for Inverting Input (V1): V1 = V2 - ((Vout × R1) / R2)
Worked Examples with Unit Tracking
Let’s move from theory to the bench. Here are two solved problems demonstrating how to track units through the gain of differential amplifier formula to prevent scaling errors.
Problem 1: Calculating Output Voltage from a Sensor Bridge
Scenario: You have a balanced differential amplifier with R1 = R3 = 10 kΩ and R2 = R4 = 100 kΩ. The inputs from a Wheatstone bridge are V1 = 2.50 V and V2 = 2.65 V. Find Vout.
- Identify the formula: Vout = (R2 / R1) × (V2 - V1)
- Substitute values with units: Vout = (100 kΩ / 10 kΩ) × (2.65 V - 2.50 V)
- Calculate the gain (unitless): 100 kΩ / 10 kΩ = 10 (The ‘k’ prefixes cancel out, leaving a dimensionless ratio of 10 V/V).
- Calculate the differential input voltage: 2.65 V - 2.50 V = 0.15 V
- Multiply to find Vout: 10 × 0.15 V = 1.50 V
Problem 2: Sizing Resistors for a Shunt Current Sensor
Scenario: You are measuring a 15 A DC motor current using a 5 mΩ shunt resistor. You want to feed this signal into an ESP32 ADC (max 3.3 V). You set R1 = R3 = 1 kΩ. What value do you need for R2 and R4?
- Find the maximum differential input voltage (V2 - V1): Using Ohm’s Law (V = I × R), Vdiff = 15 A × 0.005 Ω = 0.075 V (or 75 mV).
- Identify target Vout: 3.3 V (to maximize ESP32 ADC resolution without clipping).
- Select the rearranged formula: R2 = (Vout × R1) / (V2 - V1)
- Substitute values with units: R2 = (3.3 V × 1,000 Ω) / 0.075 V
- Cancel Volts and solve: R2 = 3,300 Ω / 0.075 = 44,000 Ω (or 44 kΩ)
- Bench Reality Check: 44 kΩ is not a standard E24 resistor value. You would use a 43 kΩ and 1 kΩ resistor in series, or select the nearest E96 value (44.2 kΩ) and calibrate the offset in your ESP32 firmware.
Realistic Magnitudes and Unit Mistakes That Break the Math
When designing discrete differential amplifiers with standard op-amps like the LM358 or OPA2134, you must understand the physical limits of the circuit.
What a Realistic Answer Magnitude Looks Like
In discrete designs, a realistic differential gain magnitude is between 1 and 50. If your formula spits out a required gain of 500, stop and rethink the architecture. Pushing a discrete op-amp to high gains destroys its Common-Mode Rejection Ratio (CMRR) and amplifies input offset voltage and thermal noise. If you need a gain of 100 or higher to read a tiny shunt voltage, abandon the discrete four-resistor network and use a dedicated instrumentation amplifier IC like the Texas Instruments INA128 or INA333. For a comprehensive breakdown of op-amp limitations at high gains, consult the Analog Devices MT-042 Tutorial.
Unit Mistakes That Break the Formula
The most common way hobbyists break this math is through unit mismatch during substitution.
- The kΩ vs Ω Trap: If R2 is 100 kΩ and R1 is 500 Ω, plugging in ‘100’ and ‘500’ yields a gain of 0.2. The correct math requires converting both to base Ohms (100,000 / 500 = 200) or both to kilo-Ohms (100 / 0.5 = 200).
- The mV vs V Trap: If your shunt outputs 50 mV and you want a 5 V output, your required gain is 100. If you accidentally plug ‘50’ into the formula as Volts, your calculated resistor ratio will be off by a factor of 1,000, likely resulting in a dead short or a fried feedback resistor.
Frequently Asked Questions
How does resistor mismatch affect the gain of a differential amplifier formula?
The standard formula assumes R1=R3 and R2=R4. If you use standard 1% tolerance resistors, the ratio between the inverting and non-inverting sides will drift. This mismatch introduces a ‘common-mode gain’, meaning the amplifier will start amplifying the background noise or ground offsets present on both inputs, rather than just the difference. A 1% mismatch typically limits your CMRR to roughly 40 dB. For precision DC measurements, you must use 0.1% tolerance resistors (which yields ~60 dB CMRR) or a laser-trimmed monolithic difference amplifier.
What is the common-mode gain in a differential amplifier formula?
In the ideal formula, common-mode gain (Acm) is exactly zero; the circuit completely ignores voltages that are identical on both V1 and V2. In reality, Acm is a small, non-zero number dictated by resistor mismatch and the op-amp’s internal limitations. It is calculated as Acm = Ad / 10(CMRR/20). If your differential gain is 10 and your op-amp has a CMRR of 80 dB, your common-mode gain is 0.0001 V/V. While tiny, if your common-mode voltage is 50 V (like in high-side battery monitoring), that 0.0001 gain injects a 5 mV error directly into your output.
Why does my differential amplifier output clip or saturate?
If your formula calculates a Vout of 4.5 V, but your multimeter reads 3.8 V and refuses to go higher, you have hit the op-amp’s output voltage swing limit. Standard op-amps like the LM358 cannot swing their output all the way to the positive supply rail; they typically drop 1.5 V to 2.0 V below VCC. If you are powering the LM358 with a 5 V single supply, your maximum realistic Vout is only about 3.5 V. To fix this, you must either increase the supply voltage (e.g., to 9 V or 12 V) or switch to a true ‘Rail-to-Rail Output’ (RRO) op-amp like the MCP6002 or OPA333, which can swing within millivolts of the supply rails.






