Magic Formula Screener
Joel Greenblatt's idea fits in one sentence: buy good businesses at bargain prices. The Magic Formula turns that into a ranking built on exactly two numbers — and st-ox computes it from the book's own definitions, across twelve markets.
The two numbers
How much operating profit the business earns on the tangible capital it needs to run.
How much operating profit you get for what buying the whole company would cost, debt included.
Rank every company on each (1 = best), add the two ranks, and the lowest totals win.
Where it comes from
Greenblatt described the formula in The Little Book That Beats the Market, published in 2005 and written, as he put it, so that his children could understand it. The argument is the one Benjamin Graham and Warren Buffett made before him: a share is a piece of a business, and the way to do well is to own good businesses bought for less than they are worth. What Greenblatt added was a way to do that mechanically, without reading a single annual report — two numbers, two rankings, one sum.
The deliberate simplicity is the point. There is no weighting to argue about, no forecast to get wrong and no judgement call about which company is "better". A company either ranks well on both measures or it does not.
The two numbers, and why these ones
Return on capital — is this a good business?
A good business earns a lot on the money tied up in it. Return on capital measures exactly that: operating profit (EBIT, earnings before interest and taxes) divided by the capital the business needs to operate — its net working capital (the money tied up in stock and unpaid customer bills, less what it owes suppliers) plus its net fixed assets (factories, equipment, stores).
Two choices here are worth noticing. It uses tangible capital, so goodwill from past acquisitions neither flatters nor punishes the figure; a company is judged on what it needs to keep running, not on what it once paid for something. And it uses EBIT rather than net income, so a company's debt level and tax rate don't change how good the underlying business looks.
Earnings yield — is it cheap?
Earnings yield is EBIT divided by enterprise value — the market value of the shares plus the company's net debt. It is the operating profit you would get, each year, for what it would cost to buy the entire company outright and settle its borrowings.
This is a better yardstick than the familiar price-to-earnings ratio for the same reason as before: two companies with identical businesses and identical share prices can have very different P/E ratios simply because one carries more debt. Enterprise value puts the debt on the bill, and EBIT is measured before the interest on it.
How the ranking works
The formula never asks whether a return on capital of 30% is "good" or an earnings yield of 8% is "cheap". It only asks how each company compares with the others. Here is the whole method on five made-up companies:
| CompanyCo. | Return on capitalROC | Earnings yieldEY | ROC rankROC # | EY rankEY # | Sum |
|---|---|---|---|---|---|
| B | 35% | 9% | 2 | 2 | 4 · 1st |
| D | 12% | 15% | 4 | 1 | 5 · 2nd |
| A | 60% | 3% | 1 | 5 | 6 · 3rd |
| C | 25% | 6% | 3 | 4 | 7 · 4th |
| E | 8% | 7% | 5 | 3 | 8 · 5th |
Notice who wins. A is the best business on the list and D is the cheapest, but neither comes first. B does, by being good at both. That is the formula's whole character: it steers away from wonderful companies at silly prices and from cheap companies that are cheap for a reason, and towards the overlap.
On a real market the same arithmetic runs over hundreds of companies at once. At the time of writing (September 2026), about 1,600 US companies clear the market-cap floor, and roughly a thousand are left to rank once financials, utilities and loss-makers are removed.
Who is in the pool
The two exclusions are Greenblatt's own. For a bank, borrowing is the raw material of the business rather than a way of financing it, so enterprise value and working capital stop meaning anything, and a bank would rank absurdly well or badly depending on how its figures happened to be reported. Utilities earn returns that are largely set by their regulators, which distorts return on capital in a similar way.
A company missing any figure the formula needs is left out rather than guessed at. A ranking is only as honest as its worst input.
What is deliberately missing
- No uptrend filter. Every other st-ox screen only shows stocks above their 200-day average. This one doesn't, because the formula looks for good businesses the market has marked down — which usually means shares in a downtrend. On the four markets checked at launch, between 9 and 18 of each top 30 traded below their 200-day average.
- No limit per sector. As in the book. When one industry is profitable and cheap at the same time, the list can cluster in it, and that is information rather than a flaw.
- No other factors and no weighting. Growth, momentum, dividends and margins play no part. The two ranks are added as they are.
Each row still carries the dip-buy signal dot used everywhere else in the app — but expect plenty of yellow and red here. That signal is built to warn about falling trends, and the formula selects for them on purpose. It is context on timing, not a verdict on the ranking.
How st-ox computes it
The formula is simple on paper and fiddly in practice, because the figures it needs aren't all published in the form it wants. What st-ox does, and where it has to approximate:
- Working capital follows the book's definition, not the headline figure: current assets excluding cash and short-term investments, less current liabilities excluding short-term debt. Cash isn't needed to run the business and short-term debt is financing rather than operations. All cash is treated as excess, which is the usual reading of the book. Where working capital comes out negative — a business its customers fund in advance — it counts as zero.
- Net fixed assets are derived, because the data source doesn't publish them as a field. They are backed out of its fixed-asset turnover ratio (revenue divided by net fixed assets). Checked against published balance sheets, this lands where it should.
- Enterprise value is priced today, from the current share price, not the one on the last balance-sheet date.
- If a market stops reporting a figure, the screen says so. If fixed-asset or working-capital data goes missing, return on invested capital (ROIC) stands in and a note above the table says so. If enterprise value goes missing, it is rebuilt from market cap plus net debt. If operating profit itself is missing, nothing is ranked at all, because there is no honest substitute.
You will see values in the thousands of percent. They are not errors. A software company or a drug licensor often has negative working capital (counted as zero) and very few fixed assets, so its operating profit is divided by almost nothing. The formula is designed to reward businesses that need little capital to grow, and these are the extreme case. Because the ranking uses each company's position rather than the size of its number, 3,000% counts for no more than simply being ranked first.
Where st-ox differs from the book
- A higher size floor. The book's ranking reached down to companies worth as little as about $50 million. st-ox uses the same floor as its Quality Compounder screen — $2B on the US market — so that every name on the list can be bought and sold without the price moving against you. Smaller companies are where the book's backtest found much of its edge, so this is a real difference, chosen for practicality.
- Twelve markets rather than one. The book was about US stocks. st-ox runs the same arithmetic on each supported exchange, ranking every company against the others on its own market. Smaller markets rank far fewer companies — a few dozen on Amsterdam, Copenhagen or Helsinki — and in a pool that small, a rank carries much less information.
- Foreign listings aren't removed separately. The book also excluded foreign companies' US-listed shares. st-ox screens primary listings of ordinary shares on each market and doesn't apply that extra filter.
What Greenblatt himself warns
The book is unusually candid about the method's weaknesses, and they are the most useful part of it:
- It can trail the market for one to three years in a row. Greenblatt argues this is exactly why it keeps working: most people give up during those stretches, which leaves the opportunity in place for those who don't. The practical point is that the strategy only works if you are still following it at the end of a bad year — so decide in advance whether you would be.
- Results since the book have been much weaker. The backtest covered 1988 to 2004. In the years since publication, results have been well below it, with long stretches behind the index. Treat the book's numbers as history, not as an expectation.
- How you execute it matters. The book suggests building the portfolio in stages — a few positions every two to three months over the first year until you hold 20 to 30 — then selling each after about a year and replacing it with the current list. (For US taxable accounts it also suggests selling losers just before the one-year mark and winners just after it.) Greenblatt asked readers to commit for at least three to five years. In st-ox, tag the lots you buy as Magic Formula when you add them to Holdings, and it will remind you in the app and in the weekly email as each one nears its one-year mark.
What it still cannot see
The formula reads last-reported figures and nothing else, which is both its strength and its blind spot:
- One-off profits. A property sale or a legal settlement booked in operating profit inflates both numbers for a year.
- Peak earnings in cyclical industries. Miners, shippers, chemical and energy companies look most profitable and cheapest at the top of their cycle — exactly when their earnings are about to fall.
- A business in decline. Some companies are cheap because the market is right about them. A falling share price and a high earnings yield are also what a shrinking business looks like.
- Everything qualitative — management, competition, debt maturities, pending litigation.
Greenblatt's answer was to own enough names that no single one of these matters much. That is why the list is thirty long, and why picking the three you like best from it is a different strategy from the one in the book.
Related
The same engine runs four other presets — see the GARP screener for the quality-growth version and how the multi-factor scoring works, or the penny stock screener for the microcap end of the market. For the big picture on whether the market as a whole is cheap, see the Buffett Indicator.
Frequently asked questions
What is the Magic Formula?
How are return on capital and earnings yield calculated?
Does the Magic Formula still work?
Why are banks, insurers and utilities excluded?
Why is return on capital sometimes thousands of percent?
Why do so many results trade below their 200-day average?
Is the Magic Formula screener free?
Run the Magic Formula in st-ox
Pick a market, choose the Magic Formula preset, and get the top 30 by combined rank — with both ranks, operating profit, enterprise value and the dip-buy signal on every row. Free, no ads.
Open st-ox free →For information and educational purposes only. Not investment advice, and not a recommendation to buy or sell any security. Past results of any strategy, including the backtest described in Greenblatt's book, do not predict future returns. Screen results are a starting point for your own research.