How to Calculate Warren Buffett’s Margin of Safety: Formula + Excel

Our Simple & Powerful Guide Helps You Transform Your Investments By Truly Understanding Buffett's "Margin of Safety", The Core of Value Investing.

Calculating Buffett and Graham’s margin of safety formula requires truly understanding cash low, discounting, and intrinsic value. Learn exactly how to calculate the margin of safety with this valuable lesson.

One of the wealthiest people in the world and the undisputed heavyweight champion of successful investors has told us everything we need to know for long-term profitable investing.

With multiple books and countless letters to investors, the co-founder of Berkshire Hathaway has communicated over and over his investing philosophy.  His core investing principle is the Margin of Safety.

How to Calculate the Margin of Safety Percentage
How to Calculate the Margin of Safety Percentage

What is Margin of Safety?

Margin of Safety is a value investing principle popularised by Seth Klarman and Warren Buffett. If the total value of all shares of a company is 30% less than the intrinsic value of that company, then the margin of safety would be 30%. The intrinsic value is calculated based on the 10-year discounted cash flow (DCF).

In other words, if the stock price of a company is below the actual value of the cash flow (income) and assets of a company, the percentage difference is the Margin of Safety.  This is the discounted price at which you buy a share in the company.

If a company is worth $5 per share on the stock market exchange, but the value of its earnings, property, and brand is worth $10, then you have a discount of 50%.

If you buy the stock at $5, then eventually, the stock price should rise 100% to get to $10 per share.

Simple really! Or is it? How about an infographic to help explain.

If a stock price is significantly below the actual fair value of a company, that percentage difference is known as the Margin of Safety. Essentially the percentage that the stock market undervalues a company.

In other words, the Margin of Safety is the percentage difference between a company’s Fair Value per share and its actual stock price. If a company has profits and assets that outweigh a company’s stock market valuation, this represents a Margin of Safety for the investor. The higher the margin of safety, the better.

In classic value-investing theory, the margin of safety is the level of risk an investor can live with. The margin of safety estimates the risk a stock buyer takes.

Warren Buffett’s Business Valuation Formula

If you understood a business perfectly and the future of the business, you would need very little in the way of a margin of safety. So, the more vulnerable the business is, assuming you still want to invest in it, the larger the margin of safety you’d need. If you’re driving a truck across a bridge that says it holds 10,000 pounds and you’ve got a 9,800 pound vehicle, if the bridge is 6 inches above the crevice it covers, you may feel okay; but if it’s over the Grand Canyon, you may feel you want a little larger margin of safety. Warren Buffett

Margin of Safety Formula:

Margin of Safety = (Intrinsic Value Per Share – Stock Price) / Intrinsic Value Per Share.

How to Calculate the Margin of Safety Ratio: Small Business

If you are interested in buying shares of a company, or even an entire business, you will want to estimate the value of the cash it generates into the future.  Straightforwardly, let’s guess that a business you want to buy will make $10,000 per year for ten years; after the ten years, the business will be worthless.  This means the value of the company might be worth today $100,000 minus the yearly inflation rate; for example, 2% per year.

This means the value of the income, or intrinsic value, in real terms today is $89,826 (Intrinsic Value)

The business owner wants to sell 100% of the company to you for $60,000 (Stock Price)

Margin of Safety = 33% = ($89,826 – $60,000) / $89,826

How to Calculate the Margin of Safety for Stocks

Firstly estimate the free cash flow for the next 10 years and discount it by the inflation rate. Next, add up all future cash flow and divide this by the number of outstanding shares. You now have the intrinsic value per share. The percentage intrinsic value is below the current stock price is the margin of safety.

Download Our Free Magin of Safely Calculator in Excel

Calculating the company’s intrinsic value and, therefore, the margin of safety for stocks means using many variables and calculations.  For this, you will need to use a Margin of Safety Calculator, a simple excel spreadsheet.

Intrinsic Value & Margin of Safety Calculator Excel
The margin of Safety Calculator Excel – Click To Download

Download Our Margin of Safety Calculator in Excel

Concepts in Calculating Intrinsic Value in Excel

Essentially, Warren Buffett estimates the current and predicted earnings from a company from now for the next ten years.  He then discounts the cash flow against inflation to get the current value of that cash.  This is the Intrinsic Value of the business.

Explained another way, Warren Buffett bases his Intrinsic Value calculations on future free cash flows. He believes cash is a company’s most valuable asset, so he projects how much future cash a business will generate.

The usual formula for estimating future Free Cash Flows is the Discounted Cash Flow Method. Here is an example of a simple Discounted Cash flow Method

