An operational amplifier, or op-amp, is a small integrated circuit that amplifies the difference between its two inputs by an enormous factor, typically a hundred thousand times or more. Used on its own that gain is far too large and unstable to be useful, but when a portion of the output is fed back to the inverting input through a resistor network, the circuit's overall gain becomes set almost entirely by the resistors, not by the chip itself. That trick, negative feedback, is why op-amps appear in audio equipment, sensor circuits, medical instruments, and control systems. Once you understand the two basic configurations, you can predict the output of most simple op-amp circuits with a few lines of arithmetic.
Start with the non-inverting amplifier, the configuration in which the input signal goes to the non-inverting input and the output is in phase with it. Two resistors set the gain: R1 connects from the inverting input to ground, and Rf, the feedback resistor, connects from the output back to the inverting input. The gain formula is gain = 1 + Rf / R1. The "one" in that formula is easy to forget and important: even with no feedback resistor effect, the circuit passes the input through unchanged, and the resistor ratio adds on top of that. A gain of one, achieved by removing R1 or by shorting the output to the inverting input, gives a voltage follower, a circuit that copies its input while providing a low-impedance output capable of driving heavier loads.
Consider a worked example. Suppose Rf is 100 kilohms and R1 is 10 kilohms, and the input is 0.5 volts. The resistor ratio is 100 / 10, which is 10, so the gain is 1 + 10, which is 11. The output is therefore 0.5 × 11, which is 5.5 volts. Every step is checkable: divide the two resistor values, add one, multiply by the input. Now change the input to 1 volt with the same resistors, and the output becomes 11 volts. Change Rf to 47 kilohms with R1 still 10 kilohms, and the gain becomes 1 + 4.7, which is 5.7, so a 2-volt input gives 11.4 volts. The pattern is linear and predictable, which is the whole point of the design. If you need a particular gain, you can work backwards: for a target gain of 21, the ratio Rf / R1 must be 20, so any pair in that ratio, such as 200 kilohms and 10 kilohms, or 100 kilohms and 5 kilohms, will do.
The inverting amplifier is the second core configuration, and it differs in two ways: the input goes through a resistor to the inverting input, and the output is inverted in sign. Its gain formula is gain = −Rf / R1, with no added one. Take a worked example: Rf is 100 kilohms, R1 is 20 kilohms, and the input is 1 volt. The ratio is 100 / 20, which is 5, so the gain is −5, and the output is 1 × (−5), which is −5 volts. If the input were −2 volts instead, the output would be −2 × (−5), which is +10 volts. The sign flip is not a flaw; it is often exactly what a circuit needs, for example when a sensor produces a negative-going signal that later stages expect to be positive. Choosing between inverting and non-inverting is therefore partly about whether you need the sign flipped, and partly about input impedance: the non-inverting input draws almost no current, while the inverting input's impedance is set by R1 itself.
No real circuit escapes its power supply. An op-amp powered from plus and minus 12 volts cannot produce an output beyond roughly those rails, and in practice most devices saturate a volt or two short of them. This is the most common beginner error: a calculation predicts 15 volts from a 12-volt supply, and the real circuit clips the output flat at the rail instead. Before trusting any gain calculation, multiply the largest expected input by the gain and check that the result sits comfortably inside the supply range. If it does not, either reduce the gain, increase the supply within the device's ratings, or accept that the circuit will clip, which is sometimes intentional in comparator-like uses but disastrous in an audio or measurement path. Always check the device datasheet for its supply limits and its output swing specification.
Bandwidth is the second real-world limit. An op-amp's gain falls as frequency rises, and the product of gain and bandwidth is roughly constant for a given device, a figure quoted as the gain-bandwidth product. If a device offers a gain-bandwidth product of 1 megahertz and your circuit has a gain of 10, you can expect roughly 100 kilohertz of useful bandwidth; at a gain of 100, that falls to about 10 kilohertz. This matters whenever the input is not a slow DC signal: audio, sensor waveforms, and communication signals all have frequency content that must fit inside the available bandwidth, or the output will be attenuated and phase-shifted. The simple resistor formulas describe the low-frequency gain; the datasheet tells you how far that description extends.
Practical details separate a working circuit from a merely correct calculation. Resistor tolerance matters: two resistors each rated at 5 percent can shift the gain by roughly 10 percent in the worst case, so precision applications use 1 percent or better parts. Input offset voltage, a small unwanted DC error inside every real op-amp, gets multiplied by the same gain as the signal, which is why high-gain DC circuits sometimes show a puzzling output offset with no input at all. Decoupling capacitors near the supply pins, short feedback paths, and a sensible ground layout all help keep the circuit stable, especially at high gain. And the two golden rules of ideal op-amp analysis are worth memorising: with negative feedback, the two inputs sit at nearly the same voltage, and almost no current flows into either input. Nearly every textbook derivation starts from those two assumptions.
A good workflow for designing a simple stage runs as follows. First, decide whether you need inversion and what input impedance the source can drive. Second, choose a gain that keeps the largest expected output inside the supply rails with margin. Third, pick resistor values in the right ratio, keeping them in a practical range: very low values load the output, while very high values invite noise and stray-capacitance problems, so tens of kilohms is a common compromise. Fourth, check the bandwidth against the gain-bandwidth product. Fifth, build the circuit, measure the actual gain with a known input, and compare it with the calculation. If measurement and calculation disagree by more than resistor tolerance can explain, suspect a wiring error, a supply problem, or saturation before suspecting the formulas.
This guide is educational guidance for understanding and designing low-voltage circuits. It is not a substitute for the device datasheet, and it does not cover mains-powered equipment, high-voltage design, or safety-critical systems. Electrical work beyond low-voltage prototyping should follow local codes and, where required, be carried out or checked by a qualified electrician or engineer.
Try it next: use the Operational Amplifier Gain Calculator to check your resistor choices, then explore the Voltage Divider Calculator and the Scientific Calculator for the supporting arithmetic. For background reading, see Circuit Breaker Sizing Explained.