Differential Amplifier Calculator (Op-Amp Subtractor)

A differential amplifier amplifies the difference between two voltages while rejecting what they have in common — the classic four-resistor op-amp subtractor. This differential amplifier calculator gives the output voltage, differential gain and common-mode gain for any resistor values, so you can see how resistor mismatch spoils the CMRR described in differential amplifier basics and CMRR.

calculated
calculated
calculated
Type in any field to change it. Press × on a value to calculate that field instead.

How to use the differential amplifier calculator

Enter the two input voltages and the four resistors. R₁ and R₂ set the inverting gain; R₃ and R₄ form the divider on the non-inverting input. The calculator returns the output, the differential gain and the common-mode gain — try changing R₄ by 1% to see how mismatch creates common-mode error.

Differential amplifier formula

Vout = V₂ · R₄/(R₃ + R₄) · (1 + R₂/R₁) − V₁ · R₂/R₁

Matched (R₁ = R₃, R₂ = R₄): Vout = (R₂/R₁)(V₂ − V₁)

Writing Vout = Ad(V₂ − V₁) + Acm(V₁ + V₂)/2 separates the wanted differential gain from the unwanted common-mode gain.

Worked example

V₁ = 1 V, V₂ = 1.2 V, R₁ = R₃ = 10 kΩ, R₂ = R₄ = 100 kΩ:

  • Vout = 1.2 × (100/110) × 11 − 1 × 10 = 2.00 V
  • Differential gain = 10, common-mode gain = 0

Worst-case CMRR from resistor tolerance

Gain 5% 1% 0.1% 0.01%
1 20 dB 34 dB 54 dB 74 dB
10 35 dB 49 dB 69 dB 89 dB
100 54 dB 68 dB 88 dB 108 dB

Values from CMRR ≈ (1 + G)/(4t); the op-amp’s own CMRR sets a further limit.

Notes

  • The input impedance is R₁ at the V₁ input and R₃ + R₄ at the V₂ input — drive it from low-impedance sources.
  • For a reference offset, connect the bottom of R₄ to a reference voltage instead of ground; it adds directly to the output.

Frequently asked questions

What is the differential amplifier formula?

In general Vout = V₂·R₄/(R₃+R₄)·(1 + R₂/R₁) − V₁·R₂/R₁. With R₁ = R₃ and R₂ = R₄ it reduces to Vout = (R₂/R₁)(V₂ − V₁).

What is common-mode gain?

The gain for a voltage applied equally to both inputs. It is zero when R₂/R₁ = R₄/R₃ exactly; any resistor mismatch lets some common-mode voltage through.

How does resistor tolerance affect CMRR?

Worst-case CMRR ≈ (1 + G) ÷ (4t), where t is the resistor tolerance. With 1% resistors and a gain of 1 that is only about 34 dB, so precision work uses 0.1% or matched networks.

When should I use an instrumentation amplifier instead?

When the sources have high or unequal impedance (bridges, thermocouples) — the four-resistor circuit loads the inputs with R₁ and R₃+R₄, unlike an in-amp's buffered inputs.

Embed this calculator

Free to use on your website or blog. Copy this code: