Margin of Safety

The cushion between an estimate of value and the price you pay, and how to read it from ŷRobot's fair-value gap.

What a margin of safety is

A margin of safety is the gap between what you estimate a stock is worth and the price you pay for it. Benjamin Graham made the idea central to value investing: because every estimate of value can be wrong, you want the price to sit far enough below your estimate that a mistake does not wipe out the case for owning the stock.

The cushion exists to absorb errors. Earnings can grow more slowly than expected, margins can shrink, a competitor can take share, or the estimate itself can rest on assumptions that stop being true. Paying exactly your estimate of value leaves no room for any of that.

How to calculate it

The standard formula measures the discount against the estimated value: margin of safety = (estimated value − price) ÷ estimated value. A stock estimated at $100 and priced at $80 has a 20% margin of safety. A stock priced above its estimate has no margin of safety at all; the result is negative.

ŷRobot's Valuation Gap is measured the other way round, against the current price: (estimated value − price) ÷ price. The same $100 estimate and $80 price give a Valuation Gap of +25%. Both numbers describe the same gap, so convert before you compare: a +25% Valuation Gap equals a 20% margin of safety, and a +10% gap equals about 9%.

Classic value investors often look for a 25% to 50% discount. Those rules of thumb were built for hand-made estimates of intrinsic value, and they carry over to a model estimate only with care, as the next section explains.

Using ŷRobot's fair value as the estimate

ŷRobot's fair value is a CatBoost model's estimate of where a stock's market value will be about six months after its latest financial report, built from roughly 40 fundamental, growth, cash-flow and momentum inputs. It is a forecast, not an intrinsic valuation. Because the model also sees the current price, its estimates usually sit within a modest band of the price, so gaps of 30% or more are rare and a 50% margin of safety will almost never appear.

That makes the rank of the gap more useful than its raw size. The AI score ranks each stock's Valuation Gap against stocks of similar size every day and shows the result as a percentile in the Valuation Outlook pillar. A stock in the top 10% has one of the largest model upsides among its peers, even if the gap itself is only a few percent.

A model estimate is also a single number with real uncertainty around it. A stock whose gap is small relative to that uncertainty has, in practice, little or no margin of safety, even if the gap is positive.

What a margin of safety does not do

It does not tell you when the gap closes. A stock can trade below an estimate of its value for a long time, and the estimate can move toward the price instead of the price moving toward the estimate. When new quarterly results arrive, the fair value updates with them.

It does not turn a weak business into a safe one. A large discount sometimes reflects problems the inputs have not caught yet, such as a lost contract, a guidance cut or an accounting question. Read the gap together with the rest of the stock page: fundamentals, the earnings beat streak and the P/E against its own history.

Where to find it

Every stock page shows the Fair Value card with the estimated value, the current price, the Valuation Gap and the last-report date that anchors the estimate. Use the formula above to turn the gap into a margin of safety. The Smart Screener lets you sort covered stocks by the same gap.

ŷRobot is an analysis tool, not financial advice. Fair-value estimates are model outputs that can be wrong, and past results do not predict future returns.

Try it on a real stock

See ŷRobot's Margin of Safety analysis on any U.S. stock — free, no account needed.

Analyze a Stock Free

What is a good margin of safety?

There is no single right number. Classic value investors often look for 25% to 50% below their own estimate of value. With a model estimate like ŷRobot's fair value, which usually sits close to the price, the gap's rank against similar stocks says more than its raw size.

Is the Valuation Gap the same as the margin of safety?

They measure the same gap with different bases. The Valuation Gap divides by the current price; the margin of safety divides by the estimated value. A +25% Valuation Gap equals a 20% margin of safety.

ŷRobot analysis is AI-generated and quality-gated; nothing on this page is investment advice.