Capital gains tax applies to the profit from selling an asset — stocks, funds, real estate, and certain other investments — for more than its original purchase price (the "cost basis"). The tax treatment splits into two meaningfully different categories based almost entirely on one factor: the holding period.
Short-term vs. long-term capital gains
Assets held for one year or less before selling generate short-term capital gains, taxed as ordinary income at the seller's regular tax bracket — often a meaningfully higher rate than the alternative. Assets held for more than one year generate long-term capital gains, taxed at generally lower preferential rates specifically established to encourage longer-term investing.
Why the holding period is worth actively tracking
The difference between selling an investment at 11 months versus 13 months can mean a meaningfully different tax rate on the exact same dollar amount of profit, purely due to which side of the one-year line the sale falls on. For anyone close to that threshold with a significant gain, it's worth checking the exact purchase date before deciding when to sell.
Calculating the actual gain
The taxable gain is the sale price minus the cost basis — the original purchase price plus certain adjustments like reinvested dividends or, for real estate, certain improvement costs. Accurately tracking cost basis matters, particularly for investments held over many years or through multiple reinvestments, since an inaccurate basis calculation can overstate or understate the actual taxable gain.
Capital losses can offset gains
Selling an investment at a loss can offset capital gains realized elsewhere in the same tax year, and if losses exceed gains, a limited amount can typically offset ordinary income as well, with any excess carried forward to future tax years. This is the basis of "tax-loss harvesting" — deliberately realizing losses to offset gains — a strategy some robo-advisors automate, as mentioned in our robo-advisor guide.
Tax-advantaged accounts avoid this entirely
Investments held inside a 401(k), traditional IRA, or Roth IRA generally aren't subject to capital gains tax on individual trades within the account — taxes are instead handled according to the account type's own rules (deferred until withdrawal for traditional accounts, tax-free for qualified Roth withdrawals). This is one of the significant, if less discussed, advantages of tax-advantaged retirement accounts over a standard taxable brokerage account.
The home sale exclusion
Selling a primary residence has a specific, often substantial exclusion from capital gains tax — a significant amount of gain can typically be excluded for single filers, and roughly double for married couples filing jointly, provided ownership and residency requirements are met. This is a meaningful, commonly underappreciated tax benefit specific to primary home sales, distinct from investment property sales.
Capital gains tax rates, exclusion amounts, and specific rules change periodically through tax legislation — this article covers the general structure, and a tax professional can provide guidance specific to a particular sale and current tax law.