Rule of 40 Explained: Formula, Real Examples and Limits
Rule of 40 explained: the formula, how to calculate it, real scores for four public software companies and what the rule misses.
- 25 min read
- 41 sections
- Updated November 19, 2026
The Rule of 40 is a quick test of whether a software company is balancing growth and profit. Under the rule, revenue growth and profit margin, both in percent, should sum to 40 or more. Take growth of 30 percent and a margin of 10 percent, and the score is 40. One growing 10 percent with a 5 percent margin scores 15.
Below you will find the formula behind the rule of 40, its origin, a step-by-step calculation and the things it leaves out. Most explanations stop at the formula and an invented example. I went further and calculated real scores for four public software companies from their own filings, under three different definitions of profit.
The numbers from SEC filings were pulled on October 28, 2026 and are sourced. For the small company examples I made the figures up, purely to walk through the arithmetic. I keep the two apart throughout, and the script at the end reproduces every real number.
The short answer
Add your revenue growth rate to your profit margin, and the sum is your Rule of 40 score. Use year-over-year growth, choose one profit measure such as free cash flow margin or EBITDA margin, and use the same measure every time. A score of 40 or more is the usual target.
The score depends heavily on the definition. In my calculations, the same company scored 46 percent with one definition and 26 percent with another. So always say which growth and which margin you used, and never compare scores that use different ones.
This is education, not investment advice. The company figures are historical and come from public filings. The small company examples are invented.
What the Rule of 40 means
Think of the Rule of 40 as a rule of thumb, the kind of shortcut people call a heuristic. It reduces two big questions, how fast are you growing and how profitable are you, to one number. A company may give up some of one to get more of the other, as long as the sum stays at 40 or above.
Rule of 40 SaaS searches usually mean this same growth-plus-profit test. That is why different combinations pass. A company growing 40 percent with zero profit passes. Growth of 20 percent paired with a 20 percent margin passes too, and so does 10 percent growth with a 30 percent margin. Growth of 5 percent with a margin of 5 percent falls well short.
The rule of 40 meaning in plain words
If you are growing fast, you can afford to spend your profits on more growth. If you are growing slowly, you should be making real money. The rule says what you cannot do is grow slowly and lose money at the same time.
Where the rule came from
Brad Feld's original post, dated February 3, 2015, is the source people cite most. In it he recounts a board meeting where a late-stage investor laid out his firm's rule for judging a healthy software company.
According to Feld, the rule is meant for SaaS companies that have reached scale, which he put at $50 million of revenue or more. He added that his own idea of product and market fit lines up with it once a company reaches about $1 million of monthly recurring revenue.
His examples are the ones people still repeat. At 20 percent growth, you should be earning a 20 percent profit. Growing 40 percent, a zero percent profit is fine. Growing 50 percent, you can lose 10 percent.
What Feld said about growth and profit
For the growth half, Feld's suggestion was to take monthly recurring revenue and measure how much it grew against a year earlier. He said total revenue works too, but he wanted MRR checked as well, to catch distortions in accounting, especially when one-time services revenue is in the mix.
On profit, he admitted it is harder to define. He listed EBITDA, operating income, net income and free cash flow, and said he prefers EBITDA as the baseline and then back tests with the others. That ambiguity is the reason the rule needs careful use.
How the rule is described today
Wikipedia's article on the rule describes it as a heuristic for assessing the health of SaaS companies, with annual revenue growth and profit margin adding to 40 percent or more. It says growth is typically year-over-year revenue growth and that the definition of profit margin can vary.
It also lists criticisms. One is that the 40 percent figure is arbitrary and may not suit all market conditions. I return to that in the limits section.
Rule of 40 calculation: the formula step by step
The formula has two parts and a sum.
Rule of 40 = revenue growth rate + profit margin
Revenue growth rate is this year's revenue divided by last year's revenue, minus one. Profit margin is a profit measure divided by revenue. Both are written as percentages and added.
Step 1: calculate growth
Take revenue for the current period and for the same period a year earlier. Divide the current figure by the earlier one and subtract one. If revenue went from $10.0 million to $13.0 million, growth is 13.0 divided by 10.0, minus one, which is 30 percent.
Step 2: choose and calculate the margin
Pick one profit measure and divide it by the current revenue. The common choices are EBITDA, operating income, free cash flow and net income. They give different answers for the same company, as the next example shows.
Step 3: add them
Add the growth rate and the margin. Compare the sum with 40. Record which measures you used, because the label matters as much as the number.
A small example with four margins
I invented a company whose revenue grew from $10.0 million to $13.0 million. Its EBITDA was $1.3 million, its operating income $0.8 million, its free cash flow $0.5 million and its net income $0.3 million. Growth is 30 percent in every row.
| Profit measure | Margin | Rule of 40 score |
|---|---|---|
| EBITDA | 10.0% | 40.0% |
| Operating income | 6.2% | 36.2% |
| Free cash flow | 3.8% | 33.8% |
| Net income | 2.3% | 32.3% |
The same company passes or fails depending on the choice. With EBITDA it exactly meets the benchmark. With free cash flow it falls short by more than six points. That is not a trick. It reflects real differences, such as depreciation, interest, taxes and capital spending.
The choice of growth also matters. Using monthly recurring revenue or annual recurring revenue can give a different rate from recognized revenue, especially when the business is growing fast or has large one-time items.
Real scores from public company filings
Examples with invented companies show the arithmetic. They do not show how the rule behaves in real data, where growth, stock compensation and one-time items complicate the picture. So I calculated the rule for four public software companies using the structured financial data that companies file with the SEC.
I picked Atlassian, HubSpot, Dropbox and MongoDB because their annual reports are easy to compare, and I use their latest full fiscal year as of October 28, 2026. These are not recommendations, and I am not judging the companies. I am showing how the rule behaves.
How I calculated it
Revenue is the annual revenue reported in each company's 10-K. Growth is that figure set against the prior fiscal year's. Free cash flow is operating cash flow minus purchases of property and equipment, and minus cash paid for capitalized software development where the company reports it as a separate item. Only HubSpot did. That cost appears as its own line in cash flow from investing activities, separate from purchases of property and equipment, so subtracting it does not count the same outflow twice. Atlassian, Dropbox and MongoDB did not report that item under the tag I used, and I treated it as zero for them.
Operating margin is GAAP operating income divided by revenue. For the third definition I subtracted stock-based compensation from free cash flow, because stock compensation is a real cost that free cash flow does not show. I did not use any company's own non-GAAP measures.
The results
| Company | Fiscal year | Revenue | Growth | FCF margin | Operating margin | Stock comp as share of revenue |
|---|---|---|---|---|---|---|
| Atlassian | Year ended June 30, 2026 | $6,572M | 26.0% | 20.1% | 0.2% | 24.4% |
| HubSpot | Year ended December 31, 2025 | $3,131M | 19.2% | 18.4% | 0.2% | 16.9% |
| Dropbox | Year ended December 31, 2025 | $2,521M | -1.1% | 36.9% | 27.3% | 11.9% |
| MongoDB | Year ended January 31, 2026 | $2,464M | 22.8% | 20.3% | -5.6% | 22.3% |
Now the Rule of 40 under each definition.
| Company | Growth plus FCF margin | Growth plus operating margin | Growth plus (FCF margin minus stock comp) |
|---|---|---|---|
| Atlassian | 46.1% | 26.2% | 21.6% |
| HubSpot | 37.6% | 19.4% | 20.7% |
| Dropbox | 35.9% | 26.3% | 23.9% |
| MongoDB | 43.1% | 17.2% | 20.8% |
What the real data show
First, the definition changes the verdict. On free cash flow, Atlassian scores 46.1 and MongoDB 43.1, both above 40. On GAAP operating margin, neither comes close. The gap comes mostly from stock-based compensation, which reduces GAAP profit but not cash flow.
Second, stock compensation is large. It was 24.4 percent of revenue at Atlassian and 22.3 percent at MongoDB, against 11.9 percent at Dropbox. When I subtract it from free cash flow, the scores bunch together between about 21 and 24 percent.
Third, a company can score well with no growth. Dropbox's revenue fell 1.1 percent, yet it reached 35.9 percent on free cash flow because of a 36.9 percent margin. Two of the four exceed 40 on one definition, and none does on all three.
The same company over three years
A single year can mislead, so I also calculated the three most recent years on the free cash flow definition.
| Company | Year 1 | Year 2 | Year 3 |
|---|---|---|---|
| Atlassian | 2024: 23.3% + 32.5% = 55.8% | 2025: 19.7% + 27.1% = 46.8% | 2026: 26.0% + 20.1% = 46.1% |
| HubSpot | 2023: 25.4% + 11.6% = 36.9% | 2024: 21.1% + 17.9% = 39.0% | 2025: 19.2% + 18.4% = 37.6% |
| Dropbox | 2023: 7.6% + 30.4% = 38.0% | 2024: 1.9% + 34.2% = 36.1% | 2025: -1.1% + 36.9% = 35.9% |
| MongoDB | 2024: 31.1% + 6.9% = 37.9% | 2025: 19.2% + 6.0% = 25.2% | 2026: 22.8% + 20.3% = 43.1% |
The paths differ in shape. Atlassian's score fell as its margin eased, then held. Dropbox's growth faded while its margin rose. MongoDB's score dropped in 2025 and rebounded in 2026 as its free cash flow margin climbed from 6.0 to 20.3 percent.
A single point in time hides these stories. If you use the rule to manage a business, watch the trend and the mix of growth and margin, not only the total.
What these numbers do not prove
They do not show that a high score makes a company a good investment, and they do not rank the companies. Fiscal years end at different dates, the companies differ in size and product, and I used only reported figures. Treat them as examples of how the rule behaves with real data.
Choosing the growth measure
Growth looks simple, but there are several ways to measure it. The choice changes the score, so decide once and stay consistent.
| Growth measure | What it is | Watch for |
|---|---|---|
| Recognized revenue growth | Change in revenue under accounting rules | Lumpy one-time items, timing of recognition |
| Annual recurring revenue growth | Change in annualized subscription revenue | Different companies define ARR differently |
| Monthly recurring revenue growth | Change in monthly subscription revenue | Seasonal effects, discounts |
| Gross profit growth | Change in revenue minus cost of revenue | Shows whether costs scale with sales |
| Organic growth | Growth excluding acquisitions | Needs careful accounting of acquired revenue |
Feld recommended year-over-year growth of monthly recurring revenue, with a check against total revenue and against gross margin growth. Public companies report recognized revenue, so that is what most outside observers use, and it is what I used for the real examples.
Acquisitions deserve a note. If a company buys another business, its revenue growth jumps without any improvement in the underlying product. Use organic growth if you want to measure how well the business itself is growing, and say so.
Period and timing
Annual growth compares a full year with the previous year. Some people use the growth of the latest quarter against the same quarter a year earlier, which reacts faster to change but is noisier. Others use trailing twelve months. State your choice, and use the same one in every comparison.
Choosing the profit measure
Profit is the harder half. There is no single correct choice, and each measure answers a slightly different question. This table is our summary.
| Profit measure | What it includes | Strength | Weakness |
|---|---|---|---|
| EBITDA | Earnings before interest, taxes, depreciation and amortization | Simple, popular, ignores financing and tax | Ignores capital spending and often stock compensation |
| Operating income | Revenue minus operating costs, after depreciation | Closer to accounting profit | Includes non-cash items such as stock compensation |
| Free cash flow | Operating cash flow minus capital spending | Shows real cash generated | Can be lumpy, hurt by prepayments and timing |
| Free cash flow minus stock compensation | Cash flow after the cost of paying staff in shares | A fuller view of cost | Less commonly reported |
| Net income | Everything, including taxes and interest | Bottom-line profit | Affected by one-time and non-operating items |
Feld said he prefers EBITDA as the baseline and then back tests with the other measures. That is sensible advice. The most important rule is consistency, followed by showing a second measure so readers can see whether the story changes.
Stock-based compensation
Stock-based compensation pays people in company shares. It is not a cash cost, so it does not reduce free cash flow, but it is a real cost to owners because it dilutes them. In my real examples it was between 11.9 and 24.4 percent of revenue.
If you leave it out, a company looks much more profitable. If you subtract it, scores fall sharply. Both views are defensible. The gap between them is big enough, though, that any presentation of the rule should include the two side by side.
How to interpret a score
The common goal is a score that reaches 40. Below 40 is a warning, and well below 40 is a reason to ask which side is weak. This table is our judgment, not a standard.
| Score | What it often suggests | First question to ask |
|---|---|---|
| Above 50 | Strong balance of growth and profit | Is the pace sustainable, and is the company investing enough? |
| 40 to 50 | Meeting the benchmark | Which side is carrying the score? |
| 25 to 40 | Close but short | Can one side improve without hurting the other? |
| Below 25 | Weak | Is this a growth company or a profit company, and which is failing? |
The most useful question is always which side carries the score. A company at 45 with 40 percent growth and 5 percent margin is a different business from one with 5 percent growth and 40 percent margin. They share a score but face different risks.
Is 40 the right number?
Wikipedia lists as a criticism that the 40 percent figure is arbitrary and may not suit all market conditions. I did not find a sourced study that justifies the threshold as a law. Treat it as a convention that people recognize, and not as a measured optimum.
Rule of 40 by company stage
Feld limited the rule to SaaS companies at scale, and named $50 million in revenue as the minimum he had in mind. Young companies often grow fast with big losses, and that can be the right choice, so the rule is not a good test for them.
| Stage | Better questions than the rule of 40 |
|---|---|
| Early, finding product-market fit | Are customers staying and recommending? Do they pay? |
| Growing, scaling acquisition | Is CAC payback within your limit? Is net revenue retention above 100 percent? |
| Scaled, over about $50M of revenue | Rule of 40, plus retention and cash generation |
| Mature, slow growth | Margin, cash returns and the cost of keeping customers |
Our SaaS marketing guide shows how to calculate CAC and payback by channel, and our guide to churn rate explains net revenue retention, which are the better early signals.
Using the rule to plan
The rule is more useful as a planning tool than as a report card. It shows the price of trading growth for margin, and the reverse. This table shows the growth you need for each margin to reach 40.
| Profit margin | Growth needed to reach 40 |
|---|---|
| -20% | 60% |
| -10% | 50% |
| 0% | 40% |
| 10% | 30% |
| 20% | 20% |
| 30% | 10% |
Consider an invented company with $100 million of revenue, 30 percent growth and a 5 percent margin, which scores 35. Management is choosing between three options. This table shows the effect on the score next year.
| Option | Growth | Margin | Score |
|---|---|---|---|
| Do nothing | 30% | 5% | 35% |
| Spend $5M more on sales, which adds 8 points of growth | 38% | 0% | 38% |
| Cut $5M of costs, which loses 3 points of growth | 27% | 10% | 37% |
| Cut $5M of costs, which loses 8 points of growth | 22% | 10% | 32% |
Both the spending option and the cost cut beat doing nothing, but only if the growth effects are what management expects. The same $5 million of cost cutting lifts the score if it costs 3 points of growth and lowers it if it costs 8. The rule does not tell you the effect. It tells you the threshold.
How to judge a growth investment
Spending $5 million more on a $100 million business reduces the margin by 5 points. The spend must therefore add at least 5 points of growth, or $5 million of revenue, in the same period just to keep the score level. That is a very short payback.
In the example, $5 million of spend adds $8 million of revenue. At an 80 percent gross margin, that pays back the spend in about 0.78 years. Spending that adds revenue more slowly will lower the score first and raise it later, so look at two years, not one.
This is a limit of the rule. It measures one period, and long-payback investments look bad in the period when you spend. Use CAC payback and retention alongside it, as our SaaS marketing guide and sales-led vs product-led growth guide show.
Rule of 40 vs other SaaS metrics
The rule is a summary, so it does not replace the metrics that explain it. The table sets it beside the other metrics people use most.
| Metric | What it measures | What it adds to the rule |
|---|---|---|
| Rule of 40 | Growth plus profit | One number for balance |
| Net revenue retention | Revenue kept and grown from existing customers | Explains growth quality |
| CAC payback | Months to earn back acquisition cost | Shows efficiency of growth spending |
| Sales efficiency | Net new recurring revenue per dollar of sales and marketing | Shows return on go-to-market spend |
| Burn multiple | Cash burned per dollar of new recurring revenue | Useful for companies that lose cash |
| Gross margin | Revenue minus cost of revenue, as a share of revenue | Shows whether the product earns well |
Burn multiple is net cash burned divided by net new annual recurring revenue. I describe it generally, and I did not find a single authoritative source for its definition, so check how any benchmark defines it.
Retention underlies the rule. A company that loses many customers must spend heavily to grow, which hurts margin. Our guide to churn rate and our customer success playbook explain how to measure and improve retention.
How to improve your score
You can raise the score by growing faster, by increasing margin or by doing both. Most levers affect both sides, so think in terms of trade-offs.
Levers on growth
Pricing and packaging
Sharper plans and prices lift revenue per customer. Our SaaS pricing strategy guide explains value metrics, tiers and price experiments.
Retention and expansion
It costs less to hold on to a customer and sell them more than to go out and win a replacement. Our guide to churn rate explains the math.
Acquisition efficiency
Better channels and onboarding lower the cost of each customer. Our product-led growth playbook shows how activation affects cost per customer.
New segments and products
More customers to sell to, which needs investment.
Levers on margin
Gross margin
Cheaper infrastructure and support raise the margin on every sale.
Operating costs
Hiring pace, tools and facilities.
Pricing and discounts
Fewer discounts raise revenue without raising cost.
Customer mix
Customers who cost more to serve may need different plans.
Free usage
A free plan costs money, and our SaaS pricing strategy guide shows how to measure it.
The best moves lift both sides. A price increase that customers accept raises revenue and margin together. Better onboarding lifts retention and cuts cost. Cuts that kill growth, or growth that burns cash, only move the score in one direction.
A walk-through: trailing twelve months
Many teams calculate the rule on the last twelve months, not on a calendar year, so they can update it every quarter. To show how, I invented a company with quarterly figures. The table shows revenue and EBITDA in millions of dollars.
| Quarter | Revenue a year earlier | Revenue now | EBITDA now |
|---|---|---|---|
| Quarter 1 | $2.0M | $2.7M | $0.1M |
| Quarter 2 | $2.1M | $2.9M | $0.2M |
| Quarter 3 | $2.3M | $3.1M | $0.3M |
| Quarter 4 | $2.5M | $3.3M | $0.4M |
| Total | $8.9M | $12.0M | $1.0M |
Trailing twelve-month growth is 12.0 divided by 8.9, minus one, which is 34.8%. The EBITDA margin is 1.0 divided by 12.0, which is 8.3%. The score is 43.2%.
Now look at the latest quarter alone. Its revenue grew 32% against the same quarter a year earlier, and its EBITDA margin was 12.1%. That gives a score of 44.1%.
The two views tell the same story here, but they can differ. The latest quarter reacts faster to change, and the trailing figure is steadier. Pick one as your official measure, and show the other as a check.
Building a three-year plan with the rule
Finance teams often use the rule to set targets across several years. A common path is to start with high growth and negative margin, and shift toward profit as growth slows. I invented a plan for a company with $50 million of revenue today.
| Year | Growth | Margin | Score | Revenue | Profit |
|---|---|---|---|---|---|
| Year 1 | 35% | -5% | 30% | $67.5M | -$3.38M |
| Year 2 | 28% | 6% | 34% | $86.4M | $5.18M |
| Year 3 | 22% | 18% | 40% | $105.4M | $18.97M |
The plan reaches 40 in year three, not in year one, and total profit across the three years is about $20.8 million. That is a realistic shape for a company that is investing before it harvests. The rule does not require a score of 40 every year, but it asks whether the path is moving toward it.
Run the plan through a few bad cases. If growth in year two is 20 percent, not 28, the margin must reach 14 percent to score 34. Choose now which lever you would reach for in that case, and work out its effect on year three.
The rule for different business models
The rule was written for subscription software, but companies in other models use it too. The inputs behave differently, so adjust your reading.
| Business model | What changes | What to watch |
|---|---|---|
| Pure subscription software | Steady revenue and high gross margin | The standard rule fits well |
| Usage-based pricing | Revenue follows customer usage, so growth can swing | Use a longer period to smooth swings |
| Software plus services | Services have lower margins and lumpy revenue | Separate recurring and services revenue |
| AI-heavy products | Compute costs can lower gross margin | Check gross margin first, then the rule |
| Marketplaces and payments | Revenue may be net or gross of payouts | Define revenue the same way every year |
Our usage-based pricing examples show how revenue moves with consumption, and our guide to pricing AI features and agents explains how token and compute costs affect margin. A product with thin gross margin has less room to trade growth for profit, whatever the score says.
Gaming the number
Any single metric invites tricks, and the Rule of 40 is no exception. Knowing the usual ones helps you read other people's scores and keep your own honest.
Cutting investment before the measurement date
A short burst of cost cutting lifts margin, while the damage to growth appears later.
Pulling revenue forward
Discounting heavily for annual prepayment raises cash flow but not real demand.
Choosing the friendliest margin
Switching between EBITDA, operating income and free cash flow, depending on which looks best.
Excluding costs
Leaving out stock compensation, restructuring or other costs as one-offs every year.
Counting purchased growth
Acquisitions lift revenue without improving the product.
Capitalizing costs
Treating development spending as an asset moves it out of operating expenses.
Protect against this with a standing definition, a second stricter margin, a three-year view and plain labels. If you read a score from another company, ask which definition it uses before you compare.
Common mistakes
Comparing different definitions
A score based on EBITDA is not comparable with one based on free cash flow.
Ignoring stock compensation
It can be a quarter of revenue.
Using one year
A single period hides the trend.
Counting acquired growth as organic
Purchased revenue says little about the product.
Chasing the number
Cutting investment to lift one year's score can damage growth later.
Applying it to early-stage companies
It is a rule for scale.
Treating 40 as a law
The number is a custom, with no proof behind it.
Reading too much into a single score
Check retention, efficiency and cash.
Running a Rule of 40 review
A monthly or quarterly review keeps the rule useful. Here is a simple format, which is our suggestion.
Step 1
Calculate. Compute growth and margin on a fixed definition, for the period and the trailing twelve months.
Step 2
Show both sides. Present growth and margin separately, plus the score.
Step 3
Show a second margin. Add a stricter measure, such as free cash flow minus stock compensation.
Step 4
Explain the movement. List the biggest causes of change since last time.
Step 5
Decide. Choose which side to push, and what you will do.
Step 6
Record. Write the definitions, the choice and the reasons.
Dashboard layout
| Item | Why it belongs |
|---|---|
| Revenue, current and prior-year period | Shows the growth base |
| Growth rate, annual and trailing twelve months | Shows the trend |
| Margin on the chosen measure | Shows profit |
| A second, stricter margin | Shows sensitivity to definition |
| Rule of 40 score on both measures | Shows the range |
| Net revenue retention and CAC payback | Explains the movement |
The rule of 40 for investors
Investors and executives use the rule as a quick screen. According to Wikipedia's article, venture capitalists, public market investors and company executives all use it to weigh trade-offs in how capital is allocated. The article also repeats a claim that companies that consistently exceed the benchmark tend to achieve premium valuations.
I could not trace that valuation claim to original research with a stated sample, period and method, so I do not rely on it and you should not either. I do not make investment recommendations here. If you use the rule to look at public companies, use filings, apply one definition to all of them and remember that a score is a starting point for questions.
There are lists of high-scoring public companies online. Check how each list defines growth and margin, and when its figures were taken. As my real examples show, the choice of definition can move the same company by 20 points.
Reproduce the real numbers
This Python script fetches the structured financial data that public companies file with the SEC, selects each annual figure, and calculates the latest-year table and the three-year table in this guide. It prints the filing date and accession number behind every input, and it stops with an error if a required input is missing, so it does not turn missing data into zero. When several filings report the same year, it uses the most recently filed one. The SEC wants automated traffic to be identifiable, so fill in the header with your own name and email. The Brad Feld, Wikipedia and invented-example figures are not produced by this script. The small-company, trailing-twelve-month and planning examples are simple arithmetic that you can reproduce in a spreadsheet.
import datetime as dt
import sys
import requests
# The SEC asks automated users to identify themselves. Put your own name and email here.
HEADERS = {"User-Agent": "Your Name your.email@example.com"}
# The latest fiscal year to analyze for each company. The prior year is found from the data.
COMPANIES = {
"Atlassian": ("0001650372", "2026-06-30"),
"HubSpot": ("0001404655", "2025-12-31"),
"Dropbox": ("0001467623", "2025-12-31"),
"MongoDB": ("0001441816", "2026-01-31"),
}
# Required concepts, each with the XBRL names to try in order.
REQUIRED = {
"revenue": ["RevenueFromContractWithCustomerExcludingAssessedTax", "Revenues"],
"operating_cash_flow": ["NetCashProvidedByUsedInOperatingActivities"],
"capex": ["PaymentsToAcquirePropertyPlantAndEquipment"],
"operating_income": ["OperatingIncomeLoss"],
"stock_comp": ["ShareBasedCompensation"],
}
# Optional: capitalized software development paid in cash. If a company does not report it, say so.
OPTIONAL = {"capitalized_software": ["PaymentsToDevelopSoftware"]}
def annual_observation(facts, names, period_end):
"""Return the annual (about 12 months) observation ending on period_end, with provenance.
If several filings report it, use the most recently filed, which reflects any restatement."""
for name in names:
if name not in facts:
continue
matches = []
for item in facts[name]["units"].get("USD", []):
if item.get("form") not in ("10-K", "10-K/A") or "start" not in item or item["end"] != period_end:
continue
days = (dt.date.fromisoformat(item["end"]) - dt.date.fromisoformat(item["start"])).days
if 350 <= days <= 380:
matches.append(item)
if matches:
best = max(matches, key=lambda item: item["filed"])
return {"value": best["val"], "concept": name, "filed": best["filed"], "accession": best["accn"],
"form": best["form"], "start": best["start"], "end": best["end"]}
return None
def previous_year_end(facts, names, period_end):
ends = set()
for name in names:
for item in facts.get(name, {}).get("units", {}).get("USD", []):
if item.get("form") in ("10-K", "10-K/A") and "start" in item:
days = (dt.date.fromisoformat(item["end"]) - dt.date.fromisoformat(item["start"])).days
if 350 <= days <= 380:
ends.add(item["end"])
earlier = sorted(end for end in ends if end < period_end)
return earlier[-1] if earlier else None
def load(company, cik, year_end):
url = f"https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json"
response = requests.get(url, headers=HEADERS, timeout=60)
response.raise_for_status()
facts = response.json()["facts"]["us-gaap"]
prior_end = previous_year_end(facts, REQUIRED["revenue"], year_end)
if prior_end is None:
raise SystemExit(f"{company}: no prior fiscal year found")
data = {}
for key, names in REQUIRED.items():
observation = annual_observation(facts, names, year_end)
if observation is None:
raise SystemExit(f"{company}: required input {key} is missing for the year ending {year_end}")
data[key] = observation
data["prior_revenue"] = annual_observation(facts, REQUIRED["revenue"], prior_end)
if data["prior_revenue"] is None:
raise SystemExit(f"{company}: prior-year revenue is missing")
data["capitalized_software"] = annual_observation(facts, OPTIONAL["capitalized_software"], year_end)
return data
def scores(data):
revenue = data["revenue"]["value"]
growth = revenue / data["prior_revenue"]["value"] - 1
software = data["capitalized_software"]["value"] if data["capitalized_software"] else 0
free_cash_flow = data["operating_cash_flow"]["value"] - data["capex"]["value"] - software
return {
"growth": growth,
"fcf_margin": free_cash_flow / revenue,
"operating_margin": data["operating_income"]["value"] / revenue,
"stock_comp_share": data["stock_comp"]["value"] / revenue,
}
for company, (cik, year_end) in COMPANIES.items():
data = load(company, cik, year_end)
s = scores(data)
print(f"{company}, year ending {year_end}")
for key in ("revenue", "prior_revenue", "operating_cash_flow", "capex", "capitalized_software", "operating_income", "stock_comp"):
item = data[key]
if item is None:
print(f" {key}: not reported by this company, treated as zero for the free cash flow calculation")
else:
print(f" {key}: {item['value']:,} ({item['concept']}, filed {item['filed']}, accession {item['accession']})")
print(f" growth {s['growth']:.1%}, FCF margin {s['fcf_margin']:.1%}, operating margin {s['operating_margin']:.1%}, stock comp {s['stock_comp_share']:.1%}")
print(f" growth + FCF margin {s['growth'] + s['fcf_margin']:.1%} | growth + operating margin {s['growth'] + s['operating_margin']:.1%} | growth + (FCF margin - stock comp) {s['growth'] + s['fcf_margin'] - s['stock_comp_share']:.1%}")
print()
print("Three-year path, growth + free cash flow margin")
THREE_YEARS = {
"Atlassian": ["2024-06-30", "2025-06-30", "2026-06-30"],
"HubSpot": ["2023-12-31", "2024-12-31", "2025-12-31"],
"Dropbox": ["2023-12-31", "2024-12-31", "2025-12-31"],
"MongoDB": ["2024-01-31", "2025-01-31", "2026-01-31"],
}
for company, year_ends in THREE_YEARS.items():
cik = COMPANIES[company][0]
cells = []
for year_end in year_ends:
s = scores(load(company, cik, year_end))
cells.append(f"{year_end[:4]}: {s['growth']:.1%} + {s['fcf_margin']:.1%} = {s['growth'] + s['fcf_margin']:.1%}")
print(f" {company}: " + " | ".join(cells))
The small company example, the trade-off table and the planning scenario are simple arithmetic that you can reproduce in a spreadsheet. Change the revenue, growth and margin figures to match your own business.
Frequently asked questions
What is rule of 40?
A guideline for software businesses: annual revenue growth and profit margin, added together, should reach 40 percent or more. It folds growth and profit into a single figure.
What is the rule of 40 formula?
The score is the revenue growth rate with the profit margin added to it. Use year-over-year growth, one chosen profit measure and the same definitions every time.
How do you calculate the rule of 40?
Divide current revenue by revenue a year ago and subtract one to get growth. Divide a chosen profit measure by revenue for the margin. Sum the two results, then see where the total sits against 40.
What is a good rule of 40 score, and what is rule of 40 score?
40 or more is the usual target. Check which side carries the score, and compare with your own history, because I found no sourced benchmark for what is typical.
What is rule of 40 in SaaS?
It is the same rule applied to subscription software companies, where growth and profit are often traded against each other. Feld wrote that it fits SaaS companies at scale.
What is the rule of 40 meaning?
It means growth and profitability should together clear 40 percent. A company can grow fast with little profit, or grow slowly with high profit, but it should not do poorly on both.
Which margin should I use for the rule of 40?
Settle on a single measure and stay with it in every period. EBITDA is common, free cash flow shows cash, and free cash flow minus stock compensation is stricter. Show a second measure so the story is clear.
Does the rule of 40 use revenue or ARR growth?
Either, as long as you say which. Feld suggested year-over-year growth of monthly recurring revenue, with a check against total revenue.
What is rule of 40 in stocks and rule of 40 stocks lists?
Among investors it works as a fast first filter when sorting through software companies. It is not a valuation model and not investment advice, so use filings and consistent definitions.
What is the rule of 40 score for companies like Atlassian?
On free cash flow, I calculated about 46 percent for Atlassian's year ended June 30, 2026. On GAAP operating margin, it was about 26 percent, so the definition matters.
What is rule of 40 finance?
A rule of thumb used with software and subscription companies. It is not a formal accounting standard.
What is a rule of 40 company?
A software or subscription business whose growth rate plus profit margin reaches 40 percent or more on a stated definition. Always check which definition the label uses.
What is rule of 40 in investing?
A quick screen for software companies. It is not a valuation method or advice, so check filings and keep one definition for every company.
Does the rule of 40 apply to startups?
Feld wrote that it applies at scale, assuming at least $50 million of revenue. For earlier companies, retention, CAC payback and cash burn are usually better tests.
A quick checklist
From circuittimes.com/business/rule-of-40/
Was this guide helpful?
What went wrong?
The briefing, without the noise.
The stories that matter in technology, every weekday morning.
Free. Unsubscribe in one click.