7 Steps to Calculate the Magin of Safety

  1. Take the free cash flow of the first year and multiply it by the expected growth rate.
  2. Then calculate the NPV of these cash flows by dividing it by the discount rate.
  3. Project the cash flows ten years into the future, and repeat steps one and two for all those years.
  4. Add up all the NPVs of the free cash flows.
  5. Multiply the 10th year with 12 to get the sell-off value.
  6. Add up the values from steps four, five, and Cash & short-term investments to arrive at the intrinsic value for the entire company.
  7. Divide this number with the number of shares outstanding to arrive at the intrinsic value per share.

Note: the NPV refers to the Net Present Value or the present value of money. You calculate the Net Present Value by subtracting the discount rate from the future value of the money and multiplying it by the number of years you are measuring.

The advantage of the Discounted Cash Flow Method is that it is simple. The problem with this method is that Free Cash Flow can vary dramatically from year to year. Thus, the final figure from this method can be inaccurate.


You want to be a successful stock investor but don’t know where to start.

Learning stock market investing on your own can be overwhelming. There’s so much information out there, and it’s hard to know what’s true and what’s not. Stock Market Investing Training - Liberated Stock Trader Pro

Liberated Stock Trader Pro Investing Course
Our pro investing classes are the perfect way to learn stock investing. You will learn everything you need to know about financial analysis, charts, stock screening, and portfolio building so you can start building wealth today.
★ 16 Hours of Video Lessons + eBook ★
★ Complete Financial Analysis Lessons ★
★ 6 Proven Investing Strategies ★
★ Professional Grade Stock Chart Analysis Classes ★

Find Out More


The Margin of Safety. What You Should Pay for A Stock

Now that you know the intrinsic value per share, you can compare that to the actual share price.  If the intrinsic value is more than the actual share price, that will constitute a value investment.

Warren Buffett likes a margin of safety of over 30%, meaning the stock price could drop by 30%, and he would still not lose money.

All value investors need to understand that the margin of safety is only an estimate of a stock’s risk and profit potential. There are many risks that fundamental analysis cannot estimate, including politics, regulatory actions, technological developments, natural disasters, popular opinion, and market moves.

The margin of safety you use is the level of risk you are comfortable with.

If you are risk-averse, you will want a high margin of safety. A risk-taker, however, could prefer a low margin of safety.

The Margin of Safety Measures Market Irrationality

The larger the margin of safety, the more irrational the market has become.  Imagine a business with $5 billion worth of assets, property, and future cash flow from operations, but the stock market values all the shares on the market (Market Capitalization) at $2.5 billion.  This means you could buy the entire company for a 50% discount and potentially break to company up and realize a 100% profit on your investment.

If the market values a company accurately, it is behaving rationally. Therefore the larger the Margin of Safety, the more irrational the market is behaving.


Buffett thinks that popular opinion and the media create market irrationality. Buffett watches the news and looks for bad news about good companies.  The idea behind this strategy is that news reporting is usually shallow, superficial, and concentrated on one aspect of a company’s business. Buffett will sometimes buy companies after a well-publicized scandal.

Value investors believe people pay more for attractive, fashionable, or “sexy” stocks. Therefore, many value investors look closely at unattractive, boring, and unfashionable stocks. These people seek good stocks that the market does not appreciate.

For instance, a value investor could buy an oil company instead of a tech stock. The oil company is old-fashioned, boring, and offensive to some people, but it makes money. The tech company is attractive and flashy, but it could make no money.

Berkshire Hathaway (NYSE: BRK.B) kept significant holdings of the banking giant Bank of America (NYSE: BAC) despite a scandal at that company. The public turned on Bank of America after news reports alleged some of its employees were writing fraudulent loans to get commissions.

Buffett kept Bank of America because the bad loans came from one small piece of Bank of America’s business. Buffett hoped that the bad news about Bank of America would fade over time, but the company could keep making money.

Another key idea in Buffett’s market irrationality strategy is that the media does a lousy job reporting on companies. Buffett bets that most news about companies will be inaccurate, limited, short-sighted, biased, and incomplete.

Buffett tries to capitalize on that lack of information by having more information than the rest of the market. Buffett reads financial reports; instead of newspapers and blogs because he thinks financial data gives him an edge over other investors.  Buffet assumes that most investors do a poor job of valuing companies because they rely upon inaccurate media reports. His strategy is to find more accurate information and base his decisions on that information.

A High Margin of Safety

