Op-Amp Gain Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Choose a configuration and enter resistor values to compute gain and output.

Operational Amplifiers and Voltage Gain

An operational amplifier, or op‑amp, is a high‑gain electronic device with differential inputs and usually a single‑ended output. When configured with external resistors in a feedback network, the op‑amp implements precise mathematical operations such as amplification, integration, or filtering. This calculator focuses on the two most fundamental linear configurations: the inverting amplifier and the non‑inverting amplifier. In both cases the op‑amp is assumed to be ideal, meaning it has infinite open‑loop gain, infinite input impedance, zero output impedance, and a perfectly balanced input stage that drives the difference between its inputs to zero when negative feedback is applied.

Under these ideal assumptions the analysis becomes straightforward. For the inverting amplifier, the input signal is applied through resistor R_1 to the inverting terminal while the non‑inverting terminal is grounded. A feedback resistor R_2 connects the output to the inverting input. Because the op‑amp strives to make the voltage difference between its inputs zero, the inverting node sits at virtual ground. The current through R_1 therefore equals V_{in} R_1 , and since no current enters the op‑amp input, the same current must flow through R_2 , producing an output voltage of - V_{in} R_2 R_1 . The closed‑loop gain is thus A_v = - R_2 R_1 .

In the non‑inverting configuration the input signal is applied directly to the non‑inverting terminal. A voltage divider composed of R_1 to ground and R_2 from output to the inverting input establishes feedback. The op‑amp again forces its inputs to equal potential, so the inverting node adopts a fraction of the output determined by the divider. Solving for output voltage yields V_{out} = V_{in} ( 1 + R_2 R_1 ) , and the gain magnitude becomes A_v = 1 + R_2 R_1 . Unlike the inverting mode, the output shares the same polarity as the input.

These expressions are cornerstones of analog circuit design. By choosing resistor ratios, engineers set precisely how much amplification occurs. Because only ratios matter, actual resistor values can be scaled up or down to suit impedance or noise considerations, provided the op‑amp can drive the load and biases remain within supply rails. In practice designers also account for non‑ideal parameters—finite open‑loop gain, input bias currents, and frequency limitations—that modify the ideal equations slightly. However, for low‑frequency applications and reasonable resistor values, the ideal formulas predict behavior with excellent accuracy.

Using the Calculator

Select either the inverting or non‑inverting mode from the drop‑down menu. Enter the input voltage and the two resistor values. When you click Calculate the script determines the closed‑loop gain using the formulas above, computes the output voltage, and displays both. Gain is presented as a unitless ratio as well as in decibels, computed by 20 log ( | A_v | ) . The output voltage accounts for the sign of the gain: an inverting amplifier with a gain of –5 will produce an output of –5 V when the input is +1 V.

Because calculations happen entirely in your browser, you can experiment freely with different resistor ratios to observe how they influence amplification. Doubling R_2 while holding R_1 fixed doubles the magnitude of the inverting gain, while doubling both resistors leaves the gain unchanged. This property allows designers to minimize current draw by using large resistances or to reduce thermal noise by selecting smaller values, striking a balance based on the application.

Sample Gain Table

The following table compares a few representative resistor choices and the resulting gains for each configuration, assuming a 1 V input.

Example resistor selections and resulting amplifier gains for a 1 V input
R1 (Ω) R2 (Ω) Inverting gain Non‑inverting gain
1k 1k -1 2
1k 4.7k -4.7 5.7
2.2k 10k -4.55 5.55
10k 100k -10 11

Notice how the non‑inverting amplifier always yields a gain at least one because the feedback network adds the input directly to the scaled portion of the output. The inverting amplifier, meanwhile, offers flexibility to generate gains less than one by choosing R_2 smaller than R_1 , acting as an attenuator with inversion.

Operational amplifiers also serve as building blocks for active filters, oscillators, and precision rectifiers. By combining capacitors with resistors, designers shape frequency responses for audio equalizers or sensor signal conditioning. High‑speed comparators and instrumentation amplifiers extend the op‑amp concept with specialized internal architectures, yet the same feedback principles apply. Understanding the simple gain relationships is therefore an essential step toward mastering more sophisticated circuits.

It is important to consider the limitations of real devices. Every op‑amp saturates when the output approaches its supply rails, so large gain with high input voltage can drive the output into clipping. Moreover, finite slew rate limits how fast the output can change, causing distortion at high frequencies or large amplitude swings. Input bias currents flowing through resistors create small offset voltages that may become significant when using megaohm‑level resistances. Designers mitigate these effects by selecting precision components, adding compensation networks, or choosing specialized amplifier types.

The ideal formulas also ignore noise, yet in practical circuits thermal noise in resistors and voltage noise from the op‑amp input can degrade signal fidelity. Lower resistor values reduce Johnson noise but increase current draw; higher values save power but may pick up interference and bias‑current offsets. As with many engineering trade‑offs, the optimal choice depends on the specific requirements for bandwidth, power, cost, and accuracy.

Despite these caveats, the inverting and non‑inverting configurations remain the workhorses of analog electronics education because they clearly illustrate the power of negative feedback. By wrapping a high‑gain device in a feedback loop, we tame its behavior and program it through passive components. The resulting circuit amplifies predictably according to simple resistor ratios, a concept that underpins everything from audio preamplifiers to digital‑to‑analog converters.

Experiment with the calculator to see how altering resistor ratios and input levels affects gain and output. Try swapping mode selections to observe polarity changes, or compute equivalent decibel values to connect linear ratios with logarithmic representations used in audio engineering. The simple tool thus provides a sandbox for exploring foundational ideas that continue to drive modern analog design.

Embed this calculator

Copy and paste the HTML below to add the Op-Amp Gain Calculator to your website.