ForHosting KIT · Finance & money

Marginal rate of substitution calculator

Find how much of one good a consumer would trade for another: marginal utilities of 10 and 5 give a marginal rate of substitution of 2, so two units of Y for one more X, and an indifference slope of -2. 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
Mu x
10
Mu y
5
You get
Mrs
2
Indifference slope
-2

The marginal rate of substitution tells how many units of one good a consumer is willing to give up for one more unit of another good while staying equally well off. In standard two-good consumer theory that trade-off equals the ratio of marginal utilities: MRS of X for Y is MU of X divided by MU of Y. Graphically, MRS is the absolute value of the slope of the indifference curve through the current bundle; the signed slope dy over dx is the negative of that ratio. Students use the figure on homework about perfect substitutes, diminishing MRS, and the tangency condition with the budget line. This marginal rate of substitution calculator accepts two positive marginal utilities, returns MRS with the indifference-curve slope and a clear formula string, and rejects zero or non-positive utilities so division stays defined.

What the marginal rate of substitution measures

In microeconomics, a consumer ranks bundles of goods with a utility function. The marginal utility of good X is how much utility rises when X increases by a small amount holding Y fixed; the same idea applies to Y. Along an indifference curve utility is constant, so a gain in X must be offset by a loss in Y.

Differentiating the level set gives dy over dx equal to minus MU_x over MU_y. Economists define the marginal rate of substitution MRS of X for Y as the absolute trade-off MU_x divided by MU_y: how many units of Y the consumer is just willing to sacrifice for one extra unit of X. When goods are perfect substitutes with linear utility, MRS is constant.

When preferences are strictly convex and smooth, MRS usually falls as X rises relative to Y—the familiar diminishing marginal rate of substitution. At an interior optimum the indifference curve is tangent to the budget line, so MRS equals the price ratio P_x over P_y. This calculator computes the utility-side half of that story: given numeric marginal utilities at a bundle, it reports the MRS ratio and the signed indifference slope.

It does not solve for optimal quantities or estimate a utility function from data; those are separate steps. Keeping the definition as a pure ratio means exam oracles, LMS plugins, and slide figures share one reproducible number without spreadsheet rounding drift on intermediate steps.

Where a marginal rate of substitution calculator earns its keep

Introductory and intermediate microeconomics courses assign MRS problems because the ratio links utility theory to indifference maps and to the tangency condition with prices. Tutoring platforms and LMS auto-graders need a deterministic oracle that rejects zero marginal utility instead of returning infinity a buggy key might accept. Instructors building practice banks want the same MU_x over MU_y figure students write on paper, without hand errors when decimals or fractions appear.

Pair this capability with separate elasticity or equilibrium tools when you need market-side calculations; keep this surface focused on the indifference-curve slope that defines willingness to trade between two goods.

Homework and exam MRS checks

Students enter MU_x and MU_y and verify MRS = MU_x/MU_y against textbook indifference-curve and tangency problems.

Preference and trade-off notebooks

Compute the local willingness to trade Y for X from estimated or assumed marginal utilities without rebuilding the ratio in a spreadsheet.

What is the marginal rate of substitution formula?

MRS = MU_x / MU_y, where MU_x and MU_y are the marginal utilities of goods X and Y. This calculator returns that quotient, the signed indifference slope −MRS, and a short formula string.

How does MRS relate to the indifference curve?

The absolute slope of an indifference curve equals MRS.

Does this tool find the optimal consumption bundle?

No. It only computes MRS from two marginal utilities. Optimal choice also needs prices (and usually a budget); at an interior optimum MRS equals P_x/P_y.

What does a marginal rate of substitution of 2 mean?

The consumer would give up two units of good Y to get one more unit of good X and feel just as well off. On the indifference curve this shows up as a slope of -2.

Why must both marginal utilities be above zero?

Because the rate divides one marginal utility by the other, and a zero would leave the result undefined. Textbook theory also assumes that more of a good never makes the consumer worse off.

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/econ/marginal-rate-of-substitution

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/econ/marginal-rate-of-substitution \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mu_x":10,"mu_y":5}'
{
  "mu_x": 10,
  "mu_y": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "econ.marginal_rate_of_substitution",
  "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.

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.

Inputs, outputs, validation, and how to read the result

Both must be strictly greater than zero. POST a JSON body with two required finite numbers: mu_x, the marginal utility of good X at the bundle of interest, and mu_y, the marginal utility of good Y at that same bundle. Textbook non-satiation assumes positive marginal utilities, and a non-positive mu_y would make MRS undefined or meaningless as a give-up-Y-for-X rate. Missing, empty, non-finite, or non-positive values fail with invalid_input naming the field. Fields may arrive as JSON numbers or numeric strings. On success the response echoes mu_x and mu_y (rounded for stable goldens), returns mrs as the quotient MU_x divided by MU_y, returns indifference_slope as the negative of that quotient so the geometric slope of the indifference curve is explicit, and sets formula to MRS = MU_x / MU_y. Example: mu_x equals ten and mu_y equals five yields MRS of two, meaning the consumer would trade two units of Y for one more unit of X while remaining indifferent; the indifference slope is negative two. Compare that MRS to the market price ratio when you study optimal choice; this endpoint only computes the utility ratio. Failed validation is not billed; successful parse calls use the published $0.002 base price per item.

Where a marginal rate of substitution calculator earns its keep

Pin the rounded mrs and indifference_slope in tests, keep both marginal utilities positive, and you get reproducible trade-off figures for homework, exam generators, and lightweight preference notebooks without standing up a full demand system.

LMS and tutoring auto-grading

Score marginal rate of substitution items with a deterministic oracle that rejects non-positive marginal utilities as invalid_input.

Why must both marginal utilities be positive?

Standard non-satiation assumes positive MU. Zero or negative mu_y makes MRS undefined or not interpretable as units of Y given up for X; non-positive values fail with invalid_input.

What does the marginal rate of substitution calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →