Home › Engineering & Automotive › Op-Amp Gain Calculator
Op-Amp Gain Calculator
Computes the voltage gain (as a ratio and in dB) of the four basic operational-amplifier circuits from the feedback and input resistors, and optionally the output voltage for a given input, clipped to the supply rails.
When to use
You are designing or checking an op-amp stage and need the gain from resistor values, the resistor ratio for a target gain, or the expected output voltage and whether it will saturate.
Do not use when: Frequency response, bandwidth or slew-rate limits matter (this is the ideal DC gain), the circuit is a filter, integrator or instrumentation amplifier, or you only need a passive divider (use voltage-divider).
Formula
inverting: voltage_gain = −feedback_resistor_ohms / input_resistor_ohms; non_inverting: voltage_gain = 1 + feedback_resistor_ohms / input_resistor_ohms; voltage_follower: voltage_gain = 1; differential (matched resistor pairs): output_voltage_v = feedback_resistor_ohms / input_resistor_ohms × (second_input_voltage_v − input_voltage_v); gain_db = 20 × log10 |voltage_gain|; output_voltage_v = voltage_gain × input_voltage_v limited to ±supply_voltage_v
Ideal op-amp model (infinite open-loop gain and input impedance, zero output impedance), valid while the closed-loop gain is far below the open-loop gain at the signal frequency. Real op-amps swing 1–2 V less than the rails unless rail-to-rail types are used, and the differential amplifier needs R1 = R2 and R3 = R4 for full common-mode rejection.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
configuration | enum: inverting | non_inverting | voltage_follower | differential | yes | Basic op-amp circuit topology. | |
feedback_resistor_ohms | number | Ω | no | Resistor from the output to the inverting input, in ohms (1 kΩ = 1000). Not needed for the voltage follower. Range: > 0, ≤ 1000000000000 |
input_resistor_ohms | number | Ω | no | Resistor from the signal source (inverting) or from the inverting input to ground (non-inverting), in ohms. Not needed for the voltage follower. Range: > 0, ≤ 1000000000000 |
input_voltage_v | number | V | no | Optional input voltage (V1 for the differential amplifier); enables the output-voltage result. Range: ≥ -10000, ≤ 10000 |
second_input_voltage_v | number | V | no | Differential amplifier only: voltage at the non-inverting side; output = gain × (V2 − input_voltage_v). Range: ≥ -10000, ≤ 10000 |
supply_voltage_v | number | V | no | Optional symmetric supply magnitude; the output is limited to ±supply_voltage_v (ideal rail-to-rail swing). Range: > 0, ≤ 1000 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
voltage_gain | number | Closed-loop gain A = Vout / Vin (negative for the inverting amplifier). | |
gain_db | number | dB | 20 × log10 |A|. |
output_voltage_v | number | V | A × input (or A × (V2 − V1)), clipped to ±supply_voltage_v when a supply is given; only when input_voltage_v is given. |
output_clipped | boolean | True when the ideal output exceeded the supply rails and was limited (only when input and supply are given). | |
input_impedance_note | string | What impedance the signal source sees in this configuration. | |
phase_inversion | boolean | True when the output is inverted relative to the input (inverting amplifier). | |
formula_used | string | Gain expression for the chosen configuration. |
Example
Non-inverting, Rf 100 kΩ, Rin 10 kΩ, 0.5 V in, ±12 V supply: {"configuration":"non_inverting","feedback_resistor_ohms":100000,"input_resistor_ohms":10000,"input_voltage_v":0.5,"supply_voltage_v":12} → {"voltage_gain":11,"gain_db":20.83,"output_voltage_v":5.5,"output_clipped":false,"phase_inversion":false}
Inverting, Rf 100 kΩ, Rin 10 kΩ, 0.5 V in: {"configuration":"inverting","feedback_resistor_ohms":100000,"input_resistor_ohms":10000,"input_voltage_v":0.5} → {"voltage_gain":-10,"gain_db":20,"output_voltage_v":-5,"phase_inversion":true}
GET https://tttkmbb.com/api/v1/calculate/op-amp-gain?configuration=non_inverting&feedback_resistor_ohms=100000&input_resistor_ohms=10000&input_voltage_v=0.5&supply_voltage_v=12
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/op-amp-gain(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/op-amp-gain · Markdown: https://tttkmbb.com/engineering/op-amp-gain.md · JSON definition: https://tttkmbb.com/engineering/op-amp-gain.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="op-amp-gain" - OpenAPI operationId:
calculate_op_amp_gain - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Operational amplifier applications (reference)
- Wikipedia – Operational amplifier (reference)
FAQ
Why is the non-inverting gain never below 1?
The feedback network divides the output before comparing it with the input, so the output must be at least as large as the input; an inverting stage or a passive divider is needed for attenuation.
What happens when the output exceeds the supply?
The op-amp saturates near its rail and the signal is clipped; with supply_voltage_v given, the calculator limits the output to ±supply and sets output_clipped.
How is the differential amplifier wired?
V1 through Rin to the inverting input with Rf as feedback; V2 through an equal Rin to the non-inverting input with an equal Rf to ground. The output is Rf/Rin × (V2 − V1), and mismatched resistors reduce common-mode rejection.
Related calculators
- Voltage Divider Calculator — Passive attenuation with two resistors.
- Decibel Calculator — Convert the gain between ratio and dB.
- Resistors in Series and Parallel Calculator — Build non-standard Rf or Rin values from standard resistors.