Op-Amp Calculator

Find the gain, output voltage, and bandwidth of an inverting, non-inverting, voltage-follower, summing, or difference op-amp stage, with a live schematic and waveform.

Vin1.00 V+Rin10 kΩRf22 kΩVout-2.20 V

Inverting Amplifier

15.0 V-15.0 V2.20 V-2.20 VInputOutputInverted output vs. input

Input voltage (Vin)

Input resistor (Rin)

Feedback resistor (Rf)

+V supply

−V supply

Gain-bandwidth product (optional)

Output voltage

Vout = -2.20 V

Within the -15.0 V15.0 V supply

Gain & bandwidth

Gain (Av)-2.2 ×
In dB6.85 dB
Noise gain3.2 ×
Bandwidth313 kHz

How the inverting amplifier works

In the inverting configuration, the input signal is applied to the inverting (−) input through the input resistor Rin, the feedback resistor Rf connects the output back to that same node, and the non-inverting (+) input is tied to ground.

To analyze the circuit, we apply the two golden rules of an ideal op-amp with negative feedback: no current flows into either input, and the op-amp adjusts its output until the two inputs are at the same voltage. Since the (+) input is grounded at 0 V, the (−) input must also rest at 0 V. This node is not physically connected to ground, yet it behaves as though it were, so we call it a virtual ground.

With the (−) node held at 0 V, the current flowing through Rin is simply Vin / Rin. None of that current can enter the op-amp, so all of it must flow on through Rf. Working out the voltage that Rf must develop gives us the closed-loop output:

Vout = −(Rf / Rin) · Vin

Notice that the op-amp's own raw gain (its open-loop gain, the amplification of the chip with no feedback) never appears in this result. That gain is huge but imprecise. Negative feedback trades it away so the closed-loop gain depends only on the resistor ratio, which you can set exactly.

Worked example

Let us calculate the output for Vin = 1 V, Rin = 10 kΩ, and Rf = 22 kΩ:

  • Gain: Av = −Rf / Rin = −22 kΩ / 10 kΩ = −2.2 (6.85 dB).
  • Output: Vout = −2.2 × 1 V = −2.2 V.
  • Noise gain: 1 + Rf / Rin = 3.2.
  • Bandwidth: with a 1 MHz GBW op-amp, 1 MHz / 3.2 ≈ 313 kHz.

Because −2.2 V falls comfortably within a ±15 V supply, the output is a clean, inverted copy of the input. If we increase the gain or the input until the ideal output would be, say, −20 V, the op-amp can no longer reach it and the waveform flattens at the −15 V rail. The plot above shows this clipping as it happens.

The non-inverting amplifier

Switching the toggle to non-inverting rearranges the circuit. The signal now drives the (+) input directly, while Rin and Rf form a feedback network from the output back to the (−) input, with Rin returning to ground.

The same golden rules apply. Feedback holds the two inputs at equal voltage, so the (−) node must sit at Vin. Rin and Rf form a voltage divider from Vout, and that divider has to produce Vin at the (−) node. Solving for the output gives:

Vout = (1 + Rf / Rin) · Vin

Here the output stays in phase with the input, and the gain can never be less than 1. Using the same 10 kΩ and 22 kΩ resistors gives a gain of +3.2 (10.1 dB), so a 1 V input now produces +3.2 V.

Two practical differences set this configuration apart from the inverting one. First, the input impedance is enormous, because the signal connects straight to the op-amp's input rather than through a resistor, so it draws almost nothing from the source. Second, the minimum gain is unity, which is exactly the voltage follower. One quantity stays the same in both circuits: the noise gain, 1 + Rf/Rin. Two stages built from the same resistor pair therefore share the same bandwidth even though their signal gains differ.

The voltage follower

Switching the toggle to voltage follower strips the circuit down to its simplest closed-loop form. There are no external resistors at all: the output is wired directly back to the inverting (−) input, and the signal drives the non-inverting (+) input. It is the non-inverting amplifier taken to its limit, with Rf = 0 and Rin = ∞.

Run the golden rules through it once more. Feedback forces the two inputs to the same voltage, and since the (−) input is connected straight to the output, the output must equal the (+) input. The result could not be plainer:

Vout = Vin

A gain of exactly 1 (0 dB) is useful when you think about impedance. The signal connects straight to the (+) input, which has very high impedance, so the source delivers almost no current and is barely loaded. The output, meanwhile, comes from the op-amp's low-impedance driver and can supply real current into the next stage. That is the whole point: the voltage follower takes a fragile, high-impedance signal (i.e: a sensor, the tap of a voltage divider, etc) and reproduces it with a stiff, low-impedance copy that can drive a load without sagging. And because its gain is just 1, the follower keeps the op-amp's full GBW.

The summing amplifier

Switching the toggle to summing turns the inverting amplifier into a mixer. Instead of one input resistor there are now several, and each one carries its own signal into the inverting (−) node. The non-inverting (+) input is still grounded, and a single feedback resistor Rf still connects the output back to the (−) node.

