Capital Gains Tax: How Investment Sales Are Taxed
Understand how capital gains tax works on investment sales, the difference between short-term and long-term rates, and strategies to minimize your tax liability.
What Are Capital Gains?
A capital gain is the profit you earn when you sell an asset for more than you paid for it. The gain is the difference between the sale price and your cost basis — the original purchase price plus any commissions or improvements. If you sell for less than your cost basis, you have a capital loss. Capital gains and losses apply to stocks, bonds, mutual funds, real estate, cryptocurrency, and other investment assets.
Only realized gains — gains from assets you have actually sold — are taxable. Unrealized gains, where the value of an asset has increased but you still hold it, are not taxed. This distinction is the foundation of most tax-efficient investing strategies.
Short-Term vs Long-Term Capital Gains
The tax rate on capital gains depends on how long you held the asset before selling. Assets held for one year or less are short-term and taxed at your ordinary income tax rate, which can be as high as 37%. Assets held for more than one year are long-term and qualify for preferential rates of 0%, 15%, or 20%, depending on your taxable income.
Swipe sideways to compare columns.
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | $0 - $47,025 | $47,026 - $518,900 | $518,901+ |
| Married filing jointly | $0 - $94,050 | $94,051 - $583,750 | $583,751+ |
| Head of household | $0 - $63,000 | $63,001 - $551,350 | $551,351+ |
The difference is substantial. A single filer in the 24% ordinary income bracket who sells a stock held for 11 months pays 24% on the gain. If they wait just one more month, the rate drops to 15%. On a $10,000 gain, that is a $900 difference.
Net Investment Income Tax (NIIT)
High-income earners face an additional 3.8% Net Investment Income Tax on the lesser of their net investment income or the amount by which their modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married couples filing jointly. This means the top effective rate on long-term capital gains can reach 23.8% for high earners.
Tax Loss Harvesting
Tax loss harvesting is the practice of selling investments at a loss to offset capital gains from other sales. Losses first offset gains of the same type (short-term losses offset short-term gains first), then any remaining losses offset gains of the other type. If total losses exceed total gains, you can deduct up to $3,000 of net losses against ordinary income each year, with remaining losses carried forward indefinitely.
What is the wash sale rule?
The wash sale rule prohibits claiming a loss on a security if you buy a substantially identical security within 30 days before or after the sale. If you trigger a wash sale, the loss is postponed and added to the cost basis of the new shares, rather than being immediately deductible.
Do I pay capital gains tax on my primary home sale?
Single filers can exclude up to $250,000 of gain on the sale of their primary residence, and married couples can exclude up to $500,000, provided they have lived in the home for at least two of the last five years. Gains above these limits are taxed as long-term capital gains.