finance13 min read

Complete Guide to Capital Gains Tax

Understand short-term vs long-term capital gains rates, the primary residence exclusion, tax-loss harvesting strategies, and how to minimize taxes on investment profits.

ShareY
1

What Are Capital Gains and How Are They Taxed

A capital gain occurs when you sell an asset for more than you paid for it. The gain is the difference between your selling price (proceeds) and your cost basis (purchase price plus certain adjustments like commissions, improvements for real estate, and reinvested dividends). Capital gains apply to stocks, bonds, mutual funds, ETFs, real estate, cryptocurrency, collectibles, precious metals, and other investment assets. The tax you owe depends on two factors: how long you held the asset and your total taxable income. Use our <a href='/tools/capital-gains-calculator'>capital gains calculator</a> to estimate your tax on any investment sale. Capital losses (selling for less than your basis) offset capital gains dollar for dollar. If your net losses exceed your gains, you can deduct up to $3,000 per year against ordinary income and carry remaining losses forward to future years. Understanding the difference between short-term and long-term holding periods is the single most important concept for managing your capital gains tax liability.

2

Short-Term vs Long-Term Capital Gains Rates

The holding period — how long you owned the asset before selling — determines which tax rate applies. Short-term capital gains apply to assets held for one year or less and are taxed at your ordinary income tax rate, which ranges from 10 to 37 percent depending on your total taxable income. This means short-term gains can be taxed at rates more than double the long-term rate. Long-term capital gains apply to assets held for more than one year and qualify for preferential rates of 0, 15, or 20 percent in 2026. Single filers with taxable income up to approximately $47,000 pay 0 percent on long-term gains. Income from $47,000 to about $518,900 is taxed at 15 percent. Income above $518,900 is taxed at 20 percent. Additionally, a 3.8 percent Net Investment Income Tax (NIIT) applies to investment income for individuals with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly). Use our <a href='/tools/tax-bracket-calculator'>tax bracket calculator</a> to determine which capital gains rate applies to your income level. The lesson is clear: holding investments for at least one year and one day before selling can reduce your tax rate from as high as 37 percent to as low as 0 percent.

3

The Primary Residence Exclusion and Real Estate

When you sell your primary residence, you can exclude up to $250,000 in capital gains ($500,000 for married couples filing jointly) from taxation under Section 121 of the tax code. To qualify, you must have owned and lived in the home as your primary residence for at least 2 of the 5 years before the sale. The years do not need to be consecutive, and you can use this exclusion every 2 years. For example, if a married couple bought their home for $300,000, lived in it for 5 years, and sells for $750,000, their $450,000 gain is fully excluded from taxes. Without this exclusion, they would owe approximately $67,500 in capital gains tax at the 15 percent rate. For investment properties and rental real estate, different rules apply. You can defer capital gains through a 1031 like-kind exchange by reinvesting proceeds into a similar property within strict timeframes (45 days to identify replacement property, 180 days to close). Depreciation recapture on rental properties is taxed at a maximum rate of 25 percent. Use our <a href='/tools/capital-gains-calculator'>capital gains calculator</a> to model the tax impact of selling real estate with and without the primary residence exclusion.

4

Tax-Loss Harvesting and Offset Strategies

Tax-loss harvesting involves strategically selling investments at a loss to offset capital gains and reduce your tax bill. For example, if you have $10,000 in realized gains and sell another position at a $10,000 loss, your net capital gain is zero and you owe no capital gains tax. If your losses exceed your gains, you can deduct up to $3,000 against ordinary income per year, with excess losses carrying forward indefinitely. The wash-sale rule prevents you from claiming a loss if you buy a substantially identical security within 30 days before or after the sale. To stay invested while harvesting losses, you can buy a similar but not identical investment — for example, selling one S&P 500 index fund and buying a total market index fund. Robo-advisors like Betterment and Wealthfront automate tax-loss harvesting throughout the year. Additional strategies include timing sales across calendar years to manage your income bracket, gifting appreciated assets to charity (you deduct the full market value and avoid capital gains entirely), and holding assets until death (heirs receive a stepped-up cost basis, eliminating unrealized gains). Use our <a href='/tools/investment-calculator'>investment calculator</a> to project how tax-efficient investing compounds your returns over decades.