The analysis is the inverting amplifier's, repeated once per input. Feedback holds the (−) node at a virtual ground of 0 V, so the current arriving from the i-th input is simply Vi / Ri. None of these currents can enter the op-amp, so all of them merge at the node and flow on together through Rf. Summing the currents and working out the voltage Rf develops gives:

Vout = −Rf · (V1/R1 + V2/R2 + ⋯ + Vn/Rn)

The virtual ground is what keeps the inputs from interfering with one another. Each input resistor terminates at a node that is always 0 V, so the current one input contributes does not depend on what any other input is doing. You can add channels, remove them, or change one level without disturbing the rest: exactly the behaviour you want from a mixer.

If you make all the input resistors equal to a single value R, the expression collapses to a clean inverted average-by-count:

Vout = −(Rf / R) · (V1 + V2 + ⋯ + Vn)

Summing amplifier worked example

Take three inputs of V1 = 1 V, V2 = 2 V, and V3 = 3 V, each through R = 10 kΩ, with Rf = 10 kΩ:

  • Output: Vout = −(10 kΩ / 10 kΩ) · (1 + 2 + 3) V = −6 V.
  • Weighting: with equal resistors every input is scaled by the same −Rf/R = −1, so the stage adds the inputs and inverts the result.
  • Unequal resistors: halving R1 to 5 kΩ would double the first input's weight to −2, giving Vout = −(2·1 + 2 + 3) = −7 V, while leaving the other two channels untouched.

The noise gain that sets the bandwidth uses the parallel combination of all the input resistors: 1 + Rf / (R1 ∥ R2 ∥ ⋯). More inputs lower that parallel resistance and raise the noise gain, so a mixer with many channels gives up more bandwidth than a single-input inverting stage with the same Rf.

The difference amplifier

Switching the toggle to difference wires both op-amp inputs to a signal. One input, V1, drives the inverting (−) input through R1 with the feedback resistor Rf returning from the output; the other, V2, drives the non-inverting (+) input through R2, which forms a divider with a resistor Rg to ground. The circuit is a bridge of four resistors around the op-amp, and its job is to amplify the difference between the two inputs while ignoring whatever they have in common.

The cleanest way to see this is superposition. With V2 grounded the stage is a plain inverting amplifier, so V1 contributes −(Rf/R1)·V1. With V1 grounded, the R2–Rg divider sets the (+) input voltage and the stage acts as a non-inverting amplifier on it. When the resistors are balanced (R1 = R2 = Rin and Rf = Rg), the two contributions combine into a single clean expression:

Vout = (Rf / Rin) · (V2 − V1)

The output is the amplified difference of the two inputs, with a gain of Rf/Rin and no minus sign out front. The calculator assumes this balanced case, so a single input-resistor value and a single feedback-resistor value set both sides of the bridge.

The payoff of balancing the resistors is common-mode rejection. Any voltage that appears on both inputs at once (a shared ground offset, picked-up noise, the bias on a sensor) sits in the V2 − V1 term as zero and never reaches the output. Set V1 equal to V2 in the calculator and the output waveform collapses to a flat line, however large that common level is. This is why the difference amplifier is the front end of choice for current-sense measurements and bridge sensors, where a small signal of interest rides on a much larger shared voltage. In a real circuit the rejection is limited by how well the resistor ratios match: a fraction of a percent mismatch is enough to let some of the common-mode signal leak through, which is why precision difference amplifiers use trimmed, ratio-matched resistor networks.

Design notes

  • Only the ratio sets the gain. Rin = 10 kΩ with Rf = 4.7 kΩ gives the same gain as 100 kΩ with 47 kΩ. Choose the absolute values to balance source loading against noise and bias-current error.
  • The inverting input impedance equals Rin. Unlike the non-inverting configuration, the inverting amplifier loads the source with Rin. Keep this in mind when driving the stage from a high-impedance sensor.
  • Add a bias-compensation resistor equal to Rin ∥ Rf in series with the (+) input. It cancels the offset voltage produced by input bias current, which matters most when the resistors are large.
  • Watch the supply rails. The output can only swing within the supply, and for AC signals it is the peak, not the average, that clips. Real op-amps fall short of the rails unless they are rail-to-rail types.

FAQ

What is the gain formula for an inverting op-amp?

The closed-loop voltage gain of an inverting amplifier is Av = −Rf / Rin, where Rin is the input resistor and Rf is the feedback resistor. The negative sign tells us the output is inverted with respect to the input: a positive input produces a negative output. The magnitude of the gain is set entirely by the ratio of the two resistors, so a 22 kΩ feedback resistor with a 10 kΩ input resistor gives a gain of −2.2.

Why does the inverting amp invert the signal?

Because the non-inverting (+) input is grounded, negative feedback works to hold the inverting (−) input at the same potential, 0 V. We call this point a virtual ground: it acts like ground without being connected to it. Any current the source drives into Rin must continue through Rf, since essentially no current flows into the op-amp's input. To sink that current, the output has to swing in the opposite direction to the input, which produces the 180-degree phase inversion.

What sets the bandwidth of the amplifier?

The closed-loop bandwidth equals the op-amp's gain-bandwidth product (GBW) divided by the noise gain, where noise gain is 1 + Rf/Rin. For an inverting stage the noise gain is one greater than the signal-gain magnitude. As an example, a 741 with a 1 MHz GBW configured for a gain of −2.2 has a noise gain of 3.2 and therefore a bandwidth of roughly 313 kHz. Higher gain always comes at the cost of bandwidth.

Why is the output clipping?

A real op-amp can only drive its output as far as its supply rails, and most devices stop a volt or two short of them. When the product of gain and input voltage demands a level beyond the rail, the output cannot follow and instead flattens, or clips, at the rail. To prevent clipping, reduce the gain, reduce the input amplitude, or increase the supply voltage.

What is the difference between inverting and non-inverting amplifiers?

In the inverting configuration the signal enters the (−) input through Rin while the (+) input is grounded. The gain is −Rf/Rin and the input impedance equals Rin. In the non-inverting configuration the signal drives the (+) input directly. The gain is 1 + Rf/Rin, the output stays in phase with the input, and the input impedance is very high. Choose the inverting amplifier when you need to invert or sum signals, and the non-inverting amplifier when you need a high input impedance or unity-gain buffering.

Why can't a non-inverting amplifier have a gain below 1?

Its gain is 1 + Rf/Rin. Since Rf and Rin are both positive resistances, the ratio Rf/Rin is always greater than or equal to zero, so the gain is always at least 1. Setting Rf to zero (or Rin to infinity) produces a gain of exactly 1, which is the voltage follower. If you need to attenuate a signal, use an inverting stage, whose gain magnitude Rf/Rin can be less than 1, or a passive voltage divider ahead of the amplifier.

What is a voltage follower and when would you use one?

A voltage follower, also called a unity-gain buffer, is a non-inverting amplifier with Rf = 0 and Rin removed, which makes its gain exactly 1. The output simply copies the input voltage. You use it for impedance conversion: it presents a very high impedance to the source so it barely loads it, and a very low impedance at the output so it can drive a heavier load without the voltage sagging. Typical uses are buffering a high-impedance sensor or a resistive voltage divider before the next stage.

What is the summing amplifier formula?

A summing amplifier is an inverting stage with several inputs, each fed into the virtual-ground node through its own resistor. The output is Vout = −Rf · (V1/R1 + V2/R2 + … + Vn/Rn). When every input resistor is equal to a common value R, this simplifies to Vout = −(Rf/R) · (V1 + V2 + … + Vn), an inverted sum of the inputs. Choosing different input resistors lets you weight each input independently, which is how an audio mixer sets channel levels and how a resistor-ladder DAC turns bits into a voltage.

Do the inputs of a summing amplifier interact?

No. Because the inverting input sits at a virtual ground held at 0 V, the far end of every input resistor sees the same fixed 0 V no matter what the other inputs are doing. The current each input drives is therefore Vi/Ri, set only by that input and its own resistor, and the currents simply add at the node. This independence is the whole appeal of the summing amplifier: you can add or remove channels, or change one input, without re-tuning the others.

What is the difference amplifier formula?

A difference amplifier subtracts one input from the other and amplifies the result. In the balanced case, where the two input resistors are equal (R1 = R2 = Rin) and the feedback resistor matches the resistor from the (+) input to ground (Rf = Rg), the output is Vout = (Rf/Rin)·(V2 − V1), where V2 is the non-inverting input and V1 is the inverting input. The gain Rf/Rin is positive and acts on the difference between the two inputs. With Rin = 10 kΩ and Rf = 22 kΩ, a 2 V input on V2 and 1 V on V1 give Vout = 2.2·(2 − 1) = 2.2 V.

What is common-mode rejection in a difference amplifier?

Common-mode rejection is the difference amplifier's ability to ignore a voltage that appears equally on both inputs. Because the output depends only on V2 − V1, any signal common to both inputs cancels: if V1 = V2, the output is zero no matter how large that common voltage is. This is what makes the difference amplifier useful for measuring a small signal that rides on a large shared offset or noise, such as a current-sense voltage or a bridge-sensor output. In practice the rejection is only as good as the resistor matching, so the R1/Rf and R2/Rg ratios must be equal for the common-mode term to cancel completely.

How do I choose Rin and Rf values?

First fix the ratio Rf/Rin to set the gain you want. Then scale the actual values so that Rin does not load the source too heavily and Rf is not so large that input bias current and resistor noise become significant. A practical range for Rin is 1 kΩ to 100 kΩ, with Rf chosen from the ratio. Very small resistors waste current, while resistors above about 1 MΩ pick up noise and are sensitive to input bias current.