How capital gains tax on real estate works
The IRS doesn't tax your sale price — it taxes your gain: what you netted after selling costs, minus everything you have invested in the property (your adjusted basis). Hold for a year or more and the gain is long-term, taxed at 0%, 15%, or 20% depending on income; sell inside a year and it's short-term, taxed as ordinary income at your regular bracket — 10% to 37%.
If the home was your primary residence for at least 2 of the last 5 years, Section 121 lets you exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) — the single biggest tax break most households ever touch, usable once every two years.
The formula
Sale minus selling costs is your net proceeds; purchase price plus capital improvements is your adjusted basis; the difference is the gain. The §121 exclusion (if you qualify) comes off before the rate is applied, and the rate is long-term or short-term depending on how long you owned it.
Worked example
A single owner bought a home for $300,000, put $50,000 of improvements into it (adjusted basis $350,000), and sells 8 years later for $650,000 with $39,000 in agent fees and closing costs (net proceeds $611,000).
The gain is $261,000. As a primary residence owned well over 2 years, the $250,000 exclusion applies, leaving $11,000 taxable. At the 15% long-term rate, the federal tax is just $1,650 — on a sale with a $350,000 price run-up. Married filing jointly, the $500,000 exclusion would cover the entire gain: $0.
Basis is the lever everyone forgets
Most people can quote their sale price and purchase price; almost nobody can produce receipts for the new roof, the kitchen remodel, the deck, or the HVAC system — and every one of those raises your basis and shrinks your taxable gain dollar for dollar. In the example above, forgetting the $50,000 of improvements would have added $7,500 to the tax bill. Repairs and maintenance don't count; improvements that add value or extend the property's life do. Keep the folder.
Two more things this calculator deliberately doesn't compute: if the property was ever a rental, the depreciation you took (or were allowed to take) gets recaptured at up to 25% when you sell — a genuine gotcha that deserves a tax professional. And most states tax capital gains on top of the federal bill, anywhere from 0% (Texas, Florida) to over 13% (California). Treat this estimate as the federal floor, not the whole story.