ForHosting KIT · Engineering & construction

Op-amp gain calculator

Rin of 10 kΩ and Rf of 100 kΩ give an inverting op-amp stage a gain of −10, or 20 dB. Enter the two resistors to get the signed closed-loop gain and its size in decibels, as audio and instrument graphs show it. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Rin
10,000
Rf
100,000
You get
Gain
-10
Gain abs
10
Gain db
20
Unit resistance
ohm

Operational-amplifier voltage gain is the closed-loop ratio of output voltage to input voltage once two resistors have set the feedback. This op-amp gain calculator evaluates the ideal inverting stage: the source drives the inverting terminal through the input resistor Rin, the output returns to that node through the feedback resistor Rf, and Av equals minus Rf over Rin. You receive the signed gain ratio and the magnitude in decibels, computed as twenty times the base-ten logarithm of Rf over Rin.

Closed-loop op-amp gain and the inverting formula Av = −Rf/Rin

Operational-amplifier datasheets quote enormous open-loop gain, but the number you actually use in a circuit is the closed-loop voltage gain set by two resistors. This calculator answers that practical question for the inverting connection: the input signal reaches the inverting terminal through Rin, feedback returns from the output through Rf, and the non-inverting terminal is referenced to signal ground.

Under the usual idealizations—infinite open-loop gain, zero input current, and a virtual ground at the inverting node—the current Vin over Rin through the input resistor equals the current minus Vout over Rf through the feedback resistor. Canceling those currents yields Av equals Vout over Vin equals minus Rf over Rin. The minus sign is the inversion that gives the topology its name: a positive Vin produces a negative Vout when both resistors are positive.

Alongside the signed ratio, the tool reports magnitude in decibels as twenty times log base ten of Rf over Rin, matching how audio and instrumentation graphs plot the absolute value of Av. Textbook checks are immediate. Ten kilohms of input resistance with one hundred kilohms of feedback produces Av equals minus ten and twenty decibels.

Equal resistors produce Av equals minus one and zero decibels, the inverting unity-gain buffer. A 2.2-to-1 feedback ratio produces Av equals minus 2.2. The engine does not simulate finite gain-bandwidth product, input bias, offset, or saturation; those belong in a SPICE run after this first-pass number is correct.

Keep both resistors in the same unit so the ratio is honest, and treat the result as the ideal closed-loop gain you pin before you worry about bandwidth.

Homework, lab design, and software tests that need a stable Av

Students meet op-amp gain when a circuits course introduces negative feedback, when a lab asks them to predict Vout over Vin before they measure it, and when a contest problem gives two resistor values and wants Av without a simulator. Teachers can generate answer keys for mixed kilo-ohm pairs without mixing units or dropping the minus sign. Designers of audio preamps, photodiode front ends, and sensor conditioners use the inverting stage because the virtual ground keeps the summing node quiet and the gain is a simple ratio.

Keep both resistors in the same unit—ohms with ohms, kilohms with kilohms—because only the ratio matters, and mixing a kilohm with an ohm without converting is the most common silent error. Real chips still have finite open-loop gain, input bias current, and a gain-bandwidth product, so treat this result as the ideal first step, then check bandwidth and stability separately. Failed validation does not consume balance, which keeps exploratory typing cheap.

Pair the result with a non-inverting gain tool when the topology is one plus Rf over Rg, or with a voltage-gain-in-dB tool when you already have Vout and Vin rather than resistors.

Homework and lab gain checks

Predict ideal inverting op-amp gain Av = −Rf/Rin and the matching dB figure before grading worksheets or measuring Vout/Vin on a breadboard.

First-pass analog design

Normalize user-entered Rin and Rf into signed gain and decibels for preamp sketches, sensor front ends, and education tools before a SPICE pass.

What does the op-amp gain calculator cost?

It is free in your browser on this page.

What formula is used for op-amp voltage gain?

For an ideal inverting stage, Av = Vout/Vin = −Rf/Rin. Decibels are 20·log10(Rf/Rin), the magnitude of that ratio.

What happens if a resistor is zero or negative?

Both Rin and Rf must be strictly positive; zero or negative values are not physical resistors for this calculation.

Why is the linear gain negative while dB can be positive?

The minus sign is the inversion of the stage. Decibel voltage gain uses the magnitude |Av|, so a gain of −10 is still +20 dB.

Does the result include bandwidth, offset or saturation?

No. It is the ideal closed-loop gain set by the two resistors, without finite gain-bandwidth, input bias, offset or output saturation. Pin down this first-pass number, then check those effects in a circuit simulation.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/elec/op-amp-gain

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/elec/op-amp-gain \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rin":10000,"rf":100000}'
{
  "rin": 10000,
  "rf": 100000
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "elec.op_amp_gain",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_abs_ohm1000000000000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Both resistances must be finite and strictly positive; zero or negative values fail with invalid_input because they are not physical resistors for this network and would make the ratio undefined or misleading. Use the page for homework, lab prep, and first-pass design, or call the API at $0.002 per successful request when scripts and tests need the same numbers.

Input contract, output fields, and why non-positive resistors fail

Both resistances must be strictly positive and within the published magnitude ceiling; that is a physical-resistor rule, not a cosmetic one. Zero Rin would divide by zero and make Av undefined. Zero Rf would claim a gain of zero that this inverting-gain landing does not treat as a valid design point. Negative values are not passive resistors and would flip the sign of Av in a way that hides a data-entry bug. Send a JSON object with two required finite numbers: rin, the input resistor from the source to the inverting pin, and rf, the feedback resistor from the output to that same pin. Values may be JSON numbers or decimal strings, including scientific notation, as long as they parse to a finite real. Each of those cases fails with invalid_input, names the field, and is not billed. On success the response echoes rounded rin and rf, the signed gain Av equals minus Rf over Rin, the positive magnitude gain_abs equals Rf over Rin, gain_db equals twenty times log ten of gain_abs, a short formula string, a method tag, inverted set to true so callers can label the polarity without re-deriving it, and a unit hint of ohm when SI units are used. Rounding uses a fixed number of decimal places so Worker and browser JSON stay comparable. The free page and the API at $0.002 per successful item share the same solve function.

Homework, lab design, and software tests that need a stable Av

On this page the work runs in your browser; through the API each successful lookup costs $0.002. Recompute minus Rf over Rin by hand against the published gain to confirm rounding, and confirm that twenty log ten of the magnitude matches gain_db on the same pair.

Deterministic test fixtures

Pin reproducible closed-loop gains in unit tests, CI, and tutoring software that must assert Av = −10 from a 10:1 feedback ratio without re-deriving virtual ground.

Does this tool compute non-inverting op-amp gain?

No. It evaluates the inverting topology only. A non-inverting stage uses Av = 1 + Rf/Rg with a different resistor arrangement.

Read the full KIT documentation →