Why rental property gain isn't taxed like a stock sale
When you claim depreciation on a rental property, the IRS lets you deduct a portion of the building's cost against your rental income each year -- but that deduction reduces your basis. When you sell, the gain "made up" of that depreciation is recaptured and taxed at up to 25%, not the lower long-term capital gains rates that apply to the rest of your gain.
Worked example
You bought a rental property for $250,000, spent $14,000 on acquisition costs and capital improvements over the years (adjusted basis before depreciation: $264,000), and claimed $60,000 of depreciation while renting it out -- bringing your adjusted basis down to $204,000. You sell for $400,000, paying $24,000 in selling costs, for net proceeds of $376,000. Total gain: $376,000 − $204,000 = $172,000. Of that, $60,000 (matching the depreciation claimed) is unrecaptured Section 1250 gain, taxed at up to 25%. The remaining $112,000 is taxed at the regular 0/15/20% long-term rates.
When the cap doesn't bind
The 25% figure is a maximum, not a flat rate. If your ordinary tax bracket at the relevant income level is lower than 25% -- for example, if you're in the 22% or 24% bracket -- your unrecaptured Section 1250 gain is taxed at that lower rate instead. The cap only matters for taxpayers whose ordinary rate at that income level would otherwise exceed 25%.
A loss works differently than a personal residence
Unlike a loss on selling your home, a loss on a rental property is potentially tax-deductible, since it is investment/business property. But exactly how much of it you can deduct this year, versus carry forward as a suspended loss, depends on passive-activity-loss rules -- including a $25,000 special allowance for active participation that phases out between $100,000 and $150,000 of MAGI, and no limit at all for a qualifying real estate professional. This calculator reports the raw loss amount and stops there; the deductibility question needs a tax professional who knows your full situation.