Op Amp Gain

Estimate op amp gain with a transparent calculation and custom visualization.

Idealized amplifier output -0.5 V
Inputs
Try:
kΩ
Enter the rf for this engineering estimate.
kΩ
Enter the rin for this engineering estimate.
V
Enter the input for this engineering estimate.
V
Enter the negative rail for this engineering estimate.
V
Enter the positive rail for this engineering estimate.
Select the modeled configuration.
Results & Graph
Idealized amplifier output
-0.5 V

Idealized amplifier output

Graph 1 • Input-to-result flow Shows the calculated components and current result from this tool.
Idealized amplifier outputClosed-loop gain-1Ideal output-0.5Rail-limited out…-0.5Headroom to near…11.5Idealized amplifier output: -0.5 V
Graph 2 • Modeled quantities Compares the values returned by the active calculation.
Closed-loop gain -1 Ideal output -0.5 Rail-limited output -0.5 Headroom to nearer rail 11.5
Graph 3 • Calculation checkpoints Displays the engine’s named calculation points in order.
-1gain 5.7gain 12.4gain Closed-loop gain: -1 gain -1 Closed-loop gain Ideal output: -0.5 gain -0.5 Ideal output Rail-limited output: -0.5 gain -0.5 Rail-limited output Headroom to nearer rail: 11.5 gain 11.5 Headroom to nearer rail
Summary: Selected inverting topology has gain -1; ideal output -0.5 V stays inside the rails, 11.5 V from the nearer rail.
Summary: Selected inverting topology has gain -1; ideal output -0.5 V stays inside the rails, 11.5 V from the nearer rail.
⚠️ Ideal op amp model. Real bandwidth, slew rate, input range, output swing, stability, and loading are excluded.
Interactive chart & math engine powered by CalculatorGraph

Formula: Op Amp Gain formula

See the calculation steps and assumptions shown with the result.
See the calculation steps and assumptions shown with the result.
  • rf: User-entered feedback resistor rf (kΩ).
  • rin: User-entered input resistor rin (kΩ).
  • input: User-entered input voltage (V).
  • negativeRail: User-entered negative rail (V).
  • positiveRail: User-entered positive rail (V).
  • mode: User-entered amplifier topology (value).

Rounding: Displayed result is rounded for readability.

Frequently Asked Questions

Can I enter a negative input voltage?

Yes. The Input Voltage field accepts negative values, and the sign carries through the gain. With the default inverting stage at a gain of -1, an input of -0.5 V gives an output of +0.5 V. In inverting mode with Rf at 100 kΩ, an input of -2 V asks for +20 V and clips to the +12 V rail. A negative input on a single-supply circuit will usually clip at 0 V.

Why does the result not change when I scale both resistors?

The ideal gain depends only on Rf divided by Rin. Entering 10 and 10, or 100 and 100, gives a gain of -1 inverting or 2 non-inverting either way. The absolute values still matter in a real circuit for loading, noise and bias current errors, but the ideal model cannot show those effects, so the displayed output stays the same.

How do I model a voltage follower or buffer?

Choose the non-inverting topology and set Rf to 0. The gain becomes exactly 1, so the output equals the input, for example 0.5 V in and 0.5 V out on the default rails. Rin no longer affects the answer at that point, but it must still be above zero for the calculator to run, so leave it at any positive value.

What happens if I set Rin to zero?

The calculator rejects it with a message that Rin must be greater than zero. In the inverting formula Rin sits underneath Rf, so zero would mean infinite gain. In a real inverting circuit it would mean the source drives the virtual ground node directly, which is not a working amplifier. Use a small positive value if you need to explore very high gains.

Why does my single-supply inverting amplifier show 0 V?

With the negative rail at 0 V, an inverting stage given a positive input asks for a negative output it cannot reach. On rails of 0 V and 5 V with the default 0.5 V input, the ideal -0.5 V is clipped to 0 V. Real designs bias the non-inverting input to a reference voltage, which this calculator does not include as a field.

How can I tell from the result that clipping happened?

Read the end of the interpretation line. If it says the ideal output stays inside the rails, it also gives the distance to the nearer rail. If it says the output is clipped to the positive or negative rail, the headline value is that rail voltage rather than gain times input. For example, an ideal -20 V is reported as clipped to the negative rail at -12 V.

What does the distance to the nearer rail tell me?

It is how far the output can grow before it clips, measured toward the closer supply. The default -0.5 V output is 11.5 V from the negative rail and 12.5 V from the positive rail, so 11.5 V is shown. A gain of -22 with the same input leaves only 1 V, a sign to reduce gain or input before building the circuit.

