ForHosting KIT · Finance & money

Margin of safety price calculator

If you value a share at 100 and it trades at 70, your margin of safety is 30%: you pay only 70% of estimated worth. Enter both figures to see the discount, the price-to-value ratio and an undervalued, fair or overvalued label. 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
Intrinsic value
100
Market price
70
You get
Discount amount
30
Margin of safety
0.3
Margin of safety percent
30
Price to value ratio
0.7

Value investors compare a stock’s estimated intrinsic value with its market price before they buy. The gap between those two figures—expressed as a percentage of intrinsic value—is the classic margin of safety. This calculator turns an estimated fair value and a quoted market price into that discount (or premium): margin of safety as a decimal and as a percent, the absolute dollar discount, the price-to-value ratio, and a simple valuation label. Use it for stock screens, position sizing notes, classroom value-investing drills, and automation that must normalize buy decisions against a stated fair-value estimate.

What margin of safety means and how the formula works

Benjamin Graham’s margin of safety is the cushion between what a security is estimated to be worth and what the market asks for it. Intrinsic value is your independent estimate of fair worth per share—from a discounted cash-flow model, asset-based floor, earnings multiple you trust, or any other valuation method you own. Market price is the current quote at which you could buy.

The standard percentage form is margin of safety equals intrinsic value minus market price, all divided by intrinsic value. When the market price is seventy and intrinsic value is one hundred, the discount amount is thirty and the margin of safety is thirty percent: you are paying only seventy percent of estimated fair value. When market price equals intrinsic value, margin of safety is zero and the label is fairly valued.

When market price exceeds intrinsic value, the margin of safety turns negative and the label is overvalued—the negative percent is still useful as a premium-over-value signal, not a buy green light. Dividing by intrinsic value (not by market price) keeps the measure scaled to your estimate of worth, which is how Graham framed the buffer that protects against estimation error and bad luck.

Where a margin of safety price calculator earns its keep

Individual investors and advisors use a margin of safety price calculator when a research note states a target fair value and they need an instant, shareable percent cushion against the live quote before sizing a position. Stock-screening tools and newsletter pipelines normalize many names to the same MOS metric so readers can rank opportunities by discount depth rather than by headline price alone.

Educators and LMS platforms need a deterministic oracle for value-investing homework that asks students to compute margin of safety from intrinsic value and market price—including the overvalued case students often mishandle by taking absolute value or dividing by market price instead of intrinsic value. Failed validation does not consume balance. Keep intrinsic value positive and market price non-negative, pin the rounded fields in tests, and you get reproducible margin-of-safety figures for spreadsheets, n8n flows, and edge workers without standing up a finance library of your own.

Pre-trade discount check

Convert your fair-value estimate and the live quote into a margin-of-safety percent before you size or place a buy order.

Screen and rank undervalued names

Normalize many stocks to the same MOS metric so research lists sort by discount depth rather than by absolute price.

Classroom value-investing drills

Mark homework that asks for margin of safety from intrinsic value and market price with a deterministic geometric oracle.

What does a negative margin of safety mean?

Market price is above your intrinsic-value estimate. The stock is labeled overvalued; the negative percent quantifies the premium over your fair value.

Why divide by intrinsic value and not by market price?

Graham’s classic buffer is scaled to estimated worth, so estimation error is expressed as a fraction of fair value—the quantity you care about protecting.

Does the calculator estimate intrinsic value for me?

No. You bring your own fair-value estimate, from a discounted cash-flow model, an asset-based floor, an earnings multiple or any method you trust. The calculator only measures the gap between that estimate and the market price.

What does the price-to-value ratio show?

It divides the market price by your intrinsic value. A ratio of 0.7 means you pay 70% of estimated worth; a ratio above 1 means the market asks more than your estimate, so the margin of safety turns negative.

Can the market price or the intrinsic value be zero?

A market price of zero is accepted and gives a 100% margin of safety. Intrinsic value must be greater than zero, because a zero or negative estimate would leave the percentage without meaning.

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/finance/margin-of-safety-price

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/finance/margin-of-safety-price \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"intrinsic_value":100,"market_price":70}'
{
  "intrinsic_value": 100,
  "market_price": 70
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "finance.margin_of_safety_price",
  "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.

Invalid input fails with invalid_input and is not billed.

What margin of safety means and how the formula works

This endpoint does not invent intrinsic value for you; it only measures the geometric gap once you supply both numbers. That separation is intentional: valuation models change by sector and thesis, while the margin-of-safety arithmetic stays a single, auditable identity.

Input contract, rounding, validation, and worked examples

Intrinsic value must be strictly greater than zero; a zero or negative fair-value estimate is rejected because the margin-of-safety ratio would be undefined or meaningless. Market price must be greater than or equal to zero—zero is allowed and yields a one-hundred-percent margin of safety when intrinsic value is positive. POST a JSON body with two required finite numbers: intrinsic_value and market_price. An optional decimals integer from zero through twelve (default six) controls half-up rounding applied once to discount_amount, margin_of_safety, margin_of_safety_percent, and price_to_value_ratio from the raw IEEE values; never re-inject a rounded percent into another formula step if you chain tools yourself. Missing fields, empty strings, non-finite values, non-positive intrinsic value, and negative market price fail with invalid_input naming the issue, and those failures are not billed. Example: intrinsic_value one hundred, market_price seventy yields discount_amount thirty, margin_of_safety zero point three, margin_of_safety_percent thirty, price_to_value_ratio zero point seven, and valuation undervalued. Example: intrinsic_value fifty, market_price sixty yields a negative margin of safety of negative twenty percent and valuation overvalued. Example: equal prices yield zero margin of safety and fairly_valued. Pair the response with your own valuation notes; this endpoint measures the gap only and does not fetch live quotes or run a discounted cash-flow model.

How is margin of safety calculated?

MOS = (intrinsic_value − market_price) / intrinsic_value. The API also returns the same figure as margin_of_safety_percent, the dollar discount_amount, and price_to_value_ratio.

Does this calculator estimate intrinsic value for me?

No. You supply intrinsic_value from your own model (DCF, assets, multiples, etc.). The tool only measures the gap versus market_price.

What does the margin of safety price 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 →