Op-Amp Gain Calculator

Calculate the closed-loop voltage gain of an inverting or non-inverting op-amp circuit from its feedback and input resistor values, plus the resulting output voltage and gain in decibels.

Quick Facts

Inverting gain
Av = -Rf / Rin
Output is 180° out of phase with the input; gain magnitude can be below or above 1.
Non-inverting gain
Av = 1 + Rf / Rin
Output stays in phase; minimum possible gain is 1 (a unity-gain buffer when Rf = 0).

Your Results

Calculated
Voltage gain (Av)
-
Vout ⁄ Vin ratio
Gain in decibels
-
20 × log10(|Av|)
Output voltage
-
Actual Vout (clamped to supply)
Headroom / status
-
Room before clipping

Ready

Set the configuration and resistor values, then press Calculate.

About the Op-Amp Gain Calculator

This calculator finds the closed-loop voltage gain of the two most common operational-amplifier circuits — the inverting amplifier and the non-inverting amplifier — from the feedback resistor (Rf) and input resistor (Rin) you specify. It then applies that gain to an input voltage to report the ideal output voltage, the gain expressed in decibels, and whether the result would clip against the supply rails of a real op-amp.

The two standard gain formulas

  • Inverting amplifier: Av = -Rf / Rin. The input signal drives the inverting (-) terminal through Rin, and Rf feeds back from the output to that same node. The output is an inverted (180° phase-shifted), scaled copy of the input, and the input impedance seen by the source is approximately Rin.
  • Non-inverting amplifier: Av = 1 + Rf / Rin. The input signal drives the non-inverting (+) terminal directly, while Rf and Rin form a feedback divider from the output back to the inverting terminal. The output stays in phase with the input, and gain can never drop below 1.

Where the formulas come from

Both formulas follow from the ideal op-amp model: infinite open-loop gain, infinite input impedance (no current flows into either input pin), and — in a stable negative-feedback loop — a "virtual short" that forces the two input terminals to sit at nearly the same voltage. Applying Kirchhoff's current law at the inverting node under these assumptions, with no current flowing into the op-amp, yields the two gain equations above directly from Rf and Rin.

Output voltage and clipping

The ideal output is simply Vout = Av × Vin. A real op-amp, however, cannot swing its output past roughly its supply rails (±Vs, or in some designs a bit less due to internal headroom losses). If the ideal Vout would exceed the supply voltage you enter, the amplifier saturates: the actual output flattens near the rail instead of following the formula. This calculator reports both the situation — clipped or not — and the clamped, realistic output voltage.

Reading the decibel figure

Voltage gain in decibels is 20 × log10(|Av|). A gain of 1 (0 dB) means no amplification; positive dB values above that indicate amplification, and a fractional gain (below 1, only possible in some inverting designs) gives a negative dB value, indicating attenuation.

Frequently Asked Questions

What is the formula for op-amp gain?
For an inverting amplifier, closed-loop voltage gain is Av = -Rf / Rin, where Rf is the feedback resistor and Rin is the input resistor. The negative sign means the output is 180 degrees out of phase with the input. For a non-inverting amplifier, Av = 1 + Rf / Rin, and the output stays in phase with the input. Both formulas assume an ideal op-amp operating in negative feedback with very high open-loop gain.
Why is the non-inverting gain always at least 1?
Because Av = 1 + Rf / Rin and Rf / Rin cannot be negative for positive resistor values, the smallest possible non-inverting gain is 1, which occurs when Rf = 0. That special case, a feedback wire with no resistor, is the classic unity-gain voltage follower (buffer). The inverting configuration has no such floor because its gain formula has no added 1.
What happens if the calculated output voltage exceeds the supply rails?
A real op-amp cannot output a voltage beyond roughly its supply rails. If Av times Vin exceeds the supply voltage you entered, the amplifier saturates (clips) and the actual output flattens at close to the rail instead of reaching the ideal calculated value. This calculator flags that condition and shows the clamped, realistic output alongside the ideal one.
What assumptions does this ideal op-amp model make?
It assumes the classic ideal op-amp: infinite open-loop gain, infinite input impedance, zero output impedance, and (in negative feedback) a virtual short between the two inputs so no current flows into either input terminal. Real op-amps deviate slightly due to finite open-loop gain, input bias current, and output impedance, but for most bench and design work the ideal formulas are accurate to within a fraction of a percent.