Home›Stock analysis

Joel Greenblatt’s Magic Formula

Build the Magic Formula ranking with the companies you are studying. The strategy from “The Little Book That Beats the Market” ranks companies on two qualities at once: being good (high return on capital) and being cheap (high earnings relative to price). The top names form the portfolio.

Educational simulation. Not investment advice. Results are estimates based on the data you enter and do not replace advice from a qualified professional.

Reviewed on Oct 31, 2026

Figures in millions: trailing twelve months for EBIT and the latest balance sheet for the rest. Example with fictional companies: replace them with the companies you are analyzing.

Terms: EBIT · Enterprise value · Net working capital

Portfolio

Greenblatt suggests 20 to 30 stocks, bought gradually over the year and held for a year before redoing the ranking. It excludes banks, insurers and regulated utilities.

Your inputs stay only on this browser and are not sent anywhere. Untick to delete them.

RankingTop-ranked company in the Magic Formula
—

Good and cheap at the same time

Each dot is a company. Further right means cheaper (high earnings relative to enterprise value); higher means better (high return on capital). Highlighted: the ones that make the portfolio.

Tap the chart to see the values.

Ranking score

Sum of the positions in the two rankings: the lower, the better.

Tap the chart to see the values.

Ranking

The summary lists your inputs, results, formulas, assumptions and sources. The full report also includes the charts and interpretations, in color. In the print dialog, choose Save as PDF.

Method, assumptions and sources

Formulas

Earnings yield = EBIT ÷ enterprise value (market value + net debt)
Return on capital (Greenblatt’s ROIC) = EBIT ÷ (net working capital + net fixed assets)
Points = earnings yield rank + return on capital rank (1 = best); ties broken by earnings yield

Assumptions and limits

  • Greenblatt uses net working capital excluding cash and short-term debt, and excludes financial companies and utilities. Companies with negative EBIT, enterprise value or capital are left out of the ranking.
  • Past results of the strategy do not guarantee future results, and it can lag the market for years.
  • Calculation tool using data entered by the user. It is not securities analysis or a recommendation to buy or sell; investment decisions are the user’s responsibility.

Official sources and references

  • Greenblatt, J. The Little Book That Beats the Market. Wiley, 2005.
  • Magic Formula Investing, Joel Greenblatt’s website

Frequently asked questions

What is Greenblatt’s Magic Formula?

A strategy from “The Little Book That Beats the Market”: rank companies by earnings yield (cheapness) and return on capital (quality), add the two ranks and buy the top names, holding them for about a year.

How do I calculate earnings yield?

Divide EBIT (operating profit) by enterprise value, which is market value plus net debt. It is the inverse of EV/EBIT: an earnings yield of 10% means the company costs 10 years of operating profit.

Which companies are left out of the Magic Formula?

Banks, insurers and utilities, whose balance sheets do not fit the calculation, and companies with negative EBIT, enterprise value or capital. This calculator excludes the latter automatically.

Does the Magic Formula still work?

Greenblatt’s tests showed returns above the market over long periods, but with years of underperformance in between. Results depend on applying it with discipline across many stocks; past performance does not guarantee future results.

How do I read the result of the example on the page?

With the eight fictional companies in the example, Company H ranks first: it is the cheapest (15.0% earnings yield) and has the best return on capital (31.6%), for just 2 points. The 5-company portfolio holds H, C, A, E and B, which earn on average 11.3% of EBIT relative to enterprise value, or 8.9 times EBIT.

Where do I find EBIT, working capital and fixed assets?

EBIT (operating income) is on the income statement; add the last four quarters. Net working capital and net fixed assets come from the latest balance sheet; for working capital, use current assets minus current liabilities, excluding excess cash and short-term borrowings.

Can I use the Magic Formula with only a few companies?

Yes, but the result becomes a screen rather than a strategy. Greenblatt tested the rule on hundreds of stocks with 20 to 30-name portfolios. With a few companies, use the ranking to decide which ones to study further, and consider talking to a licensed professional before investing.

How Joel Greenblatt’s Magic Formula works

In “The Little Book That Beats the Market” (2005), Joel Greenblatt proposed a simple rule: buy good companies at bargain prices. To avoid subjective judgments, he turned “good” and “cheap” into two numbers and ranked the companies by both.

The two measures

MeasureFormulaWhat it shows
Earnings yieldEBIT ÷ enterprise valueHow cheap the company is: operating profit for every dollar paid for the whole business
Return on capitalEBIT ÷ (net working capital + net fixed assets)How good the business is: profit for every dollar of capital it needs to operate

How the ranking works

Each company gets a rank on earnings yield (1 = cheapest) and another on return on capital (1 = best). The two ranks are added, and the lowest totals make the portfolio. A company ranked 3rd and 5th scores 8 and beats one ranked 1st and 12th, which scores 13.

How Greenblatt applied it

Buy 20 to 30 of the top names, a few at a time over the year, hold each for about a year and redo the ranking. Exclude banks, insurers and utilities, and companies with negative EBIT. The strategy beat the market over long periods in his tests, but it can lag for several years in a row, which is when most investors give up.

Limits

The formula looks only at the past twelve months and ignores debt quality, growth and one-off results. With a small list of companies, use it as a screen to find candidates, not as a final decision.