About this calculator
An op-amp on its own has enormous, uncontrolled gain. Wrapping feedback around it trades that raw gain for something predictable, set almost entirely by the ratio of two resistors. That is the central idea behind nearly every analogue signal chain.
This calculator handles the two fundamental configurations — inverting and non-inverting — in both directions: gain from resistors, or resistors from a target gain. It also checks the output against your supply rails and works out the bandwidth you actually get.
How it works
The op-amp drives its output to whatever voltage makes its two inputs equal. In the inverting configuration the non-inverting input is grounded, so the op-amp holds the inverting input at ground too — a "virtual earth". Input current through Rin must then flow on through Rf, giving Av = −Rf / Rin.
In the non-inverting configuration the signal goes directly to the + input, and the feedback network divides the output back down to the − input. The op-amp raises its output until that divided fraction equals the input, so Av = 1 + Rf / Rg. Note that this configuration cannot have a gain below 1.
The two differ in input impedance too. Inverting presents exactly Rin to the source, because the other end is held at virtual ground. Non-inverting presents the op-amp's own input impedance, which is effectively infinite — useful when the source cannot be loaded.
Bandwidth is finite. An op-amp is specified by its gain-bandwidth product, and available bandwidth is that figure divided by the noise gain. For both topologies the noise gain is 1 + Rf/Rin, which is why an inverting stage at ×10 gets the bandwidth of a non-inverting stage at ×11.
Worked example
Amplifying a 100 mV sensor output to 1 V for an ADC, using a TL072 (GBW ≈ 3 MHz) on ±12 V rails.
- Required gain: 1 V / 100 mV = 10×
- Non-inverting keeps the sensor unloaded, so use Av = 1 + Rf/Rg = 10
- Rf / Rg = 9. Pick Rg = 1 kΩ → Rf = 9 kΩ
- Nearest E24: 9.1 kΩ → actual gain = 1 + 9.1 = 10.1×
- Noise gain is 10.1, so BW = 3 MHz / 10.1 = 297 kHz
- Output at full scale: 1.01 V, well inside ±12 V
1 kΩ and 9.1 kΩ give 10.1× — a 1% error, smaller than most sensors' own tolerance. Bandwidth of 297 kHz is far more than a slow sensor needs.
Practical notes
- Keep feedback resistors roughly between 1 kΩ and 1 MΩ. Lower values load the output; higher values let input bias current and stray capacitance introduce errors and noise.
- A single-supply op-amp cannot output negative voltages. For AC signals on a single rail, bias the input to mid-supply and AC-couple.
- Not all op-amps swing to their rails. A classic 741 stops a couple of volts short at both ends — check the datasheet or use a rail-to-rail part.
- Stray capacitance across Rf forms a low-pass filter with it. At high values of Rf that can be enough to roll off the response, and sometimes a small deliberate capacitor there is exactly what you want to stop oscillation.
- For DC precision, add a resistor equal to
Rf ∥ Rinin series with the other input. It makes the bias currents produce equal offsets that cancel. - Gain and bandwidth trade directly. If you need ×1000 over a wide band, use two ×32 stages in series rather than one ×1000.
Frequently asked questions
How do I calculate op-amp gain?
For non-inverting, Av = 1 + Rf/Rg. For inverting, Av = −Rf/Rin. Only the ratio matters, so 10 kΩ with 1 kΩ gives the same gain as 100 kΩ with 10 kΩ.
What is the difference between inverting and non-inverting?
Inverting flips the signal's polarity and presents a finite input impedance equal to Rin. Non-inverting preserves polarity, has essentially infinite input impedance, and cannot go below unity gain.
Why can a non-inverting amplifier not have gain less than 1?
Its gain is 1 + Rf/Rg, and that ratio can never be negative. Even with Rf at zero you get exactly 1 — a unity-gain buffer. For attenuation, use an inverting stage or divide the input first.
What is gain-bandwidth product?
A constant for a given op-amp: gain multiplied by bandwidth. A 1 MHz GBW part gives 1 MHz at unity gain, 100 kHz at ×10, and 10 kHz at ×100. It is the single most useful number for choosing between parts.
Why is my op-amp output stuck at a supply rail?
Usually the input has driven it past what the gain allows — check that input × gain fits within the rails. Other common causes are feedback connected to the wrong input (positive feedback latches it), or a single-supply part being asked for a negative output.