5

Capital Gains on Collectibles, Crypto, and Special Assets

Different asset types have different capital gains rules. Collectibles including art, antiques, coins, stamps, wine, and precious metals are taxed at a maximum long-term rate of 28 percent rather than the standard 15 or 20 percent. Qualified small business stock (QSBS) under Section 1202 can be partially or fully excluded from capital gains if held for more than 5 years, potentially excluding up to $10 million in gains. Cryptocurrency is treated as property by the IRS, meaning every sale, trade, or use to purchase goods triggers a taxable event. Swapping one cryptocurrency for another is a taxable transaction. Staking rewards, airdrops, and mining income are taxed as ordinary income when received and as capital gains or losses when later sold. NFT sales may be taxed at collectible rates depending on the underlying asset. Inherited assets generally receive a stepped-up cost basis to the fair market value at the date of death, eliminating all unrealized capital gains. Gifted assets retain the donor's original cost basis, meaning the recipient inherits the potential capital gains tax liability. Understanding these nuances helps you plan transactions to minimize taxes across different asset classes.

6

Planning Strategies to Minimize Capital Gains Tax

Strategic planning can significantly reduce your capital gains tax burden. First, hold investments for more than one year whenever possible to qualify for long-term rates. Second, harvest losses throughout the year to offset gains. Third, consider the timing of sales — if you expect lower income next year (retirement, sabbatical, career change), deferring sales to the lower-income year can reduce your rate. Fourth, maximize contributions to tax-advantaged accounts (401k, IRA, HSA) where capital gains are tax-deferred or tax-free. Fifth, donate appreciated assets directly to charity rather than selling and donating cash — you avoid capital gains tax entirely and deduct the full market value. Sixth, use qualified opportunity zone investments to defer and potentially reduce capital gains by investing in designated economic development areas. Seventh, if you are approaching the 0 percent long-term capital gains bracket threshold, strategically realize gains up to that threshold to lock in tax-free profits. Use our <a href='/tools/income-tax-calculator'>income tax calculator</a> alongside our capital gains calculator to model different scenarios and find the optimal timing for your investment sales.

Pro Tips

  • Always hold investments for at least one year and one day to qualify for lower long-term capital gains rates
  • Harvest tax losses throughout the year, not just in December — opportunities arise in all market conditions
  • Donate appreciated securities directly to charity to avoid capital gains tax and claim the full market value deduction
  • Keep detailed cost basis records for all investments, including reinvested dividends and purchase commissions

Frequently Asked Questions

Do I have to pay capital gains tax if I reinvest the proceeds?

Yes, in a taxable account, selling an investment triggers capital gains tax regardless of whether you reinvest the proceeds. The exception is within tax-advantaged accounts (401k, IRA) where you can buy and sell freely without triggering capital gains. The 1031 exchange allows deferral for real estate but not for stocks or other securities.

How do I calculate my cost basis?

Your cost basis is typically the purchase price plus any commissions or fees paid to acquire the asset. For stocks with reinvested dividends, each dividend reinvestment adds to your basis. For real estate, add the cost of capital improvements. Most brokerages report cost basis on Form 1099-B. If you acquired shares at different times, you can use specific identification, FIFO (first in first out), or average cost methods depending on the asset type.

What is the 0 percent capital gains rate and who qualifies?

The 0 percent long-term capital gains rate applies to taxpayers whose total taxable income falls within the lowest tax brackets. For 2026, single filers with taxable income up to approximately $47,000 and married filing jointly up to approximately $94,000 pay zero tax on long-term capital gains. This is particularly valuable for retirees or those in lower-income years who can strategically realize gains tax-free.