Op-Amp Gain Calculator
Calculate op-amp gain for feedback circuits, solve Rf or input resistors, and check rail swing, bandwidth, slew rate, tolerance, and load current.| Metric | Value | Detail | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.value }} | {{ row.detail }} |
| Check | Status | Detail | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.value }} | {{ row.detail }} |
Introduction:
Many analog circuits start with a signal that is too small, inverted, offset, or noisy to feed the next stage directly. A sensor bridge may produce millivolts, an audio path may need a controlled phase inversion, and a single-supply microcontroller input may need the signal centered around a virtual ground instead of physical 0 V.
Closed-loop op amp gain is the voltage gain after negative feedback is connected around the amplifier. The op amp provides the active drive, while the resistor network decides how much output voltage is needed to make the two input terminals nearly equal. In the ideal feedback model, the resistor ratio sets the first answer to check.
The sign of gain matters as much as the magnitude. A non-inverting stage preserves phase and cannot have a gain below 1 V/V. An inverting stage reverses the signal around a reference voltage and can use gain magnitudes below, equal to, or above 1. Differential and summing circuits add more context because two input paths contribute to the output.
| Topology | Ideal signal relationship | Typical use | First caution |
|---|---|---|---|
| Non-inverting | Positive gain of 1 V/V or greater. | Sensor scaling and buffers that should preserve phase. | Input common-mode range must include the signal and reference. |
| Inverting | Negative gain from the feedback-to-input resistor ratio. | Polarity reversal, level scaling, and virtual-ground signal processing. | The input resistor is the main input impedance seen by the source. |
| Differential | Output follows the difference between two inputs. | Bridge, sense, and subtraction stages. | Real common-mode rejection depends on resistor matching and input limits. |
| Inverting summing | Each channel contributes an inverted weighted term. | Two-channel mixers and weighted analog sums. | Small input resistors can load sources and raise output-current demand. |
Reference voltage is easy to miss because the gain ratio appears to depend only on resistors. It decides where the output swings. A single-supply stage biased at 1.65 V can keep an alternating signal away from the rails, while the same resistor ratio around 0 V may clip immediately on a 0 to 3.3 V supply.
Resistor gain is only the ideal starting point. Real op amps have output swing limits, input common-mode limits, gain-bandwidth product, slew rate, output current limits, offset, bias current, noise, temperature drift, and stability constraints. A design can have the right closed-loop gain and still fail at the intended amplitude, frequency, load, or supply voltage.
How to Use This Tool:
Use the calculator as a first-pass feedback-stage worksheet. Choose the circuit shape, decide whether to analyze entered parts or solve a missing resistor, then review the electrical checks before carrying values into a schematic.
- Choose Topology: Non-inverting, Inverting, Differential, or Inverting summing. The input labels and diagram change to match the selected circuit.
- Choose Calculation goal. Analyze keeps the entered resistors, Solve Rf calculates the feedback resistor from Target gain, and Solve Rg/Rin calculates the gain or input resistor from the target gain.
- Enter the visible resistor values. Non-inverting mode uses Gain resistor Rg; inverting and differential modes use Input resistor Rin; summing mode uses First input resistor R1 and Second input resistor R2.
- Enter input voltages and Reference voltage. Use 0 V for a split-supply ground reference, or the virtual-ground bias for single-supply stages.
- Set Supply rails. Open Advanced for Output headroom, Gain-bandwidth product, Signal frequency, Slew rate, Resistor tolerance, Output load, and Display precision.
- Use Design presets when you want a known starting point for a sensor stage, audio inverter, bridge difference amplifier, or two-channel mixer.
- Read Gain Snapshot first, then review Design Checks and Transfer Curve. A ready result should have valid resistor values, a believable output voltage, enough rail margin, acceptable speed margin, and load current the selected op amp can drive.
If a validation message appears, correct that field before trusting the result. Common fixes are positive resistor values, a non-inverting solve target above 1 V/V, positive rail above negative rail, headroom that leaves a usable output window, positive gain-bandwidth product, resistor tolerance below 20%, and output load at 0 or greater.
Interpreting Results:
Closed-loop gain gives the signed ideal signal gain for the selected topology. Positive gain means the active input term and output move together. Negative gain means the output is inverted around Reference voltage, which is expected for inverting and summing circuits.
Output voltage is rail-limited. When the ideal output fits inside the usable rail window, the displayed voltage matches the ideal value. When the ideal output exceeds the high or low limit, the displayed voltage is clamped, and the design check reports a rail clip rather than a valid linear output.
Do not treat a clean voltage as final approval. Estimated closed-loop bandwidth, Slew rate, Output load current, resistor range, and gain tolerance are screening checks. The data sheet still decides common-mode range, output swing at the actual load, distortion, noise, phase margin, and temperature behavior.
| Result | Read it as | Do not overread |
|---|---|---|
| Closed-loop gain | Signed voltage gain in V/V for the selected feedback topology. | The sign is phase information, not automatically an error. |
| Gain in dB | 20 log10 of the absolute signal-gain magnitude. | It does not include distortion, noise, or real open-loop gain error. |
| Noise gain | The gain applied to input error voltage, used for the bandwidth estimate. | Inverting signal gain and noise gain are not the same number. |
| Estimated closed-loop bandwidth | Gain-bandwidth product divided by noise gain. | The 10x and 2x margins are screening rules, not stability or flatness guarantees. |
| Slew rate | Large-signal slope needed for the entered sine-wave frequency and output amplitude. | A circuit can pass the bandwidth check and still slew-limit on large signals. |
| Output load current | Approximate current into the entered load resistance relative to the reference. | It does not prove the op amp can supply that current across temperature and output swing. |
Within rails means only that the ideal output fits between the entered rail limits after headroom. For any production, ADC-driving, precision, audio, or high-speed design, verify the selected op amp with the data sheet, simulation where useful, and bench measurements.
Technical Details:
Negative feedback trades the op amp's large open-loop gain for a controlled closed-loop response. In the ideal voltage-feedback model, the output moves until the inverting and non-inverting input terminals are nearly equal. The feedback network then sets the signal gain, while the supply rails and output headroom decide whether the requested output can remain linear.
All resistance values are converted to ohms, voltages to volts, and frequencies to hertz before calculation. Display precision changes rounded output text only. The reference voltage is included directly in the equations so ground-referenced split supplies and biased single-supply circuits use the same sign convention.
Formula Core:
The output equations calculate ideal linear output first. The displayed output is then clamped to the usable rail window when the ideal value is outside the entered rails after headroom.
For a non-inverting sensor stage with Rf = 10 kohm, Rg = 2 kohm, Vin = 250 mV, and Vref = 0 V, the feedback ratio is 5. The ideal closed-loop gain is 1 + 5 = 6 V/V, so the ideal output is 6 x 0.250 V = 1.500 V.
| Solve mode | Non-inverting rule | Inverting, differential, or summing rule |
|---|---|---|
| Solve Rf | Rf = (target gain - 1) x Rg. Target gain must be greater than 1 V/V. | Rf = target gain magnitude x input resistor. |
| Solve Rg/Rin | Rg = Rf / (target gain - 1). Target gain must be greater than 1 V/V. | Input resistor = Rf / target gain magnitude. |
| Analyze | Entered Rf and Rg are used directly. | Entered Rf and input resistor values are used directly. |
The speed and rail checks use the ideal output amplitude because clipping and slew demand depend on the waveform the circuit is trying to produce, not only on the clamped display value.
| Check | Rule used | Meaning |
|---|---|---|
| Output swing | High rail clip above the high limit, Low rail clip below the low limit, Tight swing below 0.5 V margin, otherwise Within rails. | Shows whether the ideal output fits the entered rail window after headroom. |
| Bandwidth | Comfortable at 10x signal frequency or more, Tight from 2x to below 10x, and Too narrow below 2x. | Screens small-signal speed from gain-bandwidth product and noise gain. |
| Slew rate | Comfortable at 2x required or more, Tight from 1x to below 2x, and Insufficient below 1x. | Screens large-signal slope for the entered frequency and output amplitude. |
| Resistor range | Below 1 kohm is low, above 100 kohm asks for noise review, and above 1 Mohm is high. | Flags source loading, noise, bias-current sensitivity, and parasitic concerns. |
| Load current | Below 5 mA is light, 5 mA to below 20 mA is moderate, and 20 mA or above is heavy. | Estimates whether the chosen load may be demanding for the op amp. |
The transfer curve samples a local input range around the entered input. It plots ideal output and rail-limited output together, so clipping appears as a flattened curve at the high or low limit.
Accuracy Notes:
The calculation uses ideal feedback equations plus first-order screening checks. It does not model every device-specific effect that can decide whether a real gain stage works.
- Check input common-mode range and output swing against the actual op-amp data sheet, especially on single-supply circuits.
- Use bandwidth and slew-rate rows as screening checks, not as guarantees of flatness, low distortion, or phase margin.
- Review input offset voltage, input bias current, resistor temperature drift, resistor tracking, capacitive load, decoupling, and PCB layout for precision or high-speed stages.
- Simulate and bench-test circuits that operate near the rails, near op amp speed limits, or into heavy loads.
Worked Examples:
A non-inverting sensor stage in Analyze mode with Rf = 10 kohm, Rg = 2 kohm, Vin = 250 mV, Vref = 0 V, and +/-5 V rails returns a Closed-loop gain of +6.000 V/V. Output voltage is 1.500 V, Gain in dB is 15.56 dB, and a 10 MHz gain-bandwidth product estimates about 1.667 MHz of closed-loop bandwidth.
An audio inverter in Solve Rf mode with target gain magnitude 10, Rin = 10 kohm, Vin = 100 mV, Vref = 0 V, +/-12 V rails, and 1 V output headroom solves Feedback resistor Rf as 100 kohm. The gain is -10.000 V/V and output is -1.000 V, so the sign confirms the intended inversion.
A non-inverting Solve Rg/Rin case with target gain 5 and Rf = 40 kohm solves Gain resistor Rg as 10 kohm. With Vin = 300 mV, Vref = 0 V, and +/-5 V rails, the ideal output is 1.500 V before any rail limiting.
An inverting stage with Rf = 47 kohm, Rin = 10 kohm, Vin = 2.0 V, Vref = 0 V, +/-5 V rails, and 0.2 V output headroom requests an ideal output near -9.4 V. The gain is still -4.700 V/V, but Output swing becomes Low rail clip because the usable low limit is -4.8 V.
A two-input summing setup with Rf = 10 kohm, R1 = 10 kohm, V1 = 100 mV, V2 = 50 mV, and R2 = 4.7 kohm produces an inverted weighted sum near -206.38 mV around a 0 V reference. The second input contributes more strongly because its resistor is smaller.
FAQ:
Why does non-inverting gain include plus one?
The signal is applied to the non-inverting input, while the feedback divider returns only part of the output to the inverting input. The output must rise until that divided feedback voltage matches the input, so the ideal gain is 1 + Rf/Rg.
Why is the gain negative in inverting mode?
The ideal inverting signal gain is -Rf/Rin. The minus sign means the output moves opposite the input around Reference voltage.
Why does the bandwidth estimate use noise gain?
Noise gain is the gain seen by the op amp's input error voltage, so it is the value used for the first-order closed-loop bandwidth estimate. In an inverting stage it is usually one greater than the absolute signal-gain ratio.
Does Within rails mean the real op amp will work?
No. Within rails only says the ideal output fits inside the entered output window. The real part still needs data-sheet checks for common-mode range, output swing, load current, noise, distortion, and stability.
How should a tight bandwidth or slew-rate result be fixed?
Lower the gain, lower the signal frequency, reduce output amplitude, or select an op amp with higher gain-bandwidth product or slew rate. Then recheck rail swing and load current because those limits can move together.
Glossary:
- Closed-loop gain
- The signal gain after feedback is connected around the op amp.
- Feedback resistor
- The resistor from output back to the inverting input node, named Rf in the equations.
- Reference voltage
- The voltage the output swings around, often 0 V or a single-supply virtual ground.
- Noise gain
- The gain applied to op-amp input error voltage, used for bandwidth and stability intuition.
- Gain-bandwidth product
- A data-sheet speed value used to estimate closed-loop bandwidth from noise gain.
- Slew rate
- The fastest output-voltage change the op amp can produce, entered here in V/us.
- Output headroom
- The voltage reserved near each supply rail before checking whether output swing is linear.
References:
- Fundamentals of Analog Electronics Design, Texas Instruments.
- Choosing a Precision Op Amp? Trust Goldilocks., Analog Devices.
- Small-Signal Bandwidth in a Big-Band Era, Analog Devices.
- Amplifier attenuator or both?, Analog Devices.