Skip to content
Sell or Rent Calculator

How the calculator works

This page lists every formula, default and tax rule the sell or rent calculator uses, and what it leaves out. Last reviewed: October 2026.

The comparison

Let N be the number of years you rent the home before selling. The model compares your wealth at the end of year N on two paths. It runs month by month and reports by year. All tax is federal; add a state rate to the rate fields if you want to include it.

Path A: sell now

proceeds        = value × (1 − selling cost %)
adjusted basis  = purchase price + capital improvements
gain            = proceeds − adjusted basis
tax             = (gain − Section 121 exclusion) × capital gains rate   [+ 3.8% NIIT if selected]
net now         = proceeds − mortgage balance − tax
wealth (sell)   = net now × (1 + r)^N

r is the after-tax return you set for invested cash. It’s treated as an effective annual rate and compounded monthly at (1 + r)^(1/12) − 1, so 12 months give exactly 1 + r. If you are underwater, “net now” is negative and compounds as money you would have to bring to closing.

Path B: rent, then sell at the end of year N

For each month in year y (counting from 1):

rent collected   = rent × (1 + rent growth)^(y−1) × (1 − vacancy)
management       = management fee % × rent collected
maintenance      = maintenance % × value at start of year y ÷ 12
fixed costs      = [(property tax + insurance) ÷ 12 + HOA + other] × (1 + cost growth)^(y−1)
mortgage P&I     = from the amortization schedule (split into interest and principal)
pre-tax cash flow = rent collected − management − maintenance − fixed costs − mortgage P&I

For each year:

depreciable basis = min(adjusted basis, value today) × (1 − land share)
depreciation      = depreciable basis ÷ 27.5   (stops once the full basis is used)
taxable rental    = rent − management − maintenance − fixed costs − mortgage interest − depreciation
rental tax        = max(0, taxable rental) × marginal rate   [+ 3.8% NIIT if selected]

Each month, the after-tax cash flow (pre-tax cash flow minus one twelfth of that year’s rental tax) goes into a cash account that earns r. A negative flow is money you add; it reduces the account and is charged the same return as an opportunity cost.

At the end of year N the home is sold:

sale price      = value × (1 + appreciation)^N
proceeds        = sale price × (1 − selling cost %)
gain            = proceeds − (adjusted basis − depreciation taken)
recapture       = min(depreciation taken, gain)      ← never excluded
rest            = gain − recapture                    ← eligible for Section 121 if you qualify
tax             = recapture × min(marginal rate, 25%) + (rest − exclusion) × capital gains rate
wealth (rent)   = proceeds − remaining mortgage − tax + cash account

The difference is wealth (rent) − wealth (sell). If it is less than 2% of the larger of the two figures, the result is shown as too close to call.

The Section 121 rule, exactly as modeled

To exclude gain on a home sale, you must have owned the home and used it as your main home for at least 2 of the 5 years ending on the date of sale (IRS Publication 523). The cap is $250,000, or $500,000 for married filing jointly. These amounts are set in the tax code and aren’t indexed for inflation.

If you’ve lived in the home for L years up to the day you convert it to a rental, then after renting for N years the qualifying use inside the 5-year window is:

qualifying use = max(0, min(L, 5 − N))
eligible       = it is your main home today  and  qualifying use ≥ 2

Simplification: the model counts whole years and assumes the sale closes exactly at the end of year N. The real test counts days (730 of the 1,825 before the sale), so a sale at exactly 3 years is right on the boundary. In practice, close with a margin.

Other tax rules used

Break-even rent and sensitivity

Break-even rent is the starting monthly rent at which the difference is zero, with everything else unchanged. The difference rises steadily with rent, so the calculator finds it by bisection between $0 and a high bound (at least five times your rent or 3% of the home’s value per month), in at most 40 steps. If renting wins even at $0, or selling still wins at the top of the range, it says so instead.

The sensitivity tables rerun the full model with rent at −10%, your figure and +10%, appreciation at 1%, your figure and 5%, and the investment return 2 points either side of yours.

Defaults

Every default is an example you should replace. They describe a typical mid-priced home with a loan taken out a few years ago; they are not national averages.

InputDefaultNotes
Current home value$450,000
Mortgage balance$280,000Enter 0 if paid off.
Mortgage rate4%
Years left on mortgage25
Expected monthly rent$2,800/moLook at what similar homes nearby are listed for now.
Years you'd rent it before selling5
Years lived in it as main home5Counted up to the day you move out.
Monthly principal and interest (optional)CalculatedLeave blank to calculate it from balance, rate and term. Exclude escrow for tax and insurance.
Original purchase price$340,000Include purchase closing costs you paid, if you know them.
Capital improvements to date$10,000Additions and upgrades, not repairs.
Home appreciation per year3%
Rent growth per year3%
Vacancy5%Share of the year the home sits empty. 5% is about 2.5 weeks.
Property management fee8%% of rent collected. Use 0 if you manage it yourself.
Maintenance and repairs1%% of home value per year.
Property tax per year$5,400
Insurance per year$1,800A landlord policy usually costs more than a homeowner policy.
HOA per month$0/mo
Other costs per month$0/moUtilities you cover, lawn care, permits.
Growth of tax, insurance and fees3%
Selling costs7%Agent commission plus closing costs, % of sale price.
After-tax return on invested cash5%What the sale money would earn elsewhere, after tax.
Marginal income tax rate22%Federal plus state rate on extra income.
Long-term capital gains rate15%Federal 0%, 15% or 20%, plus any state tax.
Land share of value20%Land can't be depreciated. Your property tax bill may split land and building.
Main home todayYesDrives the Section 121 test.
Filing statusSingle$250,000 cap; married filing jointly is $500,000.
Net investment income taxOffTurn on if your income is above the thresholds.

The growth of tax, insurance and fees input isn’t in every calculator: it stops fixed costs staying flat for decades while rent grows, which would flatter renting.

Simplifications

What the model does not do

Testing

The engine is a framework-free TypeScript module with unit tests. Expected values come from textbook mortgage figures and a separate implementation written in Python with decimal arithmetic. The tests cover amortization, the exclusion cap, a full year of rental costs, depreciation and recapture, the 3-year cliff, break-even rent, edge cases such as zero rates and a 30-year hold, and share links.

This is a decision aid, not tax, legal or financial advice. Last reviewed: October 2026.