Most value investors believe that the higher the margin of safety, the better.  In reality, a margin of safety between 20% and 55% is reasonable. If the margin of safety is too high, you must investigate more in-depth into the company, as it could be that the business has some serious fundamental problems.  These problems could range from industry disruption, a catastrophic scandal, or even inevitable bankruptcy.

In the next section, we highlight TD Ameritrade, a very profitable company with a high cash flow that is currently selling at a discount of 55%, e.g., a margin of safety of 55%.

3 Ways of Calculating Margin of Safety & Fair Value

As you can see, the Margin of Safety is entirely dependent on how you calculate a company’s fair value or intrinsic value. The image below shows three ways that fair value can be calculated. This scan was done using our recommended stock screener Stock Rover.  The red boxes highlight that although there are differences in the fair value calculation, they are, in many cases, similar outcomes.

You could use the three different ways of calculating the Margin of Safety to confirm that the company is undervalued.

There are at least 3 ways to calculate the Fair Value & Margin of Safety
There are at least three ways to calculate the Fair Value & Margin of Safety – Image Courtesy of Stock Rover.

A Margin of Safety Stock Screener

The best margin of safety stock screener is Stock Rover because it calculates three critical ratios, margin of safety, the margin of safety with enterprise value to sales, and fair value standard and academic.

The Three Ways of Calculating Margin of Safety Used By Stock Rover.

Fair Value – We compute the company’s Fair Value by using a discounted cash flow analysis to determine the Intrinsic Value. We then rank firms in each Sector by their Intrinsic Value to find a value that is well suited to current market multiples. Over the long term, our Fair Values will imply a 30% drop in price for the worst stocks and a 45% gain for the best stocks. This is the calculation used by Warren Buffett.

Margin of Safety – The percentage difference between a company’s Fair Value and its price. This metric is the single most significant valuation metric in our arsenal as it is the final output of a detailed discounted cash flow analysis. This is the calculation used by Warren Buffett.

Fair Value (EV / Sales) – This fair value is determined by ranking stocks in a sector by their EV / Sales ratios. It is a fallback for when discounted cash flow analysis cannot be calculated. Over the long term, this value will imply a 30% drop in price for the worst stocks and a 45% gain for the best stocks.

Margin of Safety (EV to Sales) – The percentage difference between a firm’s fair value (as determined by the EV / Sales ratio) and its current price. A higher margin of safety is better, but this valuation method is imprecise as it uses very generalized criteria.

Fair Value (Academic) – We compute the Fair Value (Academic) of a company using a discounted cash flow analysis with the academic formula for Intrinsic Value that forecasts cash flows into perpetuity. We then rank firms in each Sector by their Intrinsic Value to find a value that is well suited to current market multiples. Over the long term, our Fair Values will imply a 30% drop in price for the worst stocks and a 45% gain for the best stocks.

Margin of Safety (Academic) – The percentage difference between a company’s Fair Value (Academic) and its price. When this value is close to the non-academic Margin of Safety value, it provides higher confidence in the result.

So to reiterate, in the example above, you can use the three different ways of calculating the Margin of Safety as confirmation that the company is indeed undervalued.

Margin of Safety Summary.

Ultimately the calculation of Fair Value and Margin of Safety is critical to the value investing strategy.  If you want to make good profits long-term, you need to minimize your risk by purchasing companies selling at a significant discount due to market irrationality.  We have included an excel spreadsheet to help you calculate fair value and margin of safety manually. Still, if you want to be effective and efficient, you will need a great stock screener with built-in calculations.  Stock Rover offers a full 14-day trial and a free service; try Stock Rover.

Get Stock Rover Free

[Related Article: 4 Easy Steps to Build The Perfect Warren Buffett Stock Screener]

Are You Looking For Stock Investing & Trading Software? Here Are My Favorites.

My favorite software for trading is TradingView because it does everything well. It has backtesting, great charts, stock screening, and an active community of over 3 million people sharing ideas, plus a free plan available globally.

My favorite software for investing is Stock Rover, as it specializes in deep fundamental financial screening, research, and portfolio management. It is the ideal platform for dividend, value, and growth investing.

My favorite software for stock market news is Benzinga Pro, with its super-fast real-time news engine, squawk box, and news impact ratings.

My favorite AI trading software is TrendSpider which enables automatic pattern recognition for Trendlines, Candlesticks, and Fibonacci levels. Trade Ideas uses AI to generate high probability daily trading signals for auto-trading.

My favorite stock-picking service is Motley Fool Stock Advisor, which has a proven track record of beating the market with excellent stock research reports.

Read the Full Top 10 Stock Market Software Testing & Review


Please enter your comment!
Please enter your name here