Will a real op amp reach the rail voltages shown?

Often not. The calculator clips exactly at the rails you enter, which describes an idealised output stage. Many op amps stop some distance short of each supply, and the gap depends on the part and the load current. If your output lands close to a rail, check the output swing specification for your chosen device and reduce the gain or input if needed.

Should I include my sensor's output resistance?

For an inverting stage, yes if it is significant compared with Rin. The source resistance adds in series with Rin, which lowers the actual gain. Entering Rin as the resistor value plus the source resistance gives a closer answer. For a non-inverting stage the source drives a high-impedance input, so its resistance has much less effect on the gain.

Does the gain shown hold at high frequencies?

No. The result assumes unlimited bandwidth and slew rate. A real op amp delivers less closed-loop gain as frequency rises, and the higher the gain you ask for, the lower the frequency where it starts to fall away. Fast, large signals can also be limited by slew rate. Use the datasheet bandwidth figures for anything beyond low-frequency work.

Why the default answer is -0.5 V and not +0.5 V

Out of the box the calculator describes an inverting amplifier with the Feedback Resistor Rf and the Input Resistor Rin both set to 10 kΩ, an Input Voltage of 0.5 V and supply rails of -12 V and +12 V. The result reads -0.5 V. Nothing has gone wrong. An inverting stage multiplies the input by -Rf/Rin, so equal resistors give a gain of exactly -1 and the output is the input turned upside down.

That minus sign is the single most common source of confusion with this topology. A positive input produces a negative output, and a negative input produces a positive one. If you are feeding a sine wave in, the output is the same wave shifted by half a cycle. If you are feeding in a DC sensor voltage, the output sits on the opposite side of ground.

Switch the Amplifier Topology field to non-inverting and keep everything else the same, and the answer becomes 1 V. The gain is now 1 + Rf/Rin, which is 2 with equal resistors. Same two resistors, same input, and the output is both a different size and a different sign. Before you trust any number, check which topology the field is set to, because that choice changes the formula, not just the label.

How Rf and Rin set the gain in each topology

Only the ratio of the two resistors matters to the ideal gain. In inverting mode, dropping Rf to 6 kΩ with Rin left at 10 kΩ gives a gain of -0.6 and an output of -0.3 V. Raising Rf to 15 kΩ gives -1.5 and -0.75 V. Push Rf to 100 kΩ and the gain becomes -10, so the 0.5 V input comes out as -5 V.

The inverting stage can attenuate as well as amplify. Any Rf smaller than Rin gives a gain magnitude below 1, and setting Rf to zero gives a gain of 0 and an output of 0 V. That last case is a useful sanity check rather than a real circuit: with no feedback resistor the inverting input is tied straight to the output.

The non-inverting stage cannot go below a gain of 1. Its formula always adds 1 to the ratio, so Rf of zero gives a gain of exactly 1, which is the voltage follower or buffer. With Rf at 47 kΩ and Rin at 10 kΩ the gain is 5.7, and a 0.5 V input becomes 2.85 V on the default rails.

Because only the ratio counts, you can enter 10 and 10 or 1 and 1 and get the same gain. The field units are kΩ, but the arithmetic would be identical in ohms as long as both resistors use the same unit. The danger is mixing them. If Rin is typed in ohms and Rf in kilohms, the ratio is off by a factor of a thousand and the output slams into a rail.

Rail clipping: when the ideal output and the real answer split

The calculator works out an ideal output first, then limits it to the rails you entered. While the ideal value sits between the rails, the two are the same. Once it goes past a rail, the displayed result stops at the rail.

Try it with Rf at 100 kΩ, inverting, and an input of 2 V. The gain is -10, so the ideal output is -20 V. The supply only reaches -12 V, so the result shows -12 V, and the interpretation line says the ideal -20 V is clipped to the negative rail at -12 V. Flip the input to -2 V and the ideal output is +20 V, clipped to the positive rail at +12 V. Whenever the line says clipped rather than inside the rails, the headline number is the rail, not what the gain asked for.

A clipped answer means the circuit, as entered, cannot produce the output the gain calls for. For an audio or measurement signal that shows up as flattened peaks. The fix is a lower gain, a smaller input, or wider rails, and the calculator lets you try each in a few seconds.

One simplification to be aware of is that the model clips exactly at the rail voltage. That treats the op amp as reaching its supply perfectly. Many parts cannot swing all the way to the rails, and how close they get depends on the specific device and the load. Treat any output within a volt or two of a rail as a warning sign and check the output swing figure in the datasheet of the part you are actually using.

