Selling an investment at a profit feels good until tax season arrives. The amount you owe depends less on how much you earned and more on how and when you sold. A little planning before you sell can change the outcome significantly. This guide covers the basics every investor should know.
What Is a Capital Gain?
A capital gain is the profit from selling an asset for more than you paid. Stocks, ETFs, mutual funds, bonds, and cryptocurrency all count. Your gain is calculated as the sale proceeds minus your cost basis, which is generally what you paid plus any purchase fees. Importantly, tax applies only when you sell. A rise in value on paper is not taxed until you realize it.
Short-Term vs Long-Term: The Holding Period Rule
The single biggest factor in your tax rate is how long you held the asset.
- Short-term: held one year or less. Taxed as ordinary income, the same as wages.
- Long-term: held for more than one year. Taxed at lower, preferential rates.
Federal long-term rates are 0%, 15%, or 20% depending on your taxable income, while short-term gains follow the regular income tax brackets. Selling just a few days too early can therefore cost real money. For the exact thresholds, review the current 2026 capital gains tax rates by filing status, since brackets are adjusted for inflation each year.
Other Taxes That May Apply
Net Investment Income Tax
Higher earners may owe an extra 3.8% tax on investment income once income passes certain thresholds. This sits on top of the regular capital gains rate.
State Taxes
Most states tax capital gains as ordinary income, while some have no income tax at all and a few use separate rules. Your total bill is the federal amount plus whatever your state charges.
Worked Example
Imagine you buy 100 shares at $40 each, a total of $4,000. Later you sell them at $75, receiving $7,500. Your gain is $3,500. If you held the shares for over a year and your income falls in the 15% long-term bracket, your federal tax is about $525. Had you sold within a year, the same gain would be taxed at your ordinary rate, which could be noticeably higher.
Ways to Reduce Your Capital Gains Tax
- Hold longer than a year. The simplest way to qualify for lower rates.
- Harvest losses. Losing positions can offset gains. If losses exceed gains, up to $3,000 per year can offset ordinary income, with the rest carried forward.
- Use tax-advantaged accounts. Gains inside IRAs and 401(k)s are not taxed when you sell inside the account.
- Time your sales. In a lower-income year, more of your gains may fall into the 0% bracket.
- Donate appreciated shares. Giving stock directly to charity can avoid the gain while allowing a deduction, subject to IRS rules.
- Watch fund distributions. Mutual funds can pass taxable gains to you even if you never sold.
Rules That Trip People Up
- Wash sale rule: if you sell at a loss and buy the same or a substantially identical security within 30 days before or after, the loss is disallowed for that year.
- Inherited assets: these generally receive a stepped-up cost basis.
- Gifted assets: these generally keep the giver’s original basis.
- RSUs: the value at vesting is ordinary income, and later gains are measured from that value.
Keep Good Records
Track purchase dates, prices, fees, reinvested dividends, and any adjustments. Your broker’s tax forms help, but they are not always complete, especially for older holdings or assets transferred between accounts. Accurate records make it easier to file correctly and to prove your numbers if questioned.
Final Thoughts
Capital gains tax rewards patience and planning. Know your holding period, estimate the tax before you sell, and consider whether a different timing or account could lower the bill.
This article is for general education and is not tax or financial advice. Rates and thresholds change, so confirm current figures with the IRS or a qualified tax professional.
