In short: The op-amp difference amplifier uses two resistor pairs to subtract one input from another, and with all four resistors matched its output is simply V_out = (R2/R1)(V2 − V1), which is exactly why it rejects any voltage common to both inputs.
The difference amplifier (often called the subtractor) is the workhorse behind every instrumentation front-end, current-sense circuit and bridge amplifier you will ever design. It takes two node voltages, amplifies their difference, and throws away whatever they share. Understanding exactly how it does this — and where it breaks — is a staple interview question for analog roles, so let us derive it properly and then connect it to the specification engineers actually care about: common-mode rejection.
The topology: one op-amp, four resistors
The classic one-amp subtractor drives the inverting input through R1 from source V1, feeds back through R2, and drives the non-inverting input through R3 from source V2, with R4 going to ground. The two resistor dividers are what make the subtraction work. Below is the arrangement.
Deriving the output with ideal superposition
Because an ideal op-amp is linear, we apply superposition — solve for each source with the other grounded, then add.
V1 acting alone (V2 = 0): With V2 grounded, R3 and R4 simply tie the non-inverting pin to 0 V (no current flows into an ideal input, so no drop across R3). The circuit is a textbook inverting amplifier: Vout1 = −(R2/R1)·V1.
V2 acting alone (V1 = 0): R3 and R4 form a divider, so the + pin sees V+ = V2·R4/(R3+R4). The op-amp runs non-inverting with gain (1 + R2/R1), giving Vout2 = V2·[R4/(R3+R4)]·(1 + R2/R1).
Adding: Vout = V2·[R4/(R3+R4)]·(1+R2/R1) − (R2/R1)·V1.
Matched-resistor case. Set R3 = R1 and R4 = R2. The messy V2 coefficient collapses to exactly R2/R1, leaving the clean result V_out = (R2/R1)·(V2 − V1). A true subtraction scaled by one gain term.
A worked number makes it concrete: with R1 = R3 = 10 kΩ and R2 = R4 = 100 kΩ, the gain is 10. If V1 = 2.00 V and V2 = 2.10 V, then V_out = 10 × (2.10 − 2.00) = 1.00 V. The 2 V sitting under both inputs — the common-mode level — contributes nothing.
Why this is common-mode rejection
Any pair of inputs can be split into a differential part V_d = V2 − V1 and a common-mode part V_cm = (V1 + V2)/2. A perfect subtractor responds only to V_d. The ratio of differential gain to the (ideally zero) common-mode gain is the CMRR, usually quoted in dB.
Here is the engineering reality: the (V2 − V1) cancellation only holds when the ratios match. If instead R4/(R3+R4)·(1+R2/R1) ≠ R2/R1, a fraction of V_cm leaks through. The dominant error in a real build is resistor tolerance.
| Resistor tolerance | Worst-case gain mismatch | Approx. CMRR floor |
|---|---|---|
| 5 % | ~0.20 | ~26 dB |
| 1 % | ~0.04 | ~40 dB |
| 0.1 % | ~0.004 | ~60 dB |
| 0.01 % (matched array) | ~0.0004 | ~80 dB |
Rule of thumb: resistor-limited CMRR ≈ 20·log10[(1 + R2/R1) / (4·tol)]. Four discrete 1 % resistors cap you near 40 dB — which is why laser-trimmed four-resistor networks and monolithic parts exist.
This tolerance ceiling is exactly why precision designs reach for integrated difference amplifiers (e.g. the Analog Devices AD8276 or a dedicated three-op-amp instrumentation amp) whose resistors are trimmed together on one die, delivering 80–100+ dB without hand-matching. In SPICE, a Monte Carlo sweep in Cadence Spectre or Synopsys HSPICE over the resistor distributions will show the CMRR spread immediately — a far more honest check than a single nominal run.
Input impedance and loading — the catch
The one-amp subtractor has a hidden flaw: its two inputs do not present equal, high impedance. The inverting side looks like R1 to a virtual ground; the non-inverting side looks like R3 + R4. Driving it from unequal source resistances degrades the matching and wrecks CMRR. For sensor bridges and transducers you therefore buffer both inputs — which is precisely the motivation for the three-op-amp instrumentation amplifier, a natural next study topic.
Where you will actually use it
- High-side current sensing: amplify the small differential drop across a shunt that sits at, say, 48 V common mode.
- Bridge amplifiers: strain gauges, pressure and load cells produce tiny differential signals on a large excitation offset.
- Level translation: referencing a signal to a new ground with a fixed subtraction.
- Noise rejection: interference coupled equally into both lines appears as common mode and is rejected.
The subtractor is best studied alongside its sibling, the op-amp summing amplifier, which adds inputs instead of subtracting them, and the instrumentation amplifier, which fixes the impedance problem. If you want guided lab exercises and SPICE decks, the analog track on our courses page walks through each build on real silicon models. Teams needing custom analog front-ends can also look at the design services at Avecas VLSI design services.
Ready to master analog front-ends end to end? Join CourseTron's Analog & Mixed-Signal Design course — from op-amp intuition to tape-out-grade instrumentation amplifiers, with live Cadence/Synopsys labs. Explore the curriculum →
Frequently asked questions
Why must all four resistors match for a clean subtraction?
The V2 path gain is [R4/(R3+R4)](1+R2/R1) while the V1 path gain is R2/R1. These two coefficients are only equal when R3=R1 and R4=R2. Any mismatch leaves a residual term proportional to the common-mode voltage, which is the CMRR error.
What limits CMRR in a real difference amplifier?
Below a few kHz it is almost always resistor ratio mismatch, not the op-amp itself. Four 1 % resistors cap CMRR near 40 dB. At higher frequencies the op-amp's own finite CMRR and capacitive imbalance dominate.
Can the gain be less than one?
Yes. With matched pairs the gain is R2/R1, so choosing R2 < R1 attenuates while still subtracting — common when scaling a large differential signal into an ADC range.
Why use an instrumentation amp instead of this circuit?
The one-amp subtractor has unequal, relatively low input impedances, so source-resistance imbalance degrades CMRR. A three-op-amp instrumentation amplifier buffers both inputs to near-infinite impedance and sets gain with a single resistor.