Single-supply circuits and the 0 V negative rail

The negative rail field accepts 0 V, which is how you describe an op amp powered from a single supply such as 0 V and 5 V. It also has to be below the positive rail, and the calculator refuses inputs where it is not.

Single-supply operation is where the inverting topology catches people out. Set the rails to 0 V and 5 V, leave the default inverting stage and the 0.5 V input, and the result is 0 V. The ideal output is -0.5 V, and the interpretation line reports it as clipped to the negative rail at 0 V. There is no negative supply to swing to, so the circuit inverts perfectly on paper and produces nothing in practice.

Real single-supply inverting designs get around this by biasing the non-inverting input to a reference somewhere between the rails, often around mid-supply, so the output swings above and below that point instead of ground. This calculator has no field for a reference voltage, so it cannot show that arrangement directly. If your design uses one, measure the input relative to the reference and treat the rails as distances from it.

The non-inverting stage is friendlier on a single supply as long as the input is positive. With rails of 0 V and 5 V, Rf at 47 kΩ, Rin at 10 kΩ and a 1 V input, the ideal output is 5.7 V and the result is clipped to the positive rail at 5 V. Halve the input to 0.5 V and the output is 2.85 V, inside the rails and 2.15 V from the nearer rail.

Reading the distance to the nearer rail

When the output fits between the supplies, the interpretation line ends by saying how far it sits from the nearer rail. On the default that is 11.5 V: the -0.5 V output is 12.5 V below the positive rail and 11.5 V above the negative one, and the smaller of the two is what you see.

This is the number to watch when you are setting gain. It is the room the signal has before clipping starts, measured toward whichever supply is closest. Set Rf to 22 kΩ and Rin to 1 kΩ in inverting mode with the default 0.5 V input and the gain becomes -22. The output is -11 V, still inside the rails but only 1 V from the negative rail. Any extra input, or any real-world shortfall in output swing, would push it into clipping.

For signals that swing both ways, such as audio, run the calculator at the positive and the negative peak of the input. The margin can differ between the two when the rails are not symmetric. On a 0 V and 5 V single supply, for example, a non-inverting stage with a gain of 5.7 and a 0.5 V input sits 2.15 V from the positive rail, while a slightly negative input would clip at 0 V straight away.

Once the output clips, the line switches to naming the rail it has hit and its voltage, so there is no distance figure to read. Treat a small distance as a warning even before that point, because the ideal model lets the output reach the rail exactly.

Choosing actual resistor values once the ratio is right

The calculator treats 1 kΩ and 1 kΩ exactly the same as 100 kΩ and 100 kΩ, since the ratio is identical. A real circuit does not. The absolute values decide how much current the feedback network draws from the op amp output, how much noise the resistors add, and how much the input bias current of the op amp shifts the result.

In the inverting stage the signal source sees Rin as the input resistance of the amplifier, because the inverting input is held at virtual ground. A 10 kΩ Rin loads the source with 10 kΩ. If your source is a sensor with significant output resistance, that resistance adds to Rin and lowers the gain below what the calculator shows. Add the source resistance to Rin before entering it if you know it.

The non-inverting stage does not have this problem in the same way. The signal goes straight into the high-impedance non-inverting input, so the source sees very little load. That is one reason the follower, Rf of zero, is used as a buffer between a weak source and whatever comes next.

Standard resistor values rarely give the exact ratio you want. Pick the nearest available pair, enter those values, and see what gain and output they actually produce before you order parts.

Limits of the ideal op amp model behind the result

Every figure here assumes an ideal op amp: infinite open-loop gain, no input current, no offset and unlimited speed. Those assumptions are why the gain reduces to a simple resistor ratio. They hold well for low-frequency DC and audio work with sensible resistor values, and less well as you push them.

Bandwidth is the first limit. High closed-loop gain narrows the frequency range over which that gain holds, so a stage that gives -22 on paper may give less at higher frequencies. Slew rate limits how fast the output can change, which distorts large, fast signals even when they stay inside the rails. Input offset voltage gets multiplied by the noise gain, so a high-gain DC stage can show a small error at the output with zero volts in.

The calculator also does nothing about the common-mode input range, stability with capacitive loads, or output current. A result that looks fine here can still oscillate or overheat. Use the answer to choose a gain and confirm the signal fits between the rails, then check those device-specific limits against the datasheet for the part you